From e885c73f5cfd11f3814eadab9fc37572b8b4adf8 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Sun, 6 Nov 2022 11:38:13 +0200 Subject: [PATCH 01/54] upgraded tendermint starport --- app/app.go | 22 +- cmd/bzed/main.go | 2 +- docs/static/openapi.yml | 54574 ++++++++++++---- go.mod | 32 +- go.sum | 571 +- testutil/network/network.go | 2 +- testutil/simapp/simapp.go | 2 +- .../bze-alphateam/bze/bze.scavenge/index.ts | 61 +- .../bze/bze.scavenge/module/index.ts | 6 +- .../bze/bze.scavenge/module/rest.ts | 14 +- .../cosmos/base/query/v1beta1/pagination.ts | 55 +- .../module/types/google/api/http.ts | 95 +- .../types/google/protobuf/descriptor.ts | 2019 +- 13 files changed, 44210 insertions(+), 13245 deletions(-) diff --git a/app/app.go b/app/app.go index fc1645f6..ab5b5b42 100644 --- a/app/app.go +++ b/app/app.go @@ -1,7 +1,7 @@ package app import ( - ibcclientclient "github.com/cosmos/ibc-go/modules/core/02-client/client" + ibcclientclient "github.com/cosmos/ibc-go/v2/modules/core/02-client/client" "io" "net/http" "os" @@ -70,14 +70,14 @@ import ( upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/ibc-go/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/modules/core" - ibcclient "github.com/cosmos/ibc-go/modules/core/02-client" - ibcporttypes "github.com/cosmos/ibc-go/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/modules/core/24-host" - ibckeeper "github.com/cosmos/ibc-go/modules/core/keeper" + "github.com/cosmos/ibc-go/v2/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v2/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v2/modules/core" + ibcclient "github.com/cosmos/ibc-go/v2/modules/core/02-client" + ibcporttypes "github.com/cosmos/ibc-go/v2/modules/core/05-port/types" + ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host" + ibckeeper "github.com/cosmos/ibc-go/v2/modules/core/keeper" "github.com/spf13/cast" abci "github.com/tendermint/tendermint/abci/types" tmjson "github.com/tendermint/tendermint/libs/json" @@ -85,8 +85,8 @@ import ( tmos "github.com/tendermint/tendermint/libs/os" dbm "github.com/tendermint/tm-db" - "github.com/tendermint/spm/cosmoscmd" - "github.com/tendermint/spm/openapiconsole" + "github.com/tendermint/starport/starport/pkg/cosmoscmd" + "github.com/tendermint/starport/starport/pkg/openapiconsole" "github.com/bze-alphateam/bze/docs" scavengemodule "github.com/bze-alphateam/bze/x/scavenge" diff --git a/cmd/bzed/main.go b/cmd/bzed/main.go index 560cf493..2f57e859 100644 --- a/cmd/bzed/main.go +++ b/cmd/bzed/main.go @@ -5,7 +5,7 @@ import ( "github.com/bze-alphateam/bze/app" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/tendermint/spm/cosmoscmd" + "github.com/tendermint/starport/starport/pkg/cosmoscmd" ) func main() { diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index c4168141..4d199614 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -28,7 +28,7 @@ paths: pagination: type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -102,7 +102,7 @@ paths: required: false type: string format: uint64 - - name: pagination.countTotal + - name: pagination.count_total description: >- count_total is set to true to indicate that the result set should include @@ -121,6 +121,9 @@ paths: 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 @@ -200,7 +203,7 @@ paths: pagination: type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -274,7 +277,7 @@ paths: required: false type: string format: uint64 - - name: pagination.countTotal + - name: pagination.count_total description: >- count_total is set to true to indicate that the result set should include @@ -293,6 +296,9 @@ paths: 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 @@ -348,210 +354,198 @@ paths: type: string tags: - Query - /cosmos/authz/v1beta1/grants: + /cosmos/auth/v1beta1/accounts: get: - summary: 'Returns list of `Authorization`, granted to the grantee by the granter.' - operationId: CosmosAuthzV1Beta1Grants + summary: Accounts returns all the existing accounts + description: 'Since: cosmos-sdk 0.43' + operationId: CosmosAuthV1Beta1Accounts responses: '200': description: A successful response. schema: type: object properties: - grants: + accounts: 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 + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - protocol buffer message. This string must contain at - least + protocol buffer message. This string must contain at + least - one "/" character. The last segment of the URL's - path must represent + one "/" character. The last segment of the URL's path + must represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be - in a canonical form + `path/google.protobuf.Duration`). The name should be in + a canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the - binary all types that they + In practice, teams usually precompile into the binary + all types that they - expect it to use in the context of Any. However, for - URLs which use the + expect it to use in the context of Any. However, for + URLs which use the - scheme `http`, `https`, or no scheme, one can - optionally set up a type + scheme `http`, `https`, or no scheme, one can optionally + set up a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available - in the official + Note: this functionality is not currently available in + the official - protobuf release, and it is not used for type URLs - beginning with + protobuf release, and it is not used for type URLs + beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty - scheme) might be + Schemes other than `http`, `https` (or the empty scheme) + might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any - values in the form + Protobuf library provides support to pack/unpack Any values + in the form - of utility functions or additional generated methods of - the Any type. + of utility functions or additional generated methods of the + Any type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - The pack methods provided by protobuf library will by - default use + The pack methods provided by protobuf library will by + default use - 'type.googleapis.com/full.type.name' as the type URL and - the unpack + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - methods only use the fully qualified type name after the - last '/' + methods only use the fully qualified type name after the + last '/' - in the type URL, for example "foo.bar.com/x/y.z" will - yield type + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - name "y.z". + name "y.z". - JSON + JSON - ==== + ==== - The JSON representation of an `Any` value uses the - regular + The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, - with an + representation of the deserialized, embedded message, with + an - additional field `@type` which contains the type URL. - Example: + additional field `@type` which contains the type URL. + Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If the embedded message type is well-known and has a - custom JSON + If the embedded message type is well-known and has a custom + JSON - representation, that representation will be embedded - adding a field + representation, that representation will be embedded adding + a field - `value` which holds the custom JSON in addition to the - `@type` + `value` which holds the custom JSON in addition to the + `@type` - field. Example (for message - [google.protobuf.Duration][]): + field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - expiration: - type: string - format: date-time - description: |- - Grant gives permissions to execute - the provide method with expiration time. - description: >- - authorizations is a list of grants granted for grantee by - granter. + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: accounts are the existing accounts pagination: - description: pagination defines an pagination for the response. + description: pagination defines the pagination in the response. type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -566,8 +560,11 @@ paths: was set, its value is undefined otherwise description: >- - QueryGrantsResponse is the response type for the - Query/Authorizations RPC method. + QueryAccountsResponse is the response type for the Query/Accounts + RPC method. + + + Since: cosmos-sdk 0.43 default: description: An unexpected error response. schema: @@ -754,21 +751,6 @@ paths: "value": "1.212s" } parameters: - - name: granter - in: query - required: false - type: string - - name: grantee - in: query - required: false - type: string - - name: msgTypeUrl - 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 @@ -800,7 +782,7 @@ paths: required: false type: string format: uint64 - - name: pagination.countTotal + - name: pagination.count_total description: >- count_total is set to true to indicate that the result set should include @@ -819,62 +801,196 @@ paths: 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}': + '/cosmos/auth/v1beta1/accounts/{address}': get: - summary: AllBalances queries the balance of all coins for a single account. - operationId: CosmosBankV1Beta1AllBalances + summary: Account returns account details based on address. + operationId: CosmosAuthV1Beta1Account 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. + account: type: object properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + '@type': type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - was set, its value is undefined otherwise - description: >- - QueryAllBalancesResponse is the response type for the - Query/AllBalances RPC + protocol buffer message. This string must contain at least - method. + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the 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: @@ -892,234 +1008,364 @@ paths: 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. + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - It is less efficient than using key. Only one of offset or key - should + protocol buffer message. This string must contain at + least - 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. + one "/" character. The last segment of the URL's path + must represent - 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.countTotal - description: >- - count_total is set to true to indicate that the result set should - include + the fully qualified name of the type (as in - a count of the total number of items available for pagination in - UIs. + `path/google.protobuf.Duration`). The name should be in + a canonical form - count_total is only respected when offset is used. It is ignored - when key + (e.g., leading "." is not accepted). - 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. - in: query - required: false - type: boolean - tags: - - Query - '/cosmos/bank/v1beta1/balances/{address}/{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: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + In practice, teams usually precompile into the binary + all types that they - NOTE: The amount field is an Int which implements the custom - method + expect it to use in the context of Any. However, for + URLs which use the - signatures required by gogoproto. - 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 + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the 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 address to query balances for. - in: path - required: true - type: string - - name: denom - description: denom is the coin denom to query balances for. + description: address defines the address to query for. in: path required: true type: string tags: - Query - /cosmos/bank/v1beta1/denoms_metadata: + '/cosmos/auth/v1beta1/module_accounts/{name}': get: - summary: >- - DenomsMetadata queries the client metadata for all registered coin - denominations. - operationId: CosmosBankV1Beta1DenomsMetadata + summary: ModuleAccountByName returns the module account info by module name + operationId: CosmosAuthV1Beta1ModuleAccountByName responses: '200': description: A successful response. schema: type: object properties: - metadatas: - type: array - items: - type: object - properties: - description: - type: string - denomUnits: - 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 + account: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - raise the base_denom to in order to equal the - given DenomUnit's denom + protocol buffer message. This string must contain at least - 1 denom = 1^exponent base_denom + one "/" character. The last segment of the URL's path must + represent - (e.g. with a base_denom of uatom, one can create a - DenomUnit of 'atom' with + the fully qualified name of the type (as in - 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 - 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 + `path/google.protobuf.Duration`). The name should be in a + canonical form - be the same as the display. - description: |- - Metadata represents a struct that describes - a basic token. + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} description: >- - metadata provides the client information for all the - registered tokens. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + `Any` contains an arbitrary serialized protocol buffer message + along with a - was set, its value is undefined otherwise - description: >- - QueryDenomsMetadataResponse is the response type for the - Query/DenomsMetadata RPC + URL that describes the type of the serialized message. - method. + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the 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: @@ -1137,144 +1383,212 @@ paths: 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. + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - It is less efficient than using key. Only one of offset or key - should + protocol buffer message. This string must contain at + least - 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. + one "/" character. The last segment of the URL's path + must represent - 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.countTotal - description: >- - count_total is set to true to indicate that the result set should - include + the fully qualified name of the type (as in - a count of the total number of items available for pagination in - UIs. + `path/google.protobuf.Duration`). The name should be in + a canonical form - count_total is only respected when offset is used. It is ignored - when key + (e.g., leading "." is not accepted). - 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. - in: query - required: false - type: boolean + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the 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/bank/v1beta1/denoms_metadata/{denom}': + /cosmos/auth/v1beta1/params: get: - summary: DenomsMetadata queries the client metadata of a given coin denomination. - operationId: CosmosBankV1Beta1DenomMetadata + summary: Params queries all parameters. + operationId: CosmosAuthV1Beta1Params responses: '200': description: A successful response. schema: type: object properties: - metadata: + params: + description: params defines the parameters of the module. type: object properties: - description: + max_memo_characters: type: string - denomUnits: - 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 = 1^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: + format: uint64 + tx_sig_limit: type: string - description: >- - base represents the base denom (should be the DenomUnit - with exponent = 0). - display: + format: uint64 + tx_size_cost_per_byte: type: string - description: |- - display indicates the suggested denom that should be - displayed in clients. - name: + format: uint64 + sig_verify_cost_ed25519: type: string - title: 'name defines the name of the token (eg: Cosmos Atom)' - symbol: + format: uint64 + sig_verify_cost_secp256k1: type: string - description: >- - symbol is the token symbol usually shown on exchanges (eg: - ATOM). This can - - be the same as the display. - description: |- - Metadata represents a struct that describes - a basic token. + format: uint64 description: >- - QueryDenomMetadataResponse is the response type for the - Query/DenomMetadata RPC - + QueryParamsResponse is the response type for the Query/Params RPC method. default: description: An unexpected error response. @@ -1293,79 +1607,187 @@ paths: 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: - sendEnabled: - 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 + A URL/resource name that uniquely identifies the type of + the serialized - sendable). - defaultSendEnabled: - 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 + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the 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/bank/v1beta1/supply: + '/cosmos/bank/v1beta1/balances/{address}': get: - summary: TotalSupply queries the total supply of all coins. - operationId: CosmosBankV1Beta1TotalSupply + summary: AllBalances queries the balance of all coins for a single account. + operationId: CosmosBankV1Beta1AllBalances responses: '200': description: A successful response. schema: type: object properties: - supply: + balances: type: array items: type: object @@ -1382,12 +1804,12 @@ paths: method signatures required by gogoproto. - title: supply is the supply of the coins + description: balances is the balances of all the coins. pagination: description: pagination defines the pagination in the response. type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -1401,11 +1823,11 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - title: >- - QueryTotalSupplyResponse is the response type for the - Query/TotalSupply RPC + description: >- + QueryAllBalancesResponse is the response type for the + Query/AllBalances RPC - method + method. default: description: An unexpected error response. schema: @@ -1425,6 +1847,11 @@ paths: 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 @@ -1456,7 +1883,7 @@ paths: required: false type: string format: uint64 - - name: pagination.countTotal + - name: pagination.count_total description: >- count_total is set to true to indicate that the result set should include @@ -1475,22 +1902,25 @@ paths: 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/{denom}': + '/cosmos/bank/v1beta1/balances/{address}/by_denom': get: - summary: SupplyOf queries the supply of a single coin. - operationId: CosmosBankV1Beta1SupplyOf + 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: - amount: + balance: type: object properties: denom: @@ -1506,7 +1936,7 @@ paths: signatures required by gogoproto. description: >- - QuerySupplyOfResponse is the response type for the Query/SupplyOf + QueryBalanceResponse is the response type for the Query/Balance RPC method. default: description: An unexpected error response. @@ -1527,130 +1957,129 @@ paths: type: string additionalProperties: {} parameters: - - name: denom - description: denom is the coin denom to query balances for. + - 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/distribution/v1beta1/community_pool: + /cosmos/bank/v1beta1/denoms_metadata: 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/{delegatorAddress}/rewards': - get: - summary: |- - DelegationTotalRewards queries the total rewards accrued by a each - validator. - operationId: CosmosDistributionV1Beta1DelegationTotalRewards + summary: >- + DenomsMetadata queries the client metadata for all registered coin + denominations. + operationId: CosmosBankV1Beta1DenomsMetadata responses: '200': description: A successful response. schema: type: object properties: - rewards: + metadatas: type: array items: type: object properties: - validatorAddress: + description: type: string - reward: + denom_units: type: array items: type: object properties: denom: type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a - decimal amount. + 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 - NOTE: The amount field is an Dec which implements the - custom method + 1 denom = 1^exponent base_denom - 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: + (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 - amount: + description: >- + base represents the base denom (should be the DenomUnit + with exponent = 0). + display: type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. + 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. - 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. + Since: cosmos-sdk 0.43 + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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: @@ -1670,138 +2099,150 @@ paths: type: string additionalProperties: {} parameters: - - name: delegatorAddress - description: delegator_address defines the delegator address to query for. - in: path - required: true + - 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/distribution/v1beta1/delegators/{delegatorAddress}/rewards/{validatorAddress}': + '/cosmos/bank/v1beta1/denoms_metadata/{denom}': get: - summary: DelegationRewards queries the total rewards accrued by a delegation. - operationId: CosmosDistributionV1Beta1DelegationRewards + summary: DenomsMetadata queries the client metadata of a given coin denomination. + operationId: CosmosBankV1Beta1DenomMetadata 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: delegatorAddress - description: delegator_address defines the delegator address to query for. - in: path - required: true - type: string - - name: validatorAddress - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - tags: - - Query - '/cosmos/distribution/v1beta1/delegators/{delegatorAddress}/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: delegatorAddress - description: delegator_address defines the delegator address to query for. - in: path - required: true - type: string - tags: - - Query - '/cosmos/distribution/v1beta1/delegators/{delegatorAddress}/withdraw_address': - get: - summary: DelegatorWithdrawAddress queries withdraw address of a delegator. - operationId: CosmosDistributionV1Beta1DelegatorWithdrawAddress - responses: - '200': - description: A successful response. - schema: - type: object - properties: - withdrawAddress: - type: string - description: withdraw_address defines the delegator address to query for. - description: |- - QueryDelegatorWithdrawAddressResponse is the response type for the - Query/DelegatorWithdrawAddress RPC method. + 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 = 1^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 + description: |- + Metadata represents a struct that describes + a basic token. + description: >- + QueryDenomMetadataResponse is the response type for the + Query/DenomMetadata RPC + + method. default: description: An unexpected error response. schema: @@ -1821,17 +2262,17 @@ paths: type: string additionalProperties: {} parameters: - - name: delegatorAddress - description: delegator_address defines the delegator address to query for. + - name: denom + description: denom is the coin denom to query the metadata for. in: path required: true type: string tags: - Query - /cosmos/distribution/v1beta1/params: + /cosmos/bank/v1beta1/params: get: - summary: Params queries params of the distribution module. - operationId: CosmosDistributionV1Beta1Params + summary: Params queries the parameters of x/bank module. + operationId: CosmosBankV1Beta1Params responses: '200': description: A successful response. @@ -1839,20 +2280,28 @@ paths: type: object properties: params: - description: params defines the parameters of the module. type: object properties: - communityTax: - type: string - baseProposerReward: - type: string - bonusProposerReward: - type: string - withdrawAddrEnabled: + 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). + default_send_enabled: type: boolean + description: Params defines the parameters for the bank module. description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. + QueryParamsResponse defines the response type for querying x/bank + parameters. default: description: An unexpected error response. schema: @@ -1873,41 +2322,59 @@ paths: additionalProperties: {} tags: - Query - '/cosmos/distribution/v1beta1/validators/{validatorAddress}/commission': + '/cosmos/bank/v1beta1/spendable_balances/{address}': get: - summary: ValidatorCommission queries accumulated commission for a validator. - operationId: CosmosDistributionV1Beta1ValidatorCommission + summary: |- + SpendableBalances queries the spenable balance of all coins for a single + account. + operationId: CosmosBankV1Beta1SpendableBalances responses: '200': description: A successful response. schema: type: object properties: - commission: - description: commission defines the commision the validator received. + 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: - 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. - + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - NOTE: The amount field is an Dec which implements the - custom method + was set, its value is undefined otherwise + description: >- + QuerySpendableBalancesResponse defines the gRPC response structure + for querying - signatures required by gogoproto. - title: |- - QueryValidatorCommissionResponse is the response type for the - Query/ValidatorCommission RPC method + an account's spendable balances. default: description: An unexpected error response. schema: @@ -1927,117 +2394,105 @@ paths: type: string additionalProperties: {} parameters: - - name: validatorAddress - description: validator_address defines the validator address to query for. + - name: address + description: address is the address to query spendable balances for. in: path required: true type: string - tags: - - Query - '/cosmos/distribution/v1beta1/validators/{validatorAddress}/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. + - 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 - NOTE: The amount field is an Dec which implements the - custom method + 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. - signatures required by gogoproto. - description: >- - ValidatorOutstandingRewards represents outstanding - (un-withdrawn) rewards + 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 - for a validator inexpensive to track, allows simple sanity - checks. - description: >- - QueryValidatorOutstandingRewardsResponse is the response type for - the + a count of the total number of items available for pagination in + UIs. - 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: validatorAddress - description: validator_address defines the validator address to query for. - in: path - required: true - type: string + 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/distribution/v1beta1/validators/{validatorAddress}/slashes': + /cosmos/bank/v1beta1/supply: get: - summary: ValidatorSlashes queries slash events of a validator. - operationId: CosmosDistributionV1Beta1ValidatorSlashes + summary: TotalSupply queries the total supply of all coins. + operationId: CosmosBankV1Beta1TotalSupply responses: '200': description: A successful response. schema: type: object properties: - slashes: + supply: type: array items: type: object properties: - validatorPeriod: + denom: type: string - format: uint64 - fraction: + amount: type: string description: >- - ValidatorSlashEvent represents a validator slash event. + Coin defines a token with a denomination and an amount. - Height is implicit within the store key. - This is needed to calculate appropriate amount of staking - tokens + NOTE: The amount field is an Int which implements the custom + method - for delegations which are withdrawn after a slash has - occurred. - description: slashes defines the slashes the validator received. + signatures required by gogoproto. + title: supply is the supply of the coins pagination: - description: pagination defines the pagination in the response. + description: |- + pagination defines the pagination in the response. + + Since: cosmos-sdk 0.43 type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -2051,9 +2506,11 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - description: |- - QueryValidatorSlashesResponse is the response type for the - Query/ValidatorSlashes RPC method. + title: >- + QueryTotalSupplyResponse is the response type for the + Query/TotalSupply RPC + + method default: description: An unexpected error response. schema: @@ -2073,27 +2530,6 @@ paths: type: string additionalProperties: {} parameters: - - name: validatorAddress - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - - name: startingHeight - description: >- - starting_height defines the optional starting height to query the - slashes. - in: query - required: false - type: string - format: uint64 - - name: endingHeight - 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 @@ -2125,7 +2561,7 @@ paths: required: false type: string format: uint64 - - name: pagination.countTotal + - name: pagination.count_total description: >- count_total is set to true to indicate that the result set should include @@ -2144,48 +2580,698 @@ paths: 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: + '/cosmos/bank/v1beta1/supply/{denom}': get: - summary: AllEvidence queries all evidence. - operationId: CosmosEvidenceV1Beta1AllEvidence + summary: SupplyOf queries the supply of a single coin. + operationId: CosmosBankV1Beta1SupplyOf responses: '200': description: A successful response. schema: type: object properties: - evidence: + amount: + 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: >- + 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 - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). + additionalProperties: {} + parameters: + - name: denom + description: denom is the coin denom to query balances for. + in: path + required: true + type: string + tags: + - Query + /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: + 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 - In practice, teams usually precompile into the binary - all types that they + 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 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 + Tendermint 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 Tendermint 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 Tendermint 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 Tendermint 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: >- + 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 @@ -2334,92 +3420,663 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - description: evidence returns all evidences. - pagination: - description: pagination defines the pagination in the response. + 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: - nextKey: + hash: type: string format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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.) + 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, - Note: this functionality is not currently available in - the official + 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 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 + Tendermint 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 Tendermint 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 Tendermint 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 Tendermint 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: >- + 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 @@ -2544,242 +4201,94 @@ paths: "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 + - name: height + in: path + required: true type: string - format: uint64 - - name: pagination.countTotal - 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. - in: query - required: false - type: boolean + format: int64 tags: - - Query - '/cosmos/evidence/v1beta1/evidence/{evidenceHash}': + - Service + /cosmos/base/tendermint/v1beta1/node_info: get: - summary: Evidence queries evidence based on evidence hash. - operationId: CosmosEvidenceV1Beta1Evidence + summary: GetNodeInfo queries the current node info. + operationId: CosmosBaseTendermintV1Beta1GetNodeInfo responses: '200': description: A successful response. schema: type: object properties: - evidence: + default_node_info: type: object properties: - '@type': + 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 - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + 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: >- - QueryEvidenceResponse is the response type for the Query/Evidence + GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. default: description: An unexpected error response. @@ -2966,157 +4475,72 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - parameters: - - name: evidenceHash - description: evidence_hash defines the hash of the requested evidence. - in: path - required: true - type: string - format: byte tags: - - Query - '/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}': + - Service + /cosmos/base/tendermint/v1beta1/syncing: get: - summary: Allowance returns fee granted to the grantee by the granter. - operationId: CosmosFeegrantV1Beta1Allowance + summary: GetSyncing queries node syncing. + operationId: CosmosBaseTendermintV1Beta1GetSyncing 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 and filtered fee allowance. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type - of the serialized + 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 + protocol buffer message. This string must contain at + least - one "/" character. The last segment of the URL's path - must represent + one "/" character. The last segment of the URL's path + must represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be - in a canonical form + `path/google.protobuf.Duration`). The name should be in + a canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary - all types that they + In practice, teams usually precompile into the binary + all types that they - expect it to use in the context of Any. However, for - URLs which use the + expect it to use in the context of Any. However, for + URLs which use the - scheme `http`, `https`, or no scheme, one can - optionally set up a type + scheme `http`, `https`, or no scheme, one can optionally + set up a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for 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. + * If no scheme is provided, `https` is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] @@ -3253,52 +4677,29 @@ paths: "@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}': + - Service + /cosmos/base/tendermint/v1beta1/validatorsets/latest: get: - summary: Allowances returns all the grants for address. - operationId: CosmosFeegrantV1Beta1Allowances + summary: GetLatestValidatorSet queries latest validator-set. + operationId: CosmosBaseTendermintV1Beta1GetLatestValidatorSet responses: '200': description: A successful response. schema: type: object properties: - allowances: + block_height: + type: string + format: int64 + validators: type: array items: type: object properties: - granter: - type: string - description: >- - granter is the address of the user granting an allowance - of their funds. - grantee: + address: 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 and filtered fee - allowance. + pub_key: type: object properties: '@type': @@ -3360,15 +4761,131 @@ paths: 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. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the 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: - nextKey: + next_key: type: string format: byte title: |- @@ -3383,8 +4900,8 @@ paths: was set, its value is undefined otherwise description: >- - QueryAllowancesResponse is the response type for the - Query/Allowances RPC method. + GetLatestValidatorSetResponse is the response type for the + Query/GetValidatorSetByHeight RPC method. default: description: An unexpected error response. schema: @@ -3571,10 +5088,6 @@ paths: "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 @@ -3606,7 +5119,7 @@ paths: required: false type: string format: uint64 - - name: pagination.countTotal + - name: pagination.count_total description: >- count_total is set to true to indicate that the result set should include @@ -3625,83 +5138,237 @@ paths: 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/params/{paramsType}': + - Service + '/cosmos/base/tendermint/v1beta1/validatorsets/{height}': get: - summary: Params queries all parameters of the gov module. - operationId: CosmosGovV1Beta1Params + summary: GetValidatorSetByHeight queries validator-set at a given height. + operationId: CosmosBaseTendermintV1Beta1GetValidatorSetByHeight responses: '200': description: A successful response. schema: type: object properties: - votingParams: - description: voting_params defines the parameters related to voting. - type: object - properties: - votingPeriod: - type: string - description: Length of the voting period. - depositParams: - description: deposit_params defines the parameters related to deposit. - type: object - properties: - minDeposit: - type: array - items: + block_height: + type: string + format: int64 + validators: + type: array + items: + type: object + properties: + address: + type: string + pub_key: type: object properties: - denom: - type: string - amount: + '@type': type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} description: >- - Coin defines a token with a denomination and an amount. + `Any` contains an arbitrary serialized protocol buffer + message along with a + URL that describes the type of the serialized message. - 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. - maxDepositPeriod: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. - Initial value: 2 - months. - tallyParams: - description: tally_params defines the parameters related to tally. + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the 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: - quorum: - type: string - format: byte - description: >- - Minimum percentage of total stake needed to vote for a - result to be - considered valid. - threshold: + next_key: type: string format: byte - description: >- - Minimum proportion of Yes votes for proposal to pass. - Default value: 0.5. - vetoThreshold: + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: type: string - format: byte - description: >- - Minimum value of Veto votes to Total votes ratio for - proposal to be - vetoed. Default value: 1/3. + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. + GetValidatorSetByHeightResponse is the response type for the + Query/GetValidatorSetByHeight RPC method. default: description: An unexpected error response. schema: @@ -3888,305 +5555,244 @@ paths: "value": "1.212s" } parameters: - - name: paramsType - description: >- - params_type defines which parameters to query for, can be one of - "voting", - - "tallying" or "deposit". + - name: height 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: - proposalId: - type: string - format: uint64 - 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). + 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 - In practice, teams usually precompile into the - binary all types that they + 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. - expect it to use in the context of Any. However, for - URLs which use the + 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 - scheme `http`, `https`, or no scheme, one can - optionally set up a type + a count of the total number of items available for pagination in + UIs. - server that maps type URLs to message definitions as - follows: + 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. - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Service + /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: this functionality is not currently available - in the official - protobuf release, and it is not used for type URLs - beginning with + NOTE: The amount field is an Dec which implements the custom + method - type.googleapis.com. + 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. - Schemes other than `http`, `https` (or the empty - scheme) might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + NOTE: The amount field is an Dec which implements the + custom method - URL that describes the type of the serialized message. + 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. - Protobuf library provides support to pack/unpack Any - values in the form + NOTE: The amount field is an Dec which implements the custom + method - of utility functions or additional generated methods of - the Any type. + 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. - Example 1: Pack and unpack a message in C++. + NOTE: The amount field is an Dec which implements the custom + method - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - 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 - description: >- - ProposalStatus enumerates the valid statuses of a - proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal 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. - finalTallyResult: - type: object - properties: - 'yes': - type: string - abstain: - type: string - 'no': - type: string - noWithVeto: - type: string - description: >- - TallyResult defines a standard tally for a governance - proposal. - submitTime: - type: string - format: date-time - depositEndTime: - type: string - format: date-time - totalDeposit: - 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. - votingStartTime: - type: string - format: date-time - votingEndTime: - type: string - format: date-time - description: >- - Proposal defines the core field members of a governance - proposal. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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. + 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: @@ -4204,529 +5810,82 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the 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: proposalStatus - description: |- - proposal_status defines the status of the proposals. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal 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 + - name: delegator_address + description: delegator_address defines the delegator address to query for. + in: path + required: true 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 + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true 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 + 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 - format: uint64 - - name: pagination.countTotal - 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. - in: query - required: false - type: boolean tags: - Query - '/cosmos/gov/v1beta1/proposals/{proposalId}': + '/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address': get: - summary: Proposal queries proposal details based on ProposalID. - operationId: CosmosGovV1Beta1Proposal + summary: DelegatorWithdrawAddress queries withdraw address of a delegator. + operationId: CosmosDistributionV1Beta1DelegatorWithdrawAddress responses: '200': description: A successful response. schema: type: object properties: - proposal: - type: object - properties: - proposalId: - type: string - format: uint64 - 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: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - 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 - description: >- - ProposalStatus enumerates the valid statuses of a - proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal 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. - finalTallyResult: - type: object - properties: - 'yes': - type: string - abstain: - type: string - 'no': - type: string - noWithVeto: - type: string - description: >- - TallyResult defines a standard tally for a governance - proposal. - submitTime: - type: string - format: date-time - depositEndTime: - type: string - format: date-time - totalDeposit: - 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. - votingStartTime: - type: string - format: date-time - votingEndTime: - type: string - format: date-time - description: >- - Proposal defines the core field members of a governance - proposal. - description: >- - QueryProposalResponse is the response type for the Query/Proposal - RPC method. + 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: @@ -4744,247 +5903,40 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the 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: proposalId - description: proposal_id defines the unique id of the proposal. + - name: delegator_address + description: delegator_address defines the delegator address to query for. in: path required: true type: string - format: uint64 tags: - Query - '/cosmos/gov/v1beta1/proposals/{proposalId}/deposits': + /cosmos/distribution/v1beta1/params: get: - summary: Deposits queries all deposits of a single proposal. - operationId: CosmosGovV1Beta1Deposits + summary: Params queries params of the distribution module. + operationId: CosmosDistributionV1Beta1Params responses: '200': description: A successful response. schema: type: object properties: - deposits: - type: array - items: - type: object - properties: - proposalId: - type: string - format: uint64 - depositor: - type: string - 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: >- - Deposit defines an amount deposited by an account address to - an active - - proposal. - pagination: - description: pagination defines the pagination in the response. + params: + description: params defines the parameters of the module. type: object properties: - nextKey: + community_tax: type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + base_proposer_reward: type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise + bonus_proposer_reward: + type: string + withdraw_addr_enabled: + type: boolean description: >- - QueryDepositsResponse is the response type for the Query/Deposits - RPC method. + QueryParamsResponse is the response type for the Query/Params RPC + method. default: description: An unexpected error response. schema: @@ -5002,257 +5954,84 @@ paths: properties: '@type': type: string + additionalProperties: {} + 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 commision the validator received. + type: object + properties: + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: + DecCoin defines a token with a denomination and a + decimal amount. - * If no scheme is provided, `https` is assumed. + NOTE: The amount field is an Dec which implements the + custom method - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. + 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: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the 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: proposalId - description: proposal_id defines the unique id of the proposal. + - name: validator_address + description: validator_address defines the validator address to query for. 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.countTotal - 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. - in: query - required: false - type: boolean tags: - Query - '/cosmos/gov/v1beta1/proposals/{proposalId}/deposits/{depositor}': + '/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards': get: - summary: >- - Deposit queries single deposit information based proposalID, - depositAddr. - operationId: CosmosGovV1Beta1Deposit + summary: ValidatorOutstandingRewards queries rewards of a validator address. + operationId: CosmosDistributionV1Beta1ValidatorOutstandingRewards responses: '200': description: A successful response. schema: type: object properties: - deposit: + rewards: type: object properties: - proposalId: - type: string - format: uint64 - depositor: - type: string - amount: + rewards: type: array items: type: object @@ -5262,21 +6041,25 @@ paths: amount: type: string description: >- - Coin defines a token with a denomination and an amount. + DecCoin defines a token with a denomination and a + decimal amount. - NOTE: The amount field is an Int which implements the + NOTE: The amount field is an Dec which implements the custom method signatures required by gogoproto. description: >- - Deposit defines an amount deposited by an account address to - an active + ValidatorOutstandingRewards represents outstanding + (un-withdrawn) rewards - proposal. + for a validator inexpensive to track, allows simple sanity + checks. description: >- - QueryDepositResponse is the response type for the Query/Deposit - RPC method. + QueryValidatorOutstandingRewardsResponse is the response type for + the + + Query/ValidatorOutstandingRewards RPC method. default: description: An unexpected error response. schema: @@ -5294,20 +6077,196 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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). @@ -5462,47 +6421,30 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - parameters: - - name: proposalId - 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/{proposalId}/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: evidence returns all evidences. + pagination: + description: pagination defines the pagination in the response. type: object properties: - 'yes': + next_key: type: string - abstain: - type: string - 'no': - type: string - noWithVeto: + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: type: string - description: >- - TallyResult defines a standard tally for a governance - proposal. + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise description: >- - QueryTallyResultResponse is the response type for the Query/Tally - RPC method. + QueryAllEvidenceResponse is the response type for the + Query/AllEvidence RPC + + method. default: description: An unexpected error response. schema: @@ -5689,426 +6631,246 @@ paths: "value": "1.212s" } parameters: - - name: proposalId - description: proposal_id defines the unique id of the proposal. - in: path - required: true + - 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 - tags: - - Query - '/cosmos/gov/v1beta1/proposals/{proposalId}/votes': + - 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/{evidence_hash}': get: - summary: Votes queries votes of a given proposal. - operationId: CosmosGovV1Beta1Votes + summary: Evidence queries evidence based on evidence hash. + operationId: CosmosEvidenceV1Beta1Evidence responses: '200': description: A successful response. schema: type: object properties: - votes: - type: array - items: - type: object - properties: - proposalId: - type: string - format: uint64 - voter: - type: string - 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: - 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. - weight: - type: string - description: >- - WeightedVoteOption defines a unit of vote for vote - split. - description: >- - Vote defines a vote on a governance proposal. - - A Vote consists of a proposal ID, the voter, and the vote - option. - description: votes defined the queried votes. - pagination: - description: pagination defines the pagination in the response. + evidence: type: object properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + '@type': 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 + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - protocol buffer message. This string must contain at - least + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path - must represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in - a canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary - all types that they + In practice, teams usually precompile into the binary all + types that they - expect it to use in the context of Any. However, for - URLs which use the + expect it to use in the context of Any. However, for URLs + which use the - scheme `http`, `https`, or no scheme, one can optionally - set up a type + scheme `http`, `https`, or no scheme, one can optionally + set up a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in - the official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs - beginning with + protobuf release, and it is not used for type URLs + beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) - might be + Schemes other than `http`, `https` (or the empty scheme) + might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values - in the form + Protobuf library provides support to pack/unpack Any values in + the form - of utility functions or additional generated methods of the - Any type. + of utility functions or additional generated methods of the + Any type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { ... - if (any.UnpackTo(&foo)) { - ... - } + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - representation of the deserialized, embedded message, with - an + The pack methods provided by protobuf library will by default + use - additional field `@type` which contains the type URL. - Example: + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + methods only use the fully qualified type name after the last + '/' - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - If the embedded message type is well-known and has a custom - JSON + name "y.z". - representation, that representation will be embedded adding - a field - `value` which holds the custom JSON in addition to the - `@type` - field. Example (for message [google.protobuf.Duration][]): + JSON - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposalId - 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 + The JSON representation of an `Any` value uses the regular - 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. + representation of the deserialized, embedded message, with an - 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.countTotal - description: >- - count_total is set to true to indicate that the result set should - include + additional field `@type` which contains the type URL. Example: - a count of the total number of items available for pagination in - UIs. + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - count_total is only respected when offset is used. It is ignored - when key + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - 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. - in: query - required: false - type: boolean - tags: - - Query - '/cosmos/gov/v1beta1/proposals/{proposalId}/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: - type: object - properties: - proposalId: - type: string - format: uint64 - voter: - type: string - option: - description: >- - Deprecated: Prefer to use `options` instead. This field is - set in queries + If the embedded message type is well-known and has a custom + JSON - if and only if `len(options) == 1` and that option has - weight 1. In all + representation, that representation will be embedded adding a + field - 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: - 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. + `value` which holds the custom JSON in addition to the `@type` - - 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. - weight: - type: string - description: >- - WeightedVoteOption defines a unit of vote for vote - split. - description: >- - Vote defines a vote on a governance proposal. + field. Example (for message [google.protobuf.Duration][]): - A Vote consists of a proposal ID, the voter, and the vote - option. + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } description: >- - QueryVoteResponse is the response type for the Query/Vote RPC - method. + QueryEvidenceResponse is the response type for the Query/Evidence + RPC method. default: description: An unexpected error response. schema: @@ -6295,52 +7057,107 @@ paths: "value": "1.212s" } parameters: - - name: proposalId - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - - name: voter - description: voter defines the oter address for the proposals. + - name: evidence_hash + description: evidence_hash defines the hash of the requested evidence. in: path required: true type: string + format: byte tags: - Query - /cosmos/slashing/v1beta1/params: + '/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}': get: - summary: Params queries the parameters of slashing module - operationId: CosmosSlashingV1Beta1Params + summary: Allowance returns fee granted to the grantee by the granter. + operationId: CosmosFeegrantV1Beta1Allowance responses: '200': description: A successful response. schema: type: object properties: - params: + allowance: + description: allowance is a allowance granted for grantee by granter. type: object properties: - signedBlocksWindow: - type: string - format: int64 - minSignedPerWindow: + granter: type: string - format: byte - downtimeJailDuration: - type: string - slashFractionDoubleSign: - type: string - format: byte - slashFractionDowntime: + description: >- + granter is the address of the user granting an allowance + of their funds. + grantee: 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 + 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 and filtered 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: @@ -6358,420 +7175,51 @@ paths: 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 - startHeight: - type: string - format: int64 - title: >- - Height at which validator was first a candidate OR was - unjailed - indexOffset: - type: string - format: int64 description: >- - Index which is incremented each time the validator was a - bonded + A URL/resource name that uniquely identifies the type of + the serialized - in a block and may have signed a precommit or not. This - in conjunction with the + protocol buffer message. This string must contain at + least - `SignedBlocksWindow` param determines the index in the - `MissedBlocksBitArray`. - jailedUntil: - 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 + one "/" character. The last segment of the URL's path + must represent - once the validator commits an equivocation or for any - other configured misbehiavor. - missedBlocksCounter: - type: string - format: int64 - description: >- - A counter kept to avoid unnecessary array reads. + the fully qualified name of the type (as in - Note that `Sum(MissedBlocksBitArray)` always equals - `MissedBlocksCounter`. - description: >- - ValidatorSigningInfo defines a validator's signing info for - monitoring their + `path/google.protobuf.Duration`). The name should be in + a canonical form - liveness activity. - title: info is the signing info of all validators - pagination: - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + (e.g., leading "." is not accepted). - 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. + In practice, teams usually precompile into the binary + all types that they - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: >- - QuerySigningInfosResponse is the response type for the - Query/SigningInfos RPC + expect it to use in the context of Any. However, for + URLs which use the - method - default: - description: An unexpected 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. + scheme `http`, `https`, or no scheme, one can optionally + set up a type - It is less efficient than using key. Only one of offset or key - should + server that maps type URLs to message definitions as + follows: - 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.countTotal - description: >- - count_total is set to true to indicate that the result set should - include + * If no scheme is provided, `https` is assumed. - a count of the total number of items available for pagination in - UIs. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - 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. - in: query - required: false - type: boolean - tags: - - Query - '/cosmos/slashing/v1beta1/signing_infos/{consAddress}': - get: - summary: SigningInfo queries the signing info of given cons address - operationId: CosmosSlashingV1Beta1SigningInfo - responses: - '200': - description: A successful response. - schema: - type: object - properties: - valSigningInfo: - type: object - properties: - address: - type: string - startHeight: - type: string - format: int64 - title: >- - Height at which validator was first a candidate OR was - unjailed - indexOffset: - 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`. - jailedUntil: - 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. - missedBlocksCounter: - 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: >- - val_signing_info is the signing info of requested val cons - address - 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: consAddress - description: cons_address is the address to query signing info of - in: path - required: true - type: string - tags: - - Query - '/cosmos/staking/v1beta1/delegations/{delegatorAddr}': - get: - summary: >- - DelegatorDelegations queries all delegations of a given delegator - address. - operationId: CosmosStakingV1Beta1DelegatorDelegations - responses: - '200': - description: A successful response. - schema: - type: object - properties: - delegationResponses: - type: array - items: - type: object - properties: - delegation: - type: object - properties: - delegatorAddress: - type: string - description: >- - delegator_address is the bech32-encoded address of - the delegator. - validatorAddress: - 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: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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 + Note: this functionality is not currently available in + the official protobuf release, and it is not used for type URLs beginning with @@ -6896,194 +7344,121 @@ paths: "value": "1.212s" } parameters: - - name: delegatorAddr - description: delegator_addr defines the delegator address to query for. + - name: granter + description: >- + granter is the address of the user granting an allowance of their + funds. 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 + - name: grantee 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 + grantee is the address of the user being granted an allowance of + another user's funds. + in: path + required: true type: string - format: uint64 - - name: pagination.countTotal - 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. - in: query - required: false - type: boolean tags: - Query - '/cosmos/staking/v1beta1/delegators/{delegatorAddr}/redelegations': + '/cosmos/feegrant/v1beta1/allowances/{grantee}': get: - summary: Redelegations queries redelegations of given address. - operationId: CosmosStakingV1Beta1Redelegations + summary: Allowances returns all the grants for address. + operationId: CosmosFeegrantV1Beta1Allowances responses: '200': description: A successful response. schema: type: object properties: - redelegationResponses: + allowances: type: array items: type: object properties: - redelegation: + 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 and filtered fee + allowance. type: object properties: - delegatorAddress: - type: string - description: >- - delegator_address is the bech32-encoded address of - the delegator. - validatorSrcAddress: - type: string - description: >- - validator_src_address is the validator redelegation - source operator address. - validatorDstAddress: + '@type': type: string description: >- - validator_dst_address is the validator redelegation - destination operator address. - entries: - type: array - items: - type: object - properties: - creationHeight: - type: string - format: int64 - description: >- - creation_height defines the height which the - redelegation took place. - completionTime: - type: string - format: date-time - description: >- - completion_time defines the unix time for - redelegation completion. - initialBalance: - type: string - description: >- - initial_balance defines the initial balance - when redelegation started. - sharesDst: - type: string - description: >- - shares_dst is the amount of - destination-validator shares created by - redelegation. - 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 + A URL/resource name that uniquely identifies the + type of the serialized - from a particular source validator to a particular - destination validator. - entries: - type: array - items: - type: object - properties: - redelegationEntry: - type: object - properties: - creationHeight: - type: string - format: int64 - description: >- - creation_height defines the height which the - redelegation took place. - completionTime: - type: string - format: date-time - description: >- - completion_time defines the unix time for - redelegation completion. - initialBalance: - type: string - description: >- - initial_balance defines the initial balance - when redelegation started. - sharesDst: - type: string - description: >- - shares_dst is the amount of - destination-validator shares created by - redelegation. - description: >- - RedelegationEntry defines a redelegation object - with relevant metadata. - balance: - type: string - description: >- - RedelegationEntryResponse is equivalent to a - RedelegationEntry except that it + protocol buffer message. This string must contain at + least - contains a balance in addition to shares which is more - suitable for client + one "/" character. The last segment of the URL's + path must represent - responses. - description: >- - RedelegationResponse is equivalent to a Redelegation except - that its entries + the fully qualified name of the type (as in - contain a balance in addition to shares which is more - suitable for client + `path/google.protobuf.Duration`). The name should be + in a canonical form - responses. + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for 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 the pagination in the response. + description: pagination defines an pagination for the response. type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -7098,10 +7473,8 @@ paths: was set, its value is undefined otherwise description: >- - QueryRedelegationsResponse is response type for the - Query/Redelegations RPC - - method. + QueryAllowancesResponse is the response type for the + Query/Allowances RPC method. default: description: An unexpected error response. schema: @@ -7288,21 +7661,10 @@ paths: "value": "1.212s" } parameters: - - name: delegatorAddr - description: delegator_addr defines the delegator address to query for. + - name: grantee in: path required: true type: string - - name: srcValidatorAddr - description: src_validator_addr defines the validator address to redelegate from. - in: query - required: false - type: string - - name: dstValidatorAddr - 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 @@ -7334,7 +7696,7 @@ paths: required: false type: string format: uint64 - - name: pagination.countTotal + - name: pagination.count_total description: >- count_total is set to true to indicate that the result set should include @@ -7353,81 +7715,115 @@ paths: 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/{delegatorAddr}/unbonding_delegations': + '/cosmos/feegrant/v1beta1/issued/{granter}': get: - summary: >- - DelegatorUnbondingDelegations queries all unbonding delegations of a - given - - delegator address. - operationId: CosmosStakingV1Beta1DelegatorUnbondingDelegations + summary: |- + AllowancesByGranter returns all the grants given by an address + Since v0.46 + operationId: CosmosFeegrantV1Beta1AllowancesByGranter responses: '200': description: A successful response. schema: type: object properties: - unbondingResponses: + allowances: type: array items: type: object properties: - delegatorAddress: + granter: type: string description: >- - delegator_address is the bech32-encoded address of the - delegator. - validatorAddress: + granter is the address of the user granting an allowance + of their funds. + grantee: type: string description: >- - validator_address is the bech32-encoded address of the - validator. - entries: - type: array - items: - type: object - properties: - creationHeight: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding - took place. - completionTime: - type: string - format: date-time - description: >- - completion_time is the unix time for unbonding - completion. - initialBalance: - 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. - 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 + grantee is the address of the user being granted an + allowance of another user's funds. + allowance: + description: >- + allowance can be any of basic and filtered fee + allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - for a single validator in an time-ordered list. + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for 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 the pagination in the response. + description: pagination defines an pagination for the response. type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -7442,10 +7838,8 @@ paths: was set, its value is undefined otherwise description: >- - QueryUnbondingDelegatorDelegationsResponse is response type for - the - - Query/UnbondingDelegatorDelegations RPC method. + QueryAllowancesByGranterResponse is the response type for the + Query/AllowancesByGranter RPC method. default: description: An unexpected error response. schema: @@ -7632,8 +8026,7 @@ paths: "value": "1.212s" } parameters: - - name: delegatorAddr - description: delegator_addr defines the delegator address to query for. + - name: granter in: path required: true type: string @@ -7668,7 +8061,7 @@ paths: required: false type: string format: uint64 - - name: pagination.countTotal + - name: pagination.count_total description: >- count_total is set to true to indicate that the result set should include @@ -7687,100 +8080,368 @@ paths: 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/{delegatorAddr}/validators': + '/cosmos/gov/v1beta1/params/{params_type}': get: - summary: |- - DelegatorValidators queries all validators info for given delegator - address. - operationId: CosmosStakingV1Beta1DelegatorValidators + summary: Params queries all parameters of the gov module. + operationId: CosmosGovV1Beta1Params responses: '200': description: A successful response. schema: type: object properties: - validators: + voting_params: + description: voting_params defines the parameters related to voting. + type: object + properties: + voting_period: + type: string + description: Length 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: - operatorAddress: + '@type': type: string description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensusPubkey: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain at - least + A URL/resource name that uniquely identifies the type of + the serialized - one "/" character. The last segment of the URL's - path must represent + protocol buffer message. This string must contain at + least - the fully qualified name of the type (as in + one "/" character. The last segment of the URL's path + must represent - `path/google.protobuf.Duration`). The name should be - in a canonical form + the fully qualified name of the type (as in - (e.g., leading "." is not accepted). + `path/google.protobuf.Duration`). The name should be in + a canonical form + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the - binary all types that they - expect it to use in the context of Any. However, for - URLs which use the + In practice, teams usually precompile into the binary + all types that they - scheme `http`, `https`, or no scheme, one can - optionally set up a type + expect it to use in the context of Any. However, for + URLs which use the - server that maps type URLs to message definitions as - follows: + scheme `http`, `https`, or no scheme, one can optionally + set up a type + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * If no scheme is provided, `https` is assumed. - Note: this functionality is not currently available - in the official + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - protobuf release, and it is not used for type URLs - beginning with + Note: this functionality is not currently available in + the official - type.googleapis.com. + protobuf release, and it is not used for type URLs + beginning with + type.googleapis.com. - Schemes other than `http`, `https` (or the empty - scheme) might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + Schemes other than `http`, `https` (or the empty scheme) + might be - URL that describes the type of the serialized message. + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the 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 + 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: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. Protobuf library provides support to pack/unpack Any @@ -7889,137 +8550,83 @@ paths: "@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). - delegatorShares: - type: string - description: >- - delegator_shares defines total shares issued to a - validator's delegators. - description: + - 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: >- - description defines the description terms for the - validator. + ProposalStatus enumerates the valid statuses of a + proposal. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal 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. + final_tally_result: type: object properties: - moniker: + 'yes': 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: + abstain: type: string - description: website defines an optional website link. - securityContact: + 'no': type: string - description: >- - security_contact defines an optional email for - security contact. - details: + no_with_veto: type: string - description: details define other optional details. - unbondingHeight: - type: string - format: int64 description: >- - unbonding_height defines, if unbonding, the height at - which this validator has begun unbonding. - unbondingTime: + TallyResult defines a standard tally for a governance + proposal. + submit_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: - commissionRates: - 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. - maxRate: - type: string - description: >- - max_rate defines the maximum commission rate - which validator can ever charge, as a fraction. - maxChangeRate: - type: string - description: >- - max_change_rate defines the maximum daily - increase of the validator commission, as a - fraction. - updateTime: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - minSelfDelegation: + deposit_end_time: type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. - 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 + format: date-time + 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. - 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 + NOTE: The amount field is an Int which implements the + custom method - multiplied by exchange rate. - description: validators defines the the validators' info of a delegator. + signatures required by gogoproto. + voting_start_time: + type: string + format: date-time + voting_end_time: + type: string + format: date-time + description: >- + Proposal defines the core field members of a governance + proposal. pagination: description: pagination defines the pagination in the response. type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -8033,9 +8640,11 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - description: |- - QueryDelegatorValidatorsResponse is response type for the - Query/DelegatorValidators RPC method. + description: >- + QueryProposalsResponse is the response type for the + Query/Proposals RPC + + method. default: description: An unexpected error response. schema: @@ -8222,10 +8831,41 @@ paths: "value": "1.212s" } parameters: - - name: delegatorAddr - description: delegator_addr defines the delegator address to query for. - in: path - required: true + - name: proposal_status + description: |- + proposal_status defines the status of the proposals. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal 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: |- @@ -8258,7 +8898,7 @@ paths: required: false type: string format: uint64 - - name: pagination.countTotal + - name: pagination.count_total description: >- count_total is set to true to indicate that the result set should include @@ -8277,32 +8917,31 @@ paths: 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/{delegatorAddr}/validators/{validatorAddr}': + '/cosmos/gov/v1beta1/proposals/{proposal_id}': get: - summary: |- - DelegatorValidator queries validator info for given delegator validator - pair. - operationId: CosmosStakingV1Beta1DelegatorValidator + summary: Proposal queries proposal details based on ProposalID. + operationId: CosmosGovV1Beta1Proposal responses: '200': description: A successful response. schema: type: object properties: - validator: + proposal: type: object properties: - operatorAddress: + proposal_id: type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensusPubkey: + format: uint64 + content: type: object properties: '@type': @@ -8475,133 +9114,80 @@ paths: "@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). - delegatorShares: - type: string - description: >- - delegator_shares defines total shares issued to a - validator's delegators. - description: + - 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: >- - description defines the description terms for the - validator. + ProposalStatus enumerates the valid statuses of a + proposal. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal 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. + final_tally_result: type: object properties: - moniker: - type: string - description: >- - moniker defines a human-readable name for the - validator. - identity: + 'yes': type: string - description: >- - identity defines an optional identity signature (ex. - UPort or Keybase). - website: + abstain: type: string - description: website defines an optional website link. - securityContact: + 'no': type: string - description: >- - security_contact defines an optional email for - security contact. - details: + no_with_veto: type: string - description: details define other optional details. - unbondingHeight: - type: string - format: int64 description: >- - unbonding_height defines, if unbonding, the height at - which this validator has begun unbonding. - unbondingTime: + TallyResult defines a standard tally for a governance + proposal. + submit_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: - commissionRates: - 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. - maxRate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - maxChangeRate: - type: string - description: >- - max_change_rate defines the maximum daily increase - of the validator commission, as a fraction. - updateTime: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - minSelfDelegation: + deposit_end_time: type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. - 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 + format: date-time + 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. - 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 + NOTE: The amount field is an Int which implements the + custom method - multiplied by exchange rate. - description: |- - QueryDelegatorValidatorResponse response type for the - Query/DelegatorValidator RPC method. + signatures required by gogoproto. + voting_start_time: + type: string + format: date-time + voting_end_time: + type: string + format: date-time + 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: @@ -8788,426 +9374,373 @@ paths: "value": "1.212s" } parameters: - - name: delegatorAddr - description: delegator_addr defines the delegator address to query for. - in: path - required: true - type: string - - name: validatorAddr - description: validator_addr defines the validator address to query for. + - name: proposal_id + description: proposal_id defines the unique id of the proposal. in: path required: true type: string + format: uint64 tags: - Query - '/cosmos/staking/v1beta1/historical_info/{height}': + '/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits': get: - summary: HistoricalInfo queries the historical info for given height. - operationId: CosmosStakingV1Beta1HistoricalInfo + summary: Deposits queries all deposits of a single proposal. + operationId: CosmosGovV1Beta1Deposits 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 + deposits: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + depositor: + type: string + amount: + type: array + items: type: object properties: - block: + denom: type: string - format: uint64 - app: + amount: 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 + Coin defines a token with a denomination and an + amount. - state transition machine. - chainId: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - lastBlockId: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - partSetHeader: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - lastCommitHash: - type: string - format: byte - title: hashes of block data - dataHash: - type: string - format: byte - validatorsHash: - type: string - format: byte - title: hashes from the app output from the prev block - nextValidatorsHash: - type: string - format: byte - consensusHash: - type: string - format: byte - appHash: - type: string - format: byte - lastResultsHash: - type: string - format: byte - evidenceHash: - type: string - format: byte - title: consensus info - proposerAddress: - type: string - format: byte - description: Header defines the structure of a Tendermint block header. - valset: - type: array - items: - type: object - properties: - operatorAddress: - type: string - description: >- - operator_address defines the address of the - validator's operator; bech encoded in JSON. - consensusPubkey: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - protocol buffer message. This string must - contain at least + NOTE: The amount field is an Int which implements the + custom method - one "/" character. The last segment of the URL's - path must represent + signatures required by gogoproto. + description: >- + Deposit defines an amount deposited by an account address to + an active - the fully qualified name of the type (as in + proposal. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - `path/google.protobuf.Duration`). The name - should be in a canonical form + 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 - (e.g., leading "." is not accepted). + protocol buffer message. This string must contain at + least + one "/" character. The last segment of the URL's path + must represent - In practice, teams usually precompile into the - binary all types that they + the fully qualified name of the type (as in - expect it to use in the context of Any. However, - for URLs which use the + `path/google.protobuf.Duration`). The name should be in + a canonical form - scheme `http`, `https`, or no scheme, one can - optionally set up a type + (e.g., leading "." is not accepted). - server that maps type URLs to message - definitions as follows: + In practice, teams usually precompile into the binary + all types that they - * If no scheme is provided, `https` is assumed. + expect it to use in the context of Any. However, for + URLs which use the - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup - results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + scheme `http`, `https`, or no scheme, one can optionally + set up a type - Note: this functionality is not currently - available in the official + server that maps type URLs to message definitions as + follows: - protobuf release, and it is not used for type - URLs beginning with - type.googleapis.com. + * If no scheme is provided, `https` is assumed. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Schemes other than `http`, `https` (or the empty - scheme) might be + Note: this functionality is not currently available in + the official - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol - buffer message along with a + protobuf release, and it is not used for type URLs + beginning with - URL that describes the type of the serialized - message. + type.googleapis.com. - Protobuf library provides support to pack/unpack Any - values in the form + Schemes other than `http`, `https` (or the empty scheme) + might be - of utility functions or additional generated methods - of the Any type. + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + URL that describes the type of the serialized message. - Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Protobuf library provides support to pack/unpack Any values + in the form - Example 2: Pack and unpack a message in Java. + of utility functions or additional generated methods of the + Any type. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - Example 3: Pack and unpack a message in Python. + Example 1: Pack and unpack a message in C++. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 4: Pack and unpack a message in Go + Example 2: Pack and unpack a message in Java. - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - The pack methods provided by protobuf library will - by default use + Example 3: Pack and unpack a message in Python. - 'type.googleapis.com/full.type.name' as the type URL - and the unpack + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - methods only use the fully qualified type name after - the last '/' + Example 4: Pack and unpack a message in Go - in the type URL, for example "foo.bar.com/x/y.z" - will yield type + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - name "y.z". + The pack methods provided by protobuf library will by + default use + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + methods only use the fully qualified type name after the + last '/' - JSON + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - ==== + name "y.z". - The JSON representation of an `Any` value uses the - regular - representation of the deserialized, embedded - message, with an - additional field `@type` which contains the type - URL. Example: + JSON - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + ==== - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + The JSON representation of an `Any` value uses the regular - If the embedded message type is well-known and has a - custom JSON + representation of the deserialized, embedded message, with + an - representation, that representation will be embedded - adding a field + additional field `@type` which contains the type URL. + Example: - `value` which holds the custom JSON in addition to - the `@type` + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - field. Example (for message - [google.protobuf.Duration][]): + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - { - "@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). - delegatorShares: - 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. - securityContact: - type: string - description: >- - security_contact defines an optional email for - security contact. - details: - type: string - description: details define other optional details. - unbondingHeight: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height - at which this validator has begun unbonding. - unbondingTime: - 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: - commissionRates: - 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. - maxRate: - type: string - description: >- - max_rate defines the maximum commission rate - which validator can ever charge, as a - fraction. - maxChangeRate: - type: string - description: >- - max_change_rate defines the maximum daily - increase of the validator commission, as a - fraction. - updateTime: - type: string - format: date-time - description: >- - update_time is the last time the commission rate - was changed. - minSelfDelegation: - type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. - description: >- - Validator defines a validator, together with the total - amount of the + If the embedded message type is well-known and has a custom + JSON - Validator's bond shares and their exchange rate to - coins. Slashing results in + representation, that representation will be embedded adding + a field - a decrease in the exchange rate, allowing correct - calculation of future + `value` which holds the custom JSON in addition to the + `@type` - undelegations without iterating over delegators. When - coins are delegated to + field. Example (for message [google.protobuf.Duration][]): - this validator, the validator is credited with a - delegation whose number of + { + "@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. - bond shares is based on the amount of coins delegated - divided by the current + It is less efficient than using key. Only one of offset or key + should - exchange rate. Voting power can be calculated as total - bonded shares + 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. - multiplied by exchange rate. - description: >- - QueryHistoricalInfoResponse is response type for the - Query/HistoricalInfo RPC + 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 - method. + 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: + type: object + properties: + proposal_id: + type: string + format: uint64 + depositor: + type: string + 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: >- + Deposit defines an amount deposited by an account address to + an active + + proposal. + description: >- + QueryDepositResponse is the response type for the Query/Deposit + RPC method. default: description: An unexpected error response. schema: @@ -9394,53 +9927,46 @@ paths: "value": "1.212s" } parameters: - - name: height - description: height defines at which height to query the historical info. + - 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 - format: int64 tags: - Query - /cosmos/staking/v1beta1/params: + '/cosmos/gov/v1beta1/proposals/{proposal_id}/tally': get: - summary: Parameters queries the staking parameters. - operationId: CosmosStakingV1Beta1Params + summary: TallyResult queries the tally of a proposal vote. + operationId: CosmosGovV1Beta1TallyResult responses: '200': description: A successful response. schema: type: object properties: - params: - description: params holds all the parameters of this module. + tally: type: object properties: - unbondingTime: + 'yes': type: string - description: unbonding_time is the time duration of unbonding. - maxValidators: - type: integer - format: int64 - description: max_validators is the maximum number of validators. - maxEntries: - type: integer - format: int64 - description: >- - max_entries is the max entries for either unbonding - delegation or redelegation (per pair/trio). - historicalEntries: - type: integer - format: int64 - description: >- - historical_entries is the number of historical entries to - persist. - bondDenom: + abstain: type: string - description: bond_denom defines the bondable coin denomination. + 'no': + type: string + no_with_veto: + type: string + description: >- + TallyResult defines a standard tally for a governance + proposal. description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. + QueryTallyResultResponse is the response type for the Query/Tally + RPC method. default: description: An unexpected error response. schema: @@ -9626,76 +10152,161 @@ paths: "@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/staking/v1beta1/pool: + '/cosmos/gov/v1beta1/proposals/{proposal_id}/votes': get: - summary: Pool queries the pool info. - operationId: CosmosStakingV1Beta1Pool + summary: Votes queries votes of a given proposal. + operationId: CosmosGovV1Beta1Votes responses: '200': description: A successful response. schema: type: object properties: - pool: - description: pool defines the pool info. - type: object - properties: - notBondedTokens: - type: string - bondedTokens: - 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: + votes: type: array items: type: object properties: - '@type': + proposal_id: + type: string + format: uint64 + voter: type: string + option: description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - + Deprecated: Prefer to use `options` instead. This field + is set in queries - * If no scheme is provided, `https` is assumed. + 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: + 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. + weight: + type: string + description: >- + WeightedVoteOption defines a unit of vote for vote + split. + + + Since: cosmos-sdk 0.43 + title: '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 defined the queried votes. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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][] @@ -9832,350 +10443,505 @@ paths: "@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/staking/v1beta1/validators: + '/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}': get: - summary: Validators queries all validators that match the given status. - operationId: CosmosStakingV1Beta1Validators + summary: 'Vote queries voted information based on proposalID, voterAddr.' + operationId: CosmosGovV1Beta1Vote responses: '200': description: A successful response. schema: type: object properties: - validators: - type: array - items: - type: object - properties: - operatorAddress: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensusPubkey: + vote: + type: object + properties: + proposal_id: + type: string + format: uint64 + voter: + type: string + 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: - '@type': + option: 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: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's - path must represent - - the fully qualified name of the type (as in + VoteOption enumerates the valid vote options for a + given governance proposal. - `path/google.protobuf.Duration`). The name should be - in a canonical form + - 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. + weight: + type: string + description: >- + WeightedVoteOption defines a unit of vote for vote + split. - (e.g., leading "." is not accepted). + Since: cosmos-sdk 0.43 + title: 'Since: cosmos-sdk 0.43' + description: >- + Vote defines a vote on a governance proposal. - In practice, teams usually precompile into the - binary all types that they + A Vote consists of a proposal ID, the voter, and the vote + option. + 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 - expect it to use in the context of Any. However, for - URLs which use the + protocol buffer message. This string must contain at + least - scheme `http`, `https`, or no scheme, one can - optionally set up a type + one "/" character. The last segment of the URL's path + must represent - server that maps type URLs to message definitions as - follows: + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name should be in + a canonical form - * If no scheme is provided, `https` is assumed. + (e.g., leading "." is not accepted). - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - Note: this functionality is not currently available - in the official + In practice, teams usually precompile into the binary + all types that they - protobuf release, and it is not used for type URLs - beginning with + expect it to use in the context of Any. However, for + URLs which use the - type.googleapis.com. + scheme `http`, `https`, or no scheme, one can optionally + set up a type + server that maps type URLs to message definitions as + follows: - Schemes other than `http`, `https` (or the empty - scheme) might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + * If no scheme is provided, `https` is assumed. - URL that describes the type of the serialized message. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + Note: this functionality is not currently available in + the official - Protobuf library provides support to pack/unpack Any - values in the form + protobuf release, and it is not used for type URLs + beginning with - of utility functions or additional generated methods of - the Any type. + type.googleapis.com. - Example 1: Pack and unpack a message in C++. + Schemes other than `http`, `https` (or the empty scheme) + might be - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - Example 2: Pack and unpack a message in Java. + URL that describes the type of the serialized message. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - Example 3: Pack and unpack a message in Python. + Protobuf library provides support to pack/unpack Any values + in the form - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + of utility functions or additional generated methods of the + Any type. - Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + Example 1: Pack and unpack a message in C++. - The pack methods provided by protobuf library will by - default use + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - 'type.googleapis.com/full.type.name' as the type URL and - the unpack + Example 2: Pack and unpack a message in Java. - methods only use the fully qualified type name after the - last '/' + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - in the type URL, for example "foo.bar.com/x/y.z" will - yield type + Example 3: Pack and unpack a message in Python. - name "y.z". + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + Example 4: Pack and unpack a message in Go + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - JSON + The pack methods provided by protobuf library will by + default use - ==== + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - The JSON representation of an `Any` value uses the - regular + methods only use the fully qualified type name after the + last '/' - representation of the deserialized, embedded message, - with an + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - additional field `@type` which contains the type URL. - Example: + name "y.z". - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - If the embedded message type is well-known and has a - custom JSON + JSON - representation, that representation will be embedded - adding a field + ==== - `value` which holds the custom JSON in addition to the - `@type` + The JSON representation of an `Any` value uses the regular - field. Example (for message - [google.protobuf.Duration][]): + representation of the deserialized, embedded message, with + an - { - "@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). - delegatorShares: - 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. - securityContact: - type: string - description: >- - security_contact defines an optional email for - security contact. - details: - type: string - description: details define other optional details. - unbondingHeight: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at - which this validator has begun unbonding. - unbondingTime: - 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: - commissionRates: - 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. - maxRate: - type: string - description: >- - max_rate defines the maximum commission rate - which validator can ever charge, as a fraction. - maxChangeRate: - type: string - description: >- - max_change_rate defines the maximum daily - increase of the validator commission, as a - fraction. - updateTime: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - minSelfDelegation: - type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. - description: >- - Validator defines a validator, together with the total - amount of the + additional field `@type` which contains the type URL. + Example: - Validator's bond shares and their exchange rate to coins. - Slashing results in + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - a decrease in the exchange rate, allowing correct - calculation of future + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - undelegations without iterating over delegators. When coins - are delegated to + If the embedded message type is well-known and has a custom + JSON - this validator, the validator is credited with a delegation - whose number of + representation, that representation will be embedded adding + a field - bond shares is based on the amount of coins delegated - divided by the current + `value` which holds the custom JSON in addition to the + `@type` - exchange rate. Voting power can be calculated as total - bonded shares + field. Example (for message [google.protobuf.Duration][]): - multiplied by exchange rate. - description: validators contains all the queried validators. - pagination: - description: pagination defines the pagination in the response. + { + "@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 oter 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: - nextKey: + mint_denom: type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + 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: >- - 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 + 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/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: @@ -10193,553 +10959,53 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the 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. + - name: subspace + description: subspace defines the module to query the parameter for. 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. + - name: key + description: key defines the key of the parameter in the subspace. in: query required: false type: string - format: uint64 - - name: pagination.countTotal - 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. - in: query - required: false - type: boolean tags: - Query - '/cosmos/staking/v1beta1/validators/{validatorAddr}': + /cosmos/slashing/v1beta1/params: get: - summary: Validator queries validator info for given validator address. - operationId: CosmosStakingV1Beta1Validator + summary: Params queries the parameters of slashing module + operationId: CosmosSlashingV1Beta1Params responses: '200': description: A successful response. schema: type: object properties: - validator: + params: type: object properties: - operatorAddress: + signed_blocks_window: type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensusPubkey: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type - of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the 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). - delegatorShares: + format: int64 + min_signed_per_window: 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. - securityContact: - type: string - description: >- - security_contact defines an optional email for - security contact. - details: - type: string - description: details define other optional details. - unbondingHeight: + format: byte + downtime_jail_duration: type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at - which this validator has begun unbonding. - unbondingTime: + slash_fraction_double_sign: 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: - commissionRates: - 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. - maxRate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - maxChangeRate: - type: string - description: >- - max_change_rate defines the maximum daily increase - of the validator commission, as a fraction. - updateTime: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - minSelfDelegation: + format: byte + slash_fraction_downtime: type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. + format: byte 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. + Params represents the parameters used for by the slashing + module. title: >- - QueryValidatorResponse is response type for the Query/Validator - RPC method + QueryParamsResponse is the response type for the Query/Params RPC + method default: description: An unexpected error response. schema: @@ -10757,247 +11023,76 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the 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: validatorAddr - description: validator_addr defines the validator address to query for. - in: path - required: true - type: string tags: - Query - '/cosmos/staking/v1beta1/validators/{validatorAddr}/delegations': + /cosmos/slashing/v1beta1/signing_infos: get: - summary: ValidatorDelegations queries delegate info for given validator. - operationId: CosmosStakingV1Beta1ValidatorDelegations + summary: SigningInfos queries signing info of all validators + operationId: CosmosSlashingV1Beta1SigningInfos responses: '200': description: A successful response. schema: type: object properties: - delegationResponses: + info: type: array items: type: object properties: - delegation: - type: object - properties: - delegatorAddress: - type: string - description: >- - delegator_address is the bech32-encoded address of - the delegator. - validatorAddress: - type: string - description: >- - validator_address is the bech32-encoded address of - the validator. - shares: - type: string - description: shares define the delegation shares received. + 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: >- - Delegation represents the bond with tokens held by an - account. It is + Index which is incremented each time the validator was a + bonded - owned by one delegator, and is associated with the - voting power of one + in a block and may have signed a precommit or not. This + in conjunction with the - validator. - balance: - type: object - properties: - denom: - type: string - amount: - type: string + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time description: >- - Coin defines a token with a denomination and an amount. - + 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 - NOTE: The amount field is an Int which implements the - custom method + 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. - signatures required by gogoproto. + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. description: >- - DelegationResponse is equivalent to Delegation except that - it contains a + ValidatorSigningInfo defines a validator's signing info for + monitoring their - balance in addition to shares which is more suitable for - client responses. + liveness activity. + title: info is the signing info of all validators pagination: - description: pagination defines the pagination in the response. type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -11011,18 +11106,30 @@ paths: 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: + 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 @@ -11031,180 +11138,8 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the 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: validatorAddr - 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 @@ -11236,7 +11171,7 @@ paths: required: false type: string format: uint64 - - name: pagination.countTotal + - name: pagination.count_total description: >- count_total is set to true to indicate that the result set should include @@ -11255,72 +11190,194 @@ paths: 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/{validatorAddr}/delegations/{delegatorAddr}': + '/cosmos/slashing/v1beta1/signing_infos/{cons_address}': get: - summary: Delegation queries delegate info for given validator delegator pair. - operationId: CosmosStakingV1Beta1Delegation + summary: SigningInfo queries the signing info of given cons address + operationId: CosmosSlashingV1Beta1SigningInfo responses: '200': description: A successful response. schema: type: object properties: - delegationResponse: + val_signing_info: type: object properties: - delegation: - type: object - properties: - delegatorAddress: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validatorAddress: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - shares: - type: string - description: shares define the delegation shares received. + 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: >- - Delegation represents the bond with tokens held by an - account. It is + Index which is incremented each time the validator was a + bonded - owned by one delegator, and is associated with the voting - power of one + in a block and may have signed a precommit or not. This in + conjunction with the - validator. - balance: - type: object - properties: - denom: - type: string - amount: - type: string + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the - custom method + 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 - signatures required by gogoproto. + 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: >- - DelegationResponse is equivalent to Delegation except that it - contains a + ValidatorSigningInfo defines a validator's signing info for + monitoring their - balance in addition to shares which is more suitable for - client responses. - description: >- - QueryDelegationResponse is response type for the Query/Delegation - RPC method. + liveness activity. + title: >- + val_signing_info is the signing info of requested val cons + address + 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. + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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: @@ -11507,93 +11564,229 @@ paths: "value": "1.212s" } parameters: - - name: validatorAddr - description: validator_addr defines the validator address to query for. - in: path - required: true - type: string - - name: delegatorAddr + - 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/validators/{validatorAddr}/delegations/{delegatorAddr}/unbonding_delegation': + '/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations': get: - summary: |- - UnbondingDelegation queries unbonding info for given validator delegator - pair. - operationId: CosmosStakingV1Beta1UnbondingDelegation + summary: Redelegations queries redelegations of given address. + operationId: CosmosStakingV1Beta1Redelegations responses: '200': description: A successful response. schema: type: object properties: - unbond: - type: object - properties: - delegatorAddress: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validatorAddress: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - entries: - type: array - items: + redelegation_responses: + type: array + items: + type: object + properties: + redelegation: type: object properties: - creationHeight: + delegator_address: type: string - format: int64 description: >- - creation_height is the height which the unbonding - took place. - completionTime: + delegator_address is the bech32-encoded address of + the delegator. + validator_src_address: type: string - format: date-time description: >- - completion_time is the unix time for unbonding - completion. - initialBalance: + validator_src_address is the validator redelegation + source operator address. + validator_dst_address: 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. - 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: + 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. + description: >- + RedelegationEntry defines a redelegation object + with relevant metadata. + description: |- + entries are the redelegation entries. + + 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. + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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 @@ -11769,41 +11962,104 @@ paths: "value": "1.212s" } parameters: - - name: validatorAddr - description: validator_addr defines the validator address to query for. - in: path - required: true - type: string - - name: delegatorAddr + - 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/validators/{validatorAddr}/unbonding_delegations': + '/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations': get: summary: >- - ValidatorUnbondingDelegations queries unbonding delegations of a - validator. - operationId: CosmosStakingV1Beta1ValidatorUnbondingDelegations + DelegatorUnbondingDelegations queries all unbonding delegations of a + given + + delegator address. + operationId: CosmosStakingV1Beta1DelegatorUnbondingDelegations responses: '200': description: A successful response. schema: type: object properties: - unbondingResponses: + unbonding_responses: type: array items: type: object properties: - delegatorAddress: + delegator_address: type: string description: >- delegator_address is the bech32-encoded address of the delegator. - validatorAddress: + validator_address: type: string description: >- validator_address is the bech32-encoded address of the @@ -11813,19 +12069,19 @@ paths: items: type: object properties: - creationHeight: + creation_height: type: string format: int64 description: >- creation_height is the height which the unbonding took place. - completionTime: + completion_time: type: string format: date-time description: >- completion_time is the unix time for unbonding completion. - initialBalance: + initial_balance: type: string description: >- initial_balance defines the tokens initially @@ -11838,7 +12094,10 @@ paths: description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. - description: entries are the unbonding delegation entries. + description: |- + entries are the unbonding delegation entries. + + unbonding delegation entries description: >- UnbondingDelegation stores all of a single delegator's unbonding bonds @@ -11848,7 +12107,7 @@ paths: description: pagination defines the pagination in the response. type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -11863,10 +12122,10 @@ paths: was set, its value is undefined otherwise description: >- - QueryValidatorUnbondingDelegationsResponse is response type for + QueryUnbondingDelegatorDelegationsResponse is response type for the - Query/ValidatorUnbondingDelegations RPC method. + Query/UnbondingDelegatorDelegations RPC method. default: description: An unexpected error response. schema: @@ -12053,8 +12312,8 @@ paths: "value": "1.212s" } parameters: - - name: validatorAddr - description: validator_addr defines the validator address to query for. + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. in: path required: true type: string @@ -12089,7 +12348,7 @@ paths: required: false type: string format: uint64 - - name: pagination.countTotal + - name: pagination.count_total description: >- count_total is set to true to indicate that the result set should include @@ -12108,332 +12367,358 @@ paths: 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/apps/transfer/v1/denom_traces: + '/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators': get: - summary: DenomTraces queries all denomination traces. - operationId: IbcApplicationsTransferV1DenomTraces + summary: |- + DelegatorValidators queries all validators info for given delegator + address. + operationId: CosmosStakingV1Beta1DelegatorValidators responses: '200': description: A successful response. schema: type: object properties: - denomTraces: + validators: type: array items: type: object properties: - path: + operator_address: type: string description: >- - path defines the chain of port/channel identifiers used - for tracing the + 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 - source of the fungible token. - baseDenom: - type: string - description: base denomination of the relayed fungible token. - description: >- - DenomTrace contains the base denomination for ICS20 fungible - tokens and the + protocol buffer message. This string must contain at + least - source tracing information path. - description: denom_traces returns all denominations trace information. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + one "/" character. The last segment of the URL's + path must represent - was set, its value is undefined otherwise - description: >- - QueryConnectionsResponse is the response type for the - Query/DenomTraces RPC + the fully qualified name of the type (as in - method. - default: - description: An unexpected 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). + `path/google.protobuf.Duration`). The name should be + in a canonical form + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary - all types that they - expect it to use in the context of Any. However, for - URLs which use the + In practice, teams usually precompile into the + binary all types that they - scheme `http`, `https`, or no scheme, one can optionally - set up a type + expect it to use in the context of Any. However, for + URLs which use the - server that maps type URLs to message definitions as - follows: + scheme `http`, `https`, or no scheme, one can + optionally set up a type + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * If no scheme is provided, `https` is assumed. - Note: this functionality is not currently available in - the official + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - protobuf release, and it is not used for type URLs - beginning with + Note: this functionality is not currently available + in the official - type.googleapis.com. + protobuf release, and it is not used for type URLs + beginning with + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) - might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + Schemes other than `http`, `https` (or the empty + scheme) might be - URL that describes the type of the serialized message. + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values - in the form - of utility functions or additional generated methods of the - Any type. + Protobuf library provides support to pack/unpack Any + values in the form + of utility functions or additional generated methods of + the Any type. - Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Example 1: Pack and unpack a message in C++. - Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Example 2: Pack and unpack a message in Java. - Example 3: Pack and unpack a message in Python. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + Example 3: Pack and unpack a message in Python. - Example 4: Pack and unpack a message in Go + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + Example 4: Pack and unpack a message in Go - The pack methods provided by protobuf library will by - default use + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + The pack methods provided by protobuf library will by + default use - methods only use the fully qualified type name after the - last '/' + 'type.googleapis.com/full.type.name' as the type URL and + the unpack - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + methods only use the fully qualified type name after the + last '/' - name "y.z". + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + name "y.z". - JSON - ==== + JSON - The JSON representation of an `Any` value uses the regular + ==== - representation of the deserialized, embedded message, with - an + The JSON representation of an `Any` value uses the + regular - additional field `@type` which contains the type URL. - Example: + representation of the deserialized, embedded message, + with an - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + additional field `@type` which contains the type URL. + Example: - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - If the embedded message type is well-known and has a custom - JSON + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - representation, that representation will be embedded adding - a field + If the embedded message type is well-known and has a + custom JSON - `value` which holds the custom JSON in addition to the - `@type` + representation, that representation will be embedded + adding a field - field. Example (for message [google.protobuf.Duration][]): + `value` which holds the custom JSON in addition to the + `@type` - { - "@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. + field. Example (for message + [google.protobuf.Duration][]): - It is less efficient than using key. Only one of offset or key - should + { + "@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. + description: >- + Validator defines a validator, together with the total + amount of the - 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. + Validator's bond shares and their exchange rate to coins. + Slashing results in - 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.countTotal - description: >- - count_total is set to true to indicate that the result set should - include + a decrease in the exchange rate, allowing correct + calculation of future - a count of the total number of items available for pagination in - UIs. + undelegations without iterating over delegators. When coins + are delegated to - count_total is only respected when offset is used. It is ignored - when key + this validator, the validator is credited with a delegation + whose number of - is set. - in: query - required: false - type: boolean - tags: - - Query - '/ibc/apps/transfer/v1/denom_traces/{hash}': - get: - summary: DenomTrace queries a denomination trace information. - operationId: IbcApplicationsTransferV1DenomTrace - responses: - '200': - description: A successful response. - schema: - type: object - properties: - denomTrace: + 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 the validators' info of a delegator. + pagination: + description: pagination defines the pagination in the response. type: object properties: - path: + next_key: type: string - description: >- - path defines the chain of port/channel identifiers used - for tracing the - - source of the fungible token. - baseDenom: + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: type: string - description: base denomination of the relayed fungible token. - description: >- - DenomTrace contains the base denomination for ICS20 fungible - tokens and the - - source tracing information path. - description: >- - QueryDenomTraceResponse is the response type for the - Query/DenomTrace RPC + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - method. + 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: @@ -12620,962 +12905,31089 @@ paths: "value": "1.212s" } parameters: - - name: hash - description: hash (in hex format) of the denomination trace information. + - 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 - /ibc/apps/transfer/v1/params: + '/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}': get: - summary: Params queries all parameters of the ibc-transfer module. - operationId: IbcApplicationsTransferV1Params + summary: |- + DelegatorValidator queries validator info for given delegator validator + pair. + operationId: CosmosStakingV1Beta1DelegatorValidator responses: '200': description: A successful response. schema: type: object properties: - params: - description: params defines the parameters of the module. + validator: type: object properties: - sendEnabled: - type: boolean + operator_address: + type: string description: >- - send_enabled enables or disables all cross-chain token - transfers from this - - chain. - receiveEnabled: - type: boolean - description: >- - receive_enabled enables or disables all cross-chain token - transfers to this - - 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 - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + 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 + protocol buffer message. This string must contain at + least - one "/" character. The last segment of the URL's path - must represent + one "/" character. The last segment of the URL's path + must represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in - a canonical form + `path/google.protobuf.Duration`). The name should be + in a canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary - all types that they + In practice, teams usually precompile into the binary + all types that they - expect it to use in the context of Any. However, for - URLs which use the + expect it to use in the context of Any. However, for + URLs which use the - scheme `http`, `https`, or no scheme, one can optionally - set up a type + scheme `http`, `https`, or no scheme, one can + optionally set up a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in - the official + Note: this functionality is not currently available in + the official - protobuf release, and it is not used for type URLs - beginning with + protobuf release, and it is not used for type URLs + beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) - might be + Schemes other than `http`, `https` (or the empty + scheme) might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values - in the form + Protobuf library provides support to pack/unpack Any + values in the form - of utility functions or additional generated methods of the - Any type. + of utility functions or additional generated methods of + the Any type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { + Foo foo = ...; + Any any; + any.PackFrom(foo); ... - } + if (any.UnpackTo(&foo)) { + ... + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) + foo = Foo(...) + any = Any() + any.Pack(foo) ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } ... - } + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - The pack methods provided by protobuf library will by - default use + The pack methods provided by protobuf library will by + default use - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + 'type.googleapis.com/full.type.name' as the type URL and + the unpack - methods only use the fully qualified type name after the - last '/' + methods only use the fully qualified type name after the + last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + in the type URL, for example "foo.bar.com/x/y.z" will + yield type - name "y.z". + name "y.z". - JSON + JSON - ==== + ==== - The JSON representation of an `Any` value uses the regular + The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with - an + representation of the deserialized, embedded message, with + an - additional field `@type` which contains the type URL. - Example: + additional field `@type` which contains the type URL. + Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If the embedded message type is well-known and has a custom - JSON + If the embedded message type is well-known and has a + custom JSON - representation, that representation will be embedded adding - a field + representation, that representation will be embedded + adding a field - `value` which holds the custom JSON in addition to the - `@type` + `value` which holds the custom JSON in addition to the + `@type` - field. Example (for message [google.protobuf.Duration][]): + field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" + { + "@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. + 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)) { + ... } - tags: - - Query -definitions: - bze.scavenge.Commit: + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the 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 + 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 Tendermint 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. + 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. + 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. + 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. + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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. + 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. + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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. + description: >- + UnbondingDelegationEntry defines an unbonding object + with relevant metadata. + description: |- + entries are the unbonding delegation entries. + + 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. + 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. + description: >- + UnbondingDelegationEntry defines an unbonding object + with relevant metadata. + description: |- + entries are the unbonding delegation entries. + + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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/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. + 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 + format: byte + value: + type: string + format: byte + 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. + 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 + tags: + - Service + post: + summary: BroadcastTx broadcast transaction. + operationId: CosmosTxV1Beta1BroadcastTx + responses: + '200': + description: A successful response. + schema: + type: object + properties: + tx_response: + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + 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 + format: byte + value: + type: string + format: byte + 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 handler. 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: |- + 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: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for + the tx to be committed in a block. + - 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/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. + Only used if Time is not set. + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the 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: >- + 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 + '/ibc/apps/transfer/v1/channels/{channel_id}/ports/{port_id}/escrow_address': + get: + summary: >- + EscrowAddress returns the escrow address for a particular port and + channel id. + operationId: IbcApplicationsTransferV1EscrowAddress + responses: + '200': + description: A successful response. + schema: + type: object + properties: + escrow_address: + type: string + title: the escrow account address + description: >- + QueryEscrowAddressResponse is the response type of the + EscrowAddress RPC method. + default: + description: An unexpected 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: unique channel identifier + in: path + required: true + type: string + - name: port_id + description: unique port identifier + in: path + required: true + type: string + tags: + - Query + '/ibc/apps/transfer/v1/denom_hashes/{trace}': + get: + summary: DenomHash queries a denomination hash information. + operationId: IbcApplicationsTransferV1DenomHash + responses: + '200': + description: A successful response. + schema: + type: object + properties: + hash: + type: string + description: hash (in hex format) of the denomination trace information. + description: >- + QueryDenomHashResponse is the response type for the + Query/DenomHash RPC + + method. + default: + description: An unexpected 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: trace + description: 'The denomination trace ([port_id]/[channel_id])+/[denom]' + in: path + required: true + type: string + tags: + - Query + /ibc/apps/transfer/v1/denom_traces: + get: + summary: DenomTraces queries all denomination traces. + operationId: IbcApplicationsTransferV1DenomTraces + responses: + '200': + description: A successful response. + schema: + type: object + properties: + denom_traces: + type: array + items: + type: object + properties: + path: + type: string + description: >- + path defines the chain of port/channel identifiers used + for tracing the + + source of the fungible token. + base_denom: + type: string + description: base denomination of the relayed fungible token. + description: >- + DenomTrace contains the base denomination for ICS20 fungible + tokens and the + + source tracing information path. + description: denom_traces returns all denominations trace information. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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: >- + QueryConnectionsResponse is the response type for the + Query/DenomTraces RPC + + method. + default: + description: An unexpected 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 + tags: + - Query + '/ibc/apps/transfer/v1/denom_traces/{hash}': + get: + summary: DenomTrace queries a denomination trace information. + operationId: IbcApplicationsTransferV1DenomTrace + responses: + '200': + description: A successful response. + schema: + type: object + properties: + denom_trace: + type: object + properties: + path: + type: string + description: >- + path defines the chain of port/channel identifiers used + for tracing the + + source of the fungible token. + base_denom: + type: string + description: base denomination of the relayed fungible token. + description: >- + DenomTrace contains the base denomination for ICS20 fungible + tokens and the + + source tracing information path. + description: >- + QueryDenomTraceResponse is the response type for the + Query/DenomTrace RPC + + method. + default: + description: An unexpected 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 (in hex format) or denom (full denom with ibc prefix) of the + denomination trace information. + in: path + required: true + type: string + tags: + - Query + /ibc/apps/transfer/v1/params: + get: + summary: Params queries all parameters of the ibc-transfer module. + operationId: IbcApplicationsTransferV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + send_enabled: + type: boolean + description: >- + send_enabled enables or disables all cross-chain token + transfers from this + + chain. + receive_enabled: + type: boolean + description: >- + receive_enabled enables or disables all cross-chain token + transfers to this + + 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 + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the 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/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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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 + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the 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: client state + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the 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: consensus state associated with the channel + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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: 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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 + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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 + tags: + - Query + /ibc/client/v1/params: + get: + summary: ClientParams queries all parameters of the ibc client. + 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. + 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/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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the 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: client state + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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 + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the 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: client state associated with the request identifier + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the 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: consensus state + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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 + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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 + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the 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: >- + consensus state associated with the client identifier at the + given height + proof: + type: string + format: byte + title: merkle proof of existence + proof_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 + 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/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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the 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: client state associated with the request identifier + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the 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: Consensus state associated with the request identifier + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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 + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the 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: client state + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the 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: consensus state associated with the channel + 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 +definitions: + bze.scavenge.Commit: + type: object + properties: + index: + type: string + solutionHash: + type: string + solutionScavengerHash: + type: string + bze.scavenge.MsgCommitSolutionResponse: + type: object + bze.scavenge.MsgRevealSolutionResponse: + type: object + bze.scavenge.MsgSubmitScavengeResponse: + type: object + bze.scavenge.QueryAllCommitResponse: + type: object + properties: + commit: + type: array + items: + type: object + properties: + index: + type: string + solutionHash: + type: string + solutionScavengerHash: + type: string + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + bze.scavenge.QueryAllScavengeResponse: + type: object + properties: + scavenge: + type: array + items: + type: object + properties: + index: + type: string + solutionHash: + type: string + solution: + type: string + description: + type: string + reward: + type: string + scavenger: + type: string + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + bze.scavenge.QueryGetCommitResponse: + type: object + properties: + commit: + type: object + properties: + index: + type: string + solutionHash: + type: string + solutionScavengerHash: + type: string + bze.scavenge.QueryGetScavengeResponse: + type: object + properties: + scavenge: + type: object + properties: + index: + type: string + solutionHash: + type: string + solution: + type: string + description: + type: string + reward: + type: string + scavenger: + type: string + bze.scavenge.Scavenge: + type: object + properties: + index: + type: string + solutionHash: + type: string + solution: + type: string + description: + type: string + reward: + type: string + scavenger: + type: string + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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.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.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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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.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.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 = 1^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 = 1^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 + 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.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). + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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: + 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: >- + QueryBalanceResponse is the response type for the Query/Balance RPC + method. + cosmos.bank.v1beta1.QueryDenomMetadataResponse: + type: object + properties: + 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 = 1^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 + description: |- + Metadata represents a struct that describes + a basic token. + description: >- + QueryDenomMetadataResponse is the response type for the + Query/DenomMetadata RPC + + method. + 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 = 1^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 + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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). + 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.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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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. + cosmos.bank.v1beta1.QuerySupplyOfResponse: + type: object + properties: + amount: + 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: >- + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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.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: + 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 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 Tendermint + 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 Tendermint 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 Tendermint 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 Tendermint 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: >- + 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: + 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 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 Tendermint + 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 Tendermint 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 Tendermint 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 Tendermint 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: >- + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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 request 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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.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.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 Tendermint 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 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 Tendermint + 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 Tendermint 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 Tendermint 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 + Tendermint 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 Tendermint 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 + Tendermint 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 + Tendermint 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 Tendermint + 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 Tendermint 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 Tendermint 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 Tendermint 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 + Tendermint 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 Tendermint 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 Tendermint 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 Tendermint + 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 Tendermint + 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 Tendermint 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 + Tendermint 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 + Tendermint 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 Tendermint + 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 Tendermint 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 Tendermint + 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 Tendermint + 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 Tendermint + 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.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.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.MsgWithdrawDelegatorRewardResponse: + type: object + description: >- + MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + response type. + cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse: + type: object + description: >- + MsgWithdrawValidatorCommissionResponse defines the + Msg/WithdrawValidatorCommission response type. + cosmos.distribution.v1beta1.Params: + type: object + properties: + community_tax: + type: string + base_proposer_reward: + type: string + bonus_proposer_reward: + type: string + 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 + bonus_proposer_reward: + type: string + 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 commision 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.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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the 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: >- + 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 and filtered 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 and filtered 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 and filtered 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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. + 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 and filtered 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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.v1beta1.Deposit: + type: object + properties: + proposal_id: + type: string + format: uint64 + depositor: + type: string + 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: |- + 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: 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 + 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: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + 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 + description: |- + ProposalStatus enumerates the valid statuses of a proposal. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal 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. + final_tally_result: + type: object + properties: + 'yes': + type: string + abstain: + type: string + 'no': + type: string + no_with_veto: + type: string + description: TallyResult defines a standard tally for a governance proposal. + submit_time: + type: string + format: date-time + deposit_end_time: + type: string + format: date-time + 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. + voting_start_time: + type: string + format: date-time + voting_end_time: + type: string + format: date-time + 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 propopsal 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: + type: object + properties: + proposal_id: + type: string + format: uint64 + depositor: + type: string + 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: |- + Deposit defines an amount deposited by an account address to an active + proposal. + 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 + depositor: + type: string + 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: >- + Deposit defines an amount deposited by an account address to an + active + + proposal. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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: Length 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 + 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: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + 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 + description: |- + ProposalStatus enumerates the valid statuses of a proposal. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal 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. + final_tally_result: + type: object + properties: + 'yes': + type: string + abstain: + type: string + 'no': + type: string + no_with_veto: + type: string + description: TallyResult defines a standard tally for a governance proposal. + submit_time: + type: string + format: date-time + deposit_end_time: + type: string + format: date-time + 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. + voting_start_time: + type: string + format: date-time + voting_end_time: + type: string + format: date-time + 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 + 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: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + 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 + description: |- + ProposalStatus enumerates the valid statuses of a proposal. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal 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. + final_tally_result: + type: object + properties: + 'yes': + type: string + abstain: + type: string + 'no': + type: string + no_with_veto: + type: string + description: TallyResult defines a standard tally for a governance proposal. + submit_time: + type: string + format: date-time + deposit_end_time: + type: string + format: date-time + 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. + voting_start_time: + type: string + format: date-time + voting_end_time: + type: string + format: date-time + description: Proposal defines the core field members of a governance proposal. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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: + type: object + properties: + 'yes': + type: string + abstain: + type: string + 'no': + type: string + no_with_veto: + type: string + description: TallyResult defines a standard tally for a governance proposal. + description: >- + QueryTallyResultResponse is the response type for the Query/Tally RPC + method. + cosmos.gov.v1beta1.QueryVoteResponse: + type: object + properties: + vote: + type: object + properties: + proposal_id: + type: string + format: uint64 + voter: + type: string + 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: + 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. + weight: + type: string + description: |- + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 + title: '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: 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 + voter: + type: string + 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: + 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. + weight: + type: string + description: |- + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 + title: '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 defined the queried votes. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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 + abstain: + type: string + 'no': + type: string + no_with_veto: + type: string + description: TallyResult defines a standard tally for a governance proposal. + cosmos.gov.v1beta1.Vote: + type: object + properties: + proposal_id: + type: string + format: uint64 + voter: + type: string + 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: + 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. + weight: + type: string + description: |- + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 + title: '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: Length of the voting period. + description: VotingParams defines the params for voting on governance proposals. + cosmos.gov.v1beta1.WeightedVoteOption: + type: object + properties: + option: + 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. + weight: + type: string + description: |- + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 + 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 holds parameters for the 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.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.slashing.v1beta1.MsgUnjailResponse: + type: object + title: MsgUnjailResponse defines the Msg/Unjail response type + 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: + 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: val_signing_info is the signing info of requested val cons address + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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 + 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 Tendermint 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. + 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.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.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. + description: Params defines the parameters for the 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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. + description: >- + UnbondingDelegationEntry defines an unbonding object with + relevant metadata. + description: |- + entries are the unbonding delegation entries. + + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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. + 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. + 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 the validators' info of a delegator. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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 + 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 Tendermint 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. + 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. + 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. + description: >- + RedelegationEntry defines a redelegation object with + relevant metadata. + description: |- + entries are the redelegation entries. + + 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. + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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. + description: >- + UnbondingDelegationEntry defines an unbonding object with + relevant metadata. + description: |- + entries are the unbonding delegation entries. + + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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. + 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. + description: >- + UnbondingDelegationEntry defines an unbonding object with + relevant metadata. + description: |- + entries are the unbonding delegation entries. + + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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. + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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. + description: >- + RedelegationEntry defines a redelegation object with relevant + metadata. + description: |- + entries are the redelegation entries. + + 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. + 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. + 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: - index: + 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. + description: >- + RedelegationEntry defines a redelegation object with relevant + metadata. + description: |- + entries are the redelegation entries. + + 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. + 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. + description: >- + UnbondingDelegationEntry defines an unbonding object with relevant + metadata. + description: |- + entries are the unbonding delegation entries. + + 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. + 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 - solutionHash: + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: type: string - solutionScavengerHash: + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: type: string - bze.scavenge.MsgCommitSolutionResponse: - type: object - bze.scavenge.MsgRevealSolutionResponse: - type: object - bze.scavenge.MsgSubmitScavengeResponse: - type: object - bze.scavenge.QueryAllCommitResponse: + 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. + 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: - commit: + msg_index: + type: integer + format: int64 + log: + type: string + events: type: array items: type: object properties: - index: - type: string - solutionHash: - type: string - solutionScavengerHash: + type: type: string - pagination: - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + 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 - was set, its value is undefined otherwise + 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: |- - 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; - } - bze.scavenge.QueryAllScavengeResponse: + 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: - scavenge: + 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. + log: + type: string + description: Log contains the log information from message or handler execution. + events: type: array items: type: object properties: - index: - type: string - solutionHash: + type: type: string - solution: - type: string - description: - type: string - reward: - type: string - scavenger: - type: string - pagination: - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + attributes: + type: array + items: + type: object + properties: + key: + type: string + format: byte + value: + type: string + format: byte + 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 - 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. + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - bze.scavenge.QueryGetCommitResponse: - type: object - properties: - commit: - type: object - properties: - index: - type: string - solutionHash: - type: string - solutionScavengerHash: - type: string - bze.scavenge.QueryGetScavengeResponse: + Later, transactions may be queried using these events. + description: >- + Events contains a slice of Event objects that were emitted during + message + + or handler execution. + description: Result is the union of ResponseFormat and ResponseCheckTx. + cosmos.base.abci.v1beta1.StringEvent: type: object properties: - scavenge: - type: object - properties: - index: - type: string - solutionHash: - type: string - solution: - type: string - description: - type: string - reward: - type: string - scavenger: - type: string - bze.scavenge.Scavenge: + 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: - index: + height: type: string - solutionHash: + format: int64 + title: The block height + txhash: type: string - solution: + description: The transaction hash. + codespace: type: string - description: + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: type: string - reward: + description: 'Result bytes, if any.' + raw_log: type: string - scavenger: + 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 - cosmos.base.query.v1beta1.PageRequest: - type: object - properties: - key: + description: Additional information. May be non-deterministic. + gas_wanted: 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: + format: int64 + description: Amount of gas requested for transaction. + gas_used: 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: + format: int64 + description: Amount of gas consumed by transaction. + tx: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + timestamp: type: string - format: uint64 description: >- - limit is the total number of results to be returned in the result - page. + Time of the previous block. For heights > 1, it's the weighted median + of - If left empty it will default to a value to be set by each app. - countTotal: - type: boolean - description: >- - count_total is set to true to indicate that the result set should - include + the timestamps of the valid votes in the block.LastCommit. For height + == 1, - a count of the total number of items available for pagination in UIs. + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + format: byte + value: + type: string + format: byte + 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 - count_total is only respected when offset is used. It is ignored when - key + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. - is set. - reverse: - type: boolean + Later, transactions may be queried using these events. description: >- - reverse is set to true if results are to be returned in the descending - order. - 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: + 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 handler. 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: - nextKey: + extra_bits_stored: + type: integer + format: int64 + elems: type: string format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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: + 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_LEGACY_AMINO_JSON + - SIGN_MODE_EIP_191 + default: SIGN_MODE_UNSPECIFIED + description: |- + SignMode represents a signing mode with its own security guarantees. + + - 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 + - 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: - '@type': - type: string + signer_infos: + type: array + items: + $ref: '#/definitions/cosmos.tx.v1beta1.SignerInfo' description: >- - A URL/resource name that uniquely identifies the type of the - serialized + signer_infos defines the signing modes for the required signers. The + number - protocol buffer message. This string must contain at least + and order of elements must match the required signers from TxBody's - one "/" character. The last segment of the URL's path must represent + messages. The first element is the primary signer and the one which + pays - the fully qualified name of the type (as in + the fee. + fee: + description: >- + Fee is the fee and gas limit for the transaction. The first signer is + the - `path/google.protobuf.Duration`). The name should be in a canonical - form + primary signer and the one which pays the fee. The fee can be + calculated - (e.g., leading "." is not accepted). + 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. - In practice, teams usually precompile into the binary all types that - they - expect it to use in the context of Any. However, for URLs which use - the + NOTE: The amount field is an Int which implements the custom + method - scheme `http`, `https`, or no scheme, one can optionally set up a type + 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 - server that maps type URLs to message definitions as follows: + 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). - * If no scheme is provided, `https` is assumed. + 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 - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + to pay fees instead of the fee payer's own balance. If an + appropriate fee grant does not exist or the chain does - Note: this functionality is not currently available in the official + not support fee grants, this will fail + 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. - protobuf release, and it is not used for type URLs beginning with + - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering + - BROADCAST_MODE_BLOCK: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for + the tx to be committed in a block. + - 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: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for + the tx to be committed in a block. + - 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: + 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 - type.googleapis.com. + 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 - Schemes other than `http`, `https` (or the empty scheme) might be + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along with - a + protocol buffer message. This string must contain at least - URL that describes the type of the serialized message. + one "/" character. The last segment of the URL's path must + represent + the fully qualified name of the type (as in - Protobuf library provides support to pack/unpack Any values in the form + `path/google.protobuf.Duration`). The name should be in a + canonical form - of utility functions or additional generated methods of the Any type. + (e.g., leading "." is not accepted). - Example 1: Pack and unpack a message in C++. + In practice, teams usually precompile into the binary all + types that they - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + expect it to use in the context of Any. However, for URLs + which use the - Example 2: Pack and unpack a message in Java. + scheme `http`, `https`, or no scheme, one can optionally set + up a type - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be - Example 3: Pack and unpack a message in Python. + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + URL that describes the type of the serialized message. - Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + Protobuf library provides support to pack/unpack Any values in the + form - The pack methods provided by protobuf library will by default use + of utility functions or additional generated methods of the Any + type. - 'type.googleapis.com/full.type.name' as the type URL and the unpack - methods only use the fully qualified type name after the last '/' + Example 1: Pack and unpack a message in C++. - in the type URL, for example "foo.bar.com/x/y.z" will yield type + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - name "y.z". + Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. - JSON + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - ==== + Example 4: Pack and unpack a message in Go - The JSON representation of an `Any` value uses the regular + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - representation of the deserialized, embedded message, with an + The pack methods provided by protobuf library will by default use - additional field `@type` which contains the type URL. Example: + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + methods only use the fully qualified type name after the last '/' - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + in the type URL, for example "foo.bar.com/x/y.z" will yield type - If the embedded message type is well-known and has a custom JSON + name "y.z". - representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + JSON - { - "@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 + The JSON representation of an `Any` value uses the regular - one "/" character. The last segment of the URL's path must - represent + representation of the deserialized, embedded message, with an - the fully qualified name of the type (as in + additional field `@type` which contains the type URL. Example: - `path/google.protobuf.Duration`). The name should be in a - canonical form + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - (e.g., leading "." is not accepted). + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + If the embedded message type is well-known and has a custom JSON - In practice, teams usually precompile into the binary all types - that they + representation, that representation will be embedded adding a + field - expect it to use in the context of Any. However, for URLs which - use the + `value` which holds the custom JSON in addition to the `@type` - scheme `http`, `https`, or no scheme, one can optionally set up - a type + field. Example (for message [google.protobuf.Duration][]): - server that maps type URLs to message definitions as follows: + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + 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, - * If no scheme is provided, `https` is assumed. + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + format: byte + value: + type: string + format: byte + 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 - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. - Note: this functionality is not currently available in the - official + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a transaction. + Note, - protobuf release, and it is not used for type URLs beginning - with + these events include those emitted by processing all the messages + and those - type.googleapis.com. + emitted from the ante handler. Whereas Logs contains the events, + with + additional metadata, emitted only by processing the messages. - Schemes other than `http`, `https` (or the empty scheme) might - be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: >- + TxResponse defines a structure containing relevant tx data and + metadata. The - URL that describes the type of the serialized message. + tags are stringified and the log is JSON decoded. + 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 - Protobuf library provides support to pack/unpack Any values in the - form + 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. - of utility functions or additional generated methods of the Any - type. + 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 - Example 1: Pack and unpack a message in C++. + to pay fees instead of the fee payer's own balance. If an appropriate + fee grant does not exist or the chain does - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + not support fee grants, this will fail + description: >- + Fee includes the amount of coins paid in fees and the maximum - Example 2: Pack and unpack a message in Java. + gas to be used by the transaction. The ratio yields an effective + "gasprice", - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + which must be above some miminum to be accepted into the mempool. + cosmos.tx.v1beta1.GetBlockWithTxsResponse: + type: object + properties: + txs: + type: array + items: + $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, - Example 3: Pack and unpack a message in Python. + including all blockchain data structures and the rules of the + application's - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + 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 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. - Example 4: Pack and unpack a message in Go + NOTE: not all txs here are valid. We're just agreeing on the + order first. - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + 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. - The pack methods provided by protobuf library will by default use + - 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 - 'type.googleapis.com/full.type.name' as the type URL and the unpack + 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. - methods only use the fully qualified type name after the last '/' + - 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 - in the type URL, for example "foo.bar.com/x/y.z" will yield type + 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 Tendermint + 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 Tendermint 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 Tendermint 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 Tendermint 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - name "y.z". + 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: + 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 - JSON + 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 - The JSON representation of an `Any` value uses the regular + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - representation of the deserialized, embedded message, with an + protocol buffer message. This string must contain at least - additional field `@type` which contains the type URL. Example: + one "/" character. The last segment of the URL's path must + represent - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + the fully qualified name of the type (as in - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + `path/google.protobuf.Duration`). The name should be in a + canonical form - If the embedded message type is well-known and has a custom JSON + (e.g., leading "." is not accepted). - representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` + In practice, teams usually precompile into the binary all + types that they - field. Example (for message [google.protobuf.Duration][]): + expect it to use in the context of Any. However, for URLs + which use the - { - "@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 + scheme `http`, `https`, or no scheme, one can optionally set + up a type - protocol buffer message. This string must contain at least + server that maps type URLs to message definitions as follows: - one "/" character. The last segment of the URL's path must - represent - the fully qualified name of the type (as in + * If no scheme is provided, `https` is assumed. - `path/google.protobuf.Duration`). The name should be in a - canonical form + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - (e.g., leading "." is not accepted). + Note: this functionality is not currently available in the + official + protobuf release, and it is not used for type URLs beginning + with - In practice, teams usually precompile into the binary all types - that they + type.googleapis.com. - expect it to use in the context of Any. However, for URLs which - use the - scheme `http`, `https`, or no scheme, one can optionally set up a - type + Schemes other than `http`, `https` (or the empty scheme) might + be - server that maps type URLs to message definitions as follows: + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + URL that describes the type of the serialized message. - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + Protobuf library provides support to pack/unpack Any values in the + form - Note: this functionality is not currently available in the - official + of utility functions or additional generated methods of the Any + type. - protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + Example 1: Pack and unpack a message in C++. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Schemes other than `http`, `https` (or the empty scheme) might be + Example 2: Pack and unpack a message in Java. - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - URL that describes the type of the serialized message. + Example 3: Pack and unpack a message in Python. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Protobuf library provides support to pack/unpack Any values in the - form + Example 4: Pack and unpack a message in Go - of utility functions or additional generated methods of the Any type. + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + The pack methods provided by protobuf library will by default use - Example 1: Pack and unpack a message in C++. + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + methods only use the fully qualified type name after the last '/' - Example 2: Pack and unpack a message in Java. + in the type URL, for example "foo.bar.com/x/y.z" will yield type - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + name "y.z". - Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + JSON - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + ==== - The pack methods provided by protobuf library will by default use + The JSON representation of an `Any` value uses the regular - 'type.googleapis.com/full.type.name' as the type URL and the unpack + representation of the deserialized, embedded message, with an - methods only use the fully qualified type name after the last '/' + additional field `@type` which contains the type URL. Example: - in the type URL, for example "foo.bar.com/x/y.z" will yield type + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - name "y.z". + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + If the embedded message type is well-known and has a custom JSON + representation, that representation will be embedded adding a + field - JSON + `value` which holds the custom JSON in addition to the `@type` - ==== + field. Example (for message [google.protobuf.Duration][]): - The JSON representation of an `Any` value uses the regular + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the weighted + median of - representation of the deserialized, embedded message, with an + the timestamps of the valid votes in the block.LastCommit. For + height == 1, - additional field `@type` which contains the type URL. Example: + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + format: byte + value: + type: string + format: byte + 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 - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a transaction. + Note, - If the embedded message type is well-known and has a custom JSON + these events include those emitted by processing all the messages + and those - representation, that representation will be embedded adding a field + emitted from the ante handler. Whereas Logs contains the events, + with - `value` which holds the custom JSON in addition to the `@type` + additional metadata, emitted only by processing the messages. - field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - expiration: - type: string - format: date-time - description: |- - Grant gives permissions to execute - the provide method with expiration time. - cosmos.authz.v1beta1.MsgExecResponse: + 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: GetTxResponse is the response type for the Service.GetTx method. + cosmos.tx.v1beta1.GetTxsEventResponse: type: object properties: - results: + txs: 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.QueryGrantsResponse: - type: object - properties: - grants: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: txs is the list of queried transactions. + tx_responses: type: array items: type: object properties: - authorization: + 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: type: object properties: '@type': @@ -13707,514 +44119,108 @@ definitions: - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the 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 - 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: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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.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 = 1^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 - denomUnits: - 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 = 1^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 - 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. - 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.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: - sendEnabled: - 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). - defaultSendEnabled: - 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: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + JSON - 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: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. + The JSON representation of an `Any` value uses the regular - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - description: >- - QueryBalanceResponse is the response type for the Query/Balance RPC - method. - cosmos.bank.v1beta1.QueryDenomMetadataResponse: - type: object - properties: - metadata: - type: object - properties: - description: - type: string - denomUnits: - 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 + representation of the deserialized, embedded message, with an - raise the base_denom to in order to equal the given - DenomUnit's denom + additional field `@type` which contains the type URL. Example: - 1 denom = 1^exponent base_denom + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - (e.g. with a base_denom of uatom, one can create a DenomUnit - of 'atom' with + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - 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 - 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 + If the embedded message type is well-known and has a custom JSON - be the same as the display. - description: |- - Metadata represents a struct that describes - a basic token. - description: >- - QueryDenomMetadataResponse is the response type for the - Query/DenomMetadata RPC + representation, that representation will be embedded adding a + field - method. - cosmos.bank.v1beta1.QueryDenomsMetadataResponse: - type: object - properties: - metadatas: - type: array - items: - type: object - properties: - description: + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + timestamp: type: string - denomUnits: + 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: - denom: + type: 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 = 1^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: + attributes: 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 - 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. - 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: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + type: object + properties: + key: + type: string + format: byte + value: + type: string + format: byte + 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 - was set, its value is undefined otherwise - description: >- - QueryDenomsMetadataResponse is the response type for the - Query/DenomsMetadata RPC + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. - method. - cosmos.bank.v1beta1.QueryParamsResponse: - type: object - properties: - params: - type: object - properties: - sendEnabled: - type: array - items: - type: object - properties: - denom: - type: string - enabled: - type: boolean + Later, transactions may be queried using these events. description: >- - SendEnabled maps coin denom to a send_enabled status (whether a - denom is + 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 handler. Whereas Logs contains the events, + with - sendable). - defaultSendEnabled: - 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.QuerySupplyOfResponse: - type: object - properties: - amount: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. + additional metadata, emitted only by processing the messages. - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - 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 + 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 the pagination in the response. + description: pagination defines a pagination for the response. type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -14228,2433 +44234,2192 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - title: >- - QueryTotalSupplyResponse is the response type for the Query/TotalSupply - RPC + 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_LEGACY_AMINO_JSON + - SIGN_MODE_EIP_191 + default: SIGN_MODE_UNSPECIFIED + description: >- + SignMode represents a signing mode with its own security + guarantees. - method - cosmos.bank.v1beta1.SendEnabled: + - 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 + - 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: - denom: + 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: + $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_LEGACY_AMINO_JSON + - SIGN_MODE_EIP_191 + default: SIGN_MODE_UNSPECIFIED + description: >- + SignMode represents a signing mode with its own security guarantees. + + - 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 + - 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + 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 - enabled: - type: boolean + 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: |- - SendEnabled maps coin denom to a send_enabled status (whether a denom is - sendable). - cosmos.base.v1beta1.Coin: + SignerInfo describes the public key and signing mode of a single top-level + signer. + cosmos.tx.v1beta1.SimulateRequest: type: object properties: - denom: - type: string - amount: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: |- + tx is the transaction to simulate. + Deprecated. Send raw tx bytes instead. + tx_bytes: type: string - description: |- - Coin defines a token with a denomination and an amount. + format: byte + description: |- + tx_bytes is the raw transaction. - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - 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 + Since: cosmos-sdk 0.43 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: + SimulateRequest is the request type for the Service.Simulate + RPC method. + cosmos.tx.v1beta1.SimulateResponse: type: object properties: - validatorAddress: - 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. + 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 - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. + length prefixed in order to separate data from multiple message + executions. + 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 + format: byte + value: + type: string + format: byte + 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. description: |- - DelegationDelegatorReward represents the properties - of a delegator's delegation reward. - 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.MsgWithdrawDelegatorRewardResponse: - type: object - description: >- - MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward - response type. - cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse: - type: object - description: >- - MsgWithdrawValidatorCommissionResponse defines the - Msg/WithdrawValidatorCommission response type. - cosmos.distribution.v1beta1.Params: - type: object - properties: - communityTax: - type: string - baseProposerReward: - type: string - bonusProposerReward: - type: string - withdrawAddrEnabled: - type: boolean - description: Params defines the set of params for the distribution module. - cosmos.distribution.v1beta1.QueryCommunityPoolResponse: + SimulateResponse is the response type for the + Service.SimulateRPC method. + cosmos.tx.v1beta1.Tx: 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. + 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 - 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 + name "y.z". - 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: - validatorAddress: - 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. + JSON - 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. + The JSON representation of an `Any` value uses the regular - 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: - withdrawAddress: - 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: - communityTax: - type: string - baseProposerReward: + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the 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 - bonusProposerReward: + 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 - withdrawAddrEnabled: - 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 commision the validator received. - type: object - properties: - commission: + 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: - denom: - type: string - amount: + '@type': type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + protocol buffer message. This string must contain at least - NOTE: The amount field is an Dec which implements the custom - method + one "/" character. The last segment of the URL's path must + represent - signatures required by gogoproto. - title: |- - QueryValidatorCommissionResponse is the response type for the - Query/ValidatorCommission 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. + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name should be in a + canonical form - NOTE: The amount field is an Dec which implements the custom - method + (e.g., leading "." is not accepted). - 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: - validatorPeriod: - 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: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - 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: this functionality is not currently available in the + official - 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. + protobuf release, and it is not used for type URLs beginning + with - 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: - validatorPeriod: - 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 + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} description: >- - A URL/resource name that uniquely identifies the type of the - serialized + `Any` contains an arbitrary serialized protocol buffer message + along with a - protocol buffer message. This string must contain at least + URL that describes the type of the serialized message. - one "/" character. The last segment of the URL's path must - represent - the fully qualified name of the type (as in + Protobuf library provides support to pack/unpack Any values in + the form - `path/google.protobuf.Duration`). The name should be in a - canonical form + of utility functions or additional generated methods of the Any + type. - (e.g., leading "." is not accepted). + Example 1: Pack and unpack a message in C++. - In practice, teams usually precompile into the binary all types - that they + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - expect it to use in the context of Any. However, for URLs which - use the + Example 2: Pack and unpack a message in Java. - scheme `http`, `https`, or no scheme, one can optionally set up - a type + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - server that maps type URLs to message definitions as follows: + Example 3: Pack and unpack a message in Python. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - * If no scheme is provided, `https` is assumed. + Example 4: Pack and unpack a message in Go - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - Note: this functionality is not currently available in the - official + The pack methods provided by protobuf library will by default + use - protobuf release, and it is not used for type URLs beginning - with + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - type.googleapis.com. + methods only use the fully qualified type name after the last + '/' + in the type URL, for example "foo.bar.com/x/y.z" will yield type - Schemes other than `http`, `https` (or the empty scheme) might - be + name "y.z". - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - URL that describes the type of the serialized message. + JSON - Protobuf library provides support to pack/unpack Any values in the - form + ==== - of utility functions or additional generated methods of the Any - type. + The JSON representation of an `Any` value uses the regular + representation of the deserialized, embedded message, with an - Example 1: Pack and unpack a message in C++. + additional field `@type` which contains the type URL. Example: - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - Example 2: Pack and unpack a message in Java. + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + If the embedded message type is well-known and has a custom JSON - Example 3: Pack and unpack a message in Python. + representation, that representation will be embedded adding a + field - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + `value` which holds the custom JSON in addition to the `@type` - Example 4: Pack and unpack a message in Go + field. Example (for message [google.protobuf.Duration][]): - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + extension_options are arbitrary options that can be added by + chains - The pack methods provided by protobuf library will by default use + when the default options are not sufficient. If any of these are + present - 'type.googleapis.com/full.type.name' as the type URL and the unpack + 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 - methods only use the fully qualified type name after the last '/' + `path/google.protobuf.Duration`). The name should be in a + canonical form - in the type URL, for example "foo.bar.com/x/y.z" will yield type + (e.g., leading "." is not accepted). - name "y.z". + In practice, teams usually precompile into the binary all + types that they + expect it to use in the context of Any. However, for URLs + which use the - JSON + scheme `http`, `https`, or no scheme, one can optionally set + up a type - ==== + server that maps type URLs to message definitions as + follows: - The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an + * If no scheme is provided, `https` is assumed. - additional field `@type` which contains the type URL. Example: + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + Note: this functionality is not currently available in the + official - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + protobuf release, and it is not used for type URLs beginning + with - If the embedded message type is well-known and has a custom JSON + type.googleapis.com. - representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` + Schemes other than `http`, `https` (or the empty scheme) + might be - field. Example (for message [google.protobuf.Duration][]): + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - { - "@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: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + URL that describes the type of the serialized message. - 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: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + Protobuf library provides support to pack/unpack Any values in + the form - protocol buffer message. This string must contain at least + of utility functions or additional generated methods of the Any + type. - one "/" character. The last segment of the URL's path must - represent - the fully qualified name of the type (as in + Example 1: Pack and unpack a message in C++. - `path/google.protobuf.Duration`). The name should be in a - canonical form + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - (e.g., leading "." is not accepted). + Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - In practice, teams usually precompile into the binary all types - that they + Example 3: Pack and unpack a message in Python. - expect it to use in the context of Any. However, for URLs which - use the + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - scheme `http`, `https`, or no scheme, one can optionally set up a - type + Example 4: Pack and unpack a message in Go - server that maps type URLs to message definitions as follows: + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + The pack methods provided by protobuf library will by default + use - * If no scheme is provided, `https` is assumed. + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + methods only use the fully qualified type name after the last + '/' - Note: this functionality is not currently available in the - official + in the type URL, for example "foo.bar.com/x/y.z" will yield type - protobuf release, and it is not used for type URLs beginning with + name "y.z". - type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) might be + JSON - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + ==== - URL that describes the type of the serialized message. + The JSON representation of an `Any` value uses the regular + representation of the deserialized, embedded message, with an - Protobuf library provides support to pack/unpack Any values in the - form + additional field `@type` which contains the type URL. Example: - of utility functions or additional generated methods of the Any type. + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - Example 1: Pack and unpack a message in C++. + If the embedded message type is well-known and has a custom JSON - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + representation, that representation will be embedded adding a + field - Example 2: Pack and unpack a message in Java. + `value` which holds the custom JSON in addition to the `@type` - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + field. Example (for message [google.protobuf.Duration][]): - Example 3: Pack and unpack a message in Python. + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + extension_options are arbitrary options that can be added by + chains - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + when the default options are not sufficient. If any of these are + present - Example 4: Pack and unpack a message in Go + 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 - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + AuthInfo's signer_infos to allow connecting signature meta information + like - The pack methods provided by protobuf library will by default use + 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 - 'type.googleapis.com/full.type.name' as the type URL and the unpack + protocol buffer message. This string must contain at least - methods only use the fully qualified type name after the last '/' + one "/" character. The last segment of the URL's path must + represent - in the type URL, for example "foo.bar.com/x/y.z" will yield type + the fully qualified name of the type (as in - name "y.z". + `path/google.protobuf.Duration`). The name should be in a + canonical form + (e.g., leading "." is not accepted). - JSON + In practice, teams usually precompile into the binary all types + that they - ==== + expect it to use in the context of Any. However, for URLs which + use the - The JSON representation of an `Any` value uses the regular + scheme `http`, `https`, or no scheme, one can optionally set up + a type - representation of the deserialized, embedded message, with an + server that maps type URLs to message definitions as follows: - additional field `@type` which contains the type URL. Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + * If no scheme is provided, `https` is assumed. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - If the embedded message type is well-known and has a custom JSON + Note: this functionality is not currently available in the + official - representation, that representation will be embedded adding a field + protobuf release, and it is not used for type URLs beginning + with - `value` which holds the custom JSON in addition to the `@type` + type.googleapis.com. - field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - 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 and filtered fee allowance. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + Schemes other than `http`, `https` (or the empty scheme) might + be - protocol buffer message. This string must contain at least + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - one "/" character. The last segment of the URL's path must - represent + URL that describes the type of the serialized message. - the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + Protobuf library provides support to pack/unpack Any values in the + form - (e.g., leading "." is not accepted). + of utility functions or additional generated methods of the Any + type. - In practice, teams usually precompile into the binary all types - that they + Example 1: Pack and unpack a message in C++. - expect it to use in the context of Any. However, for URLs which - use the + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - scheme `http`, `https`, or no scheme, one can optionally set up a - type + Example 2: Pack and unpack a message in Java. - server that maps type URLs to message definitions as follows: + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. - * If no scheme is provided, `https` is assumed. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + Example 4: Pack and unpack a message in Go - Note: this functionality is not currently available in the - official + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - protobuf release, and it is not used for type URLs beginning with + The pack methods provided by protobuf library will by default use - type.googleapis.com. + 'type.googleapis.com/full.type.name' as the type URL and the unpack + methods only use the fully qualified type name after the last '/' - Schemes other than `http`, `https` (or the empty scheme) might be + in the type URL, for example "foo.bar.com/x/y.z" will yield type - 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 and filtered fee allowance. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + name "y.z". - protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent - the fully qualified name of the type (as in + JSON - `path/google.protobuf.Duration`). The name should be in a - canonical form + ==== - (e.g., leading "." is not accepted). + The JSON representation of an `Any` value uses the regular + representation of the deserialized, embedded message, with an - In practice, teams usually precompile into the binary all - types that they + additional field `@type` which contains the type URL. Example: - expect it to use in the context of Any. However, for URLs - which use the + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - scheme `http`, `https`, or no scheme, one can optionally set - up a type + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - server that maps type URLs to message definitions as follows: + If the embedded message type is well-known and has a custom JSON + representation, that representation will be embedded adding a field - * If no scheme is provided, `https` is assumed. + `value` which holds the custom JSON in addition to the `@type` - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + field. Example (for message [google.protobuf.Duration][]): - Note: this functionality is not currently available in the - official + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages is a list of messages to be executed. The required signers of - protobuf release, and it is not used for type URLs beginning - with + those messages define the number and order of elements in AuthInfo's - type.googleapis.com. + signer_infos and Tx's signatures. Each required signer address is + added to + the list only the first time it occurs. - Schemes other than `http`, `https` (or the empty scheme) might - be + By convention, the first required signer (usually from the first + message) - 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.QueryAllowancesResponse: - type: object - properties: - allowances: + 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: - granter: - type: string - description: >- - granter is the address of the user granting an allowance of - their funds. - grantee: + '@type': 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 and filtered fee allowance. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + A URL/resource name that uniquely identifies the type of the + serialized - protocol buffer message. This string must contain at least + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary all - types that they + In practice, teams usually precompile into the binary all types + that they - expect it to use in the context of Any. However, for URLs - which use the + expect it to use in the context of Any. However, for URLs which + use the - scheme `http`, `https`, or no scheme, one can optionally set - up a type + scheme `http`, `https`, or no scheme, one can optionally set up + a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in the - official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs beginning - with + protobuf release, and it is not used for type URLs beginning + with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) - might be + 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: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - was set, its value is undefined otherwise - description: >- - QueryAllowancesResponse is the response type for the Query/Allowances RPC - method. - cosmos.gov.v1beta1.Deposit: - type: object - properties: - proposalId: - type: string - format: uint64 - depositor: - type: string - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. + URL that describes the type of the serialized message. - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - description: |- - Deposit defines an amount deposited by an account address to an active - proposal. - cosmos.gov.v1beta1.DepositParams: - type: object - properties: - minDeposit: - 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. - maxDepositPeriod: - 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: - proposalId: - type: string - format: uint64 - 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. - cosmos.gov.v1beta1.Proposal: - type: object - properties: - proposalId: - type: string - format: uint64 - content: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + Protobuf library provides support to pack/unpack Any values in the + form - protocol buffer message. This string must contain at least + of utility functions or additional generated methods of the Any + type. - one "/" character. The last segment of the URL's path must - represent - the fully qualified name of the type (as in + Example 1: Pack and unpack a message in C++. - `path/google.protobuf.Duration`). The name should be in a - canonical form + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - (e.g., leading "." is not accepted). + Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - In practice, teams usually precompile into the binary all types - that they + Example 3: Pack and unpack a message in Python. - expect it to use in the context of Any. However, for URLs which - use the + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - scheme `http`, `https`, or no scheme, one can optionally set up a - type + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON - server that maps type URLs to message definitions as follows: + ==== + The JSON representation of an `Any` value uses the regular - * If no scheme is provided, `https` is assumed. + representation of the deserialized, embedded message, with an - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + additional field `@type` which contains the type URL. Example: - Note: this functionality is not currently available in the - official + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - protobuf release, and it is not used for type URLs beginning with + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - type.googleapis.com. + If the embedded message type is well-known and has a custom JSON + representation, that representation will be embedded adding a field - Schemes other than `http`, `https` (or the empty scheme) might be + `value` which holds the custom JSON in addition to the `@type` - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + field. Example (for message [google.protobuf.Duration][]): - URL that describes the type of the serialized message. + { + "@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 - Protobuf library provides support to pack/unpack Any values in the - form + 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 - of utility functions or additional generated methods of the Any type. + protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must + represent - Example 1: Pack and unpack a message in C++. + the fully qualified name of the type (as in - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + `path/google.protobuf.Duration`). The name should be in a + canonical form - Example 2: Pack and unpack a message in Java. + (e.g., leading "." is not accepted). - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - Example 3: Pack and unpack a message in Python. + In practice, teams usually precompile into the binary all types + that they - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + expect it to use in the context of Any. However, for URLs which + use the - Example 4: Pack and unpack a message in Go + scheme `http`, `https`, or no scheme, one can optionally set up + a type - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + server that maps type URLs to message definitions as follows: - The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the unpack + * If no scheme is provided, `https` is assumed. - methods only use the fully qualified type name after the last '/' + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - in the type URL, for example "foo.bar.com/x/y.z" will yield type + Note: this functionality is not currently available in the + official - name "y.z". + protobuf release, and it is not used for type URLs beginning + with + type.googleapis.com. - JSON + Schemes other than `http`, `https` (or the empty scheme) might + be - ==== + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - The JSON representation of an `Any` value uses the regular + URL that describes the type of the serialized message. - representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + Protobuf library provides support to pack/unpack Any values in the + form - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + of utility functions or additional generated methods of the Any + type. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - If the embedded message type is well-known and has a custom JSON + Example 1: Pack and unpack a message in C++. - representation, that representation will be embedded adding a field + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - `value` which holds the custom JSON in addition to the `@type` + Example 2: Pack and unpack a message in Java. - field. Example (for message [google.protobuf.Duration][]): + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - 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 - description: |- - ProposalStatus enumerates the valid statuses of a proposal. + Example 3: Pack and unpack a message in Python. - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal 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. - finalTallyResult: - type: object - properties: - 'yes': - type: string - abstain: - type: string - 'no': - type: string - noWithVeto: - type: string - description: TallyResult defines a standard tally for a governance proposal. - submitTime: - type: string - format: date-time - depositEndTime: - type: string - format: date-time - totalDeposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - votingStartTime: - type: string - format: date-time - votingEndTime: - type: string - format: date-time - 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. + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal 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: - type: object - properties: - proposalId: - type: string - format: uint64 - depositor: - type: string - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + The pack methods provided by protobuf library will by default use + 'type.googleapis.com/full.type.name' as the type URL and the unpack - NOTE: The amount field is an Int which implements the custom - method + methods only use the fully qualified type name after the last '/' - signatures required by gogoproto. - description: |- - Deposit defines an amount deposited by an account address to an active - proposal. - 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: - proposalId: - type: string - format: uint64 - depositor: - type: string - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + in the type URL, for example "foo.bar.com/x/y.z" will yield type + name "y.z". - NOTE: The amount field is an Int which implements the custom - method - signatures required by gogoproto. - description: >- - Deposit defines an amount deposited by an account address to an - active - proposal. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + JSON - 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: - votingParams: - description: voting_params defines the parameters related to voting. - type: object - properties: - votingPeriod: - type: string - description: Length of the voting period. - depositParams: - description: deposit_params defines the parameters related to deposit. - type: object - properties: - minDeposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + ==== + The JSON representation of an `Any` value uses the regular - NOTE: The amount field is an Int which implements the custom - method + representation of the deserialized, embedded message, with an - signatures required by gogoproto. - description: Minimum deposit for a proposal to enter voting period. - maxDepositPeriod: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. Initial - value: 2 - months. - tallyParams: - 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. - vetoThreshold: - 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: - proposalId: - type: string - format: uint64 - content: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + additional field `@type` which contains the type URL. Example: - protocol buffer message. This string must contain at least + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - one "/" character. The last segment of the URL's path must - represent + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - the fully qualified name of the type (as in + If the embedded message type is well-known and has a custom JSON - `path/google.protobuf.Duration`). The name should be in a - canonical form + representation, that representation will be embedded adding a field - (e.g., leading "." is not accepted). + `value` which holds the custom JSON in addition to the `@type` + field. Example (for message [google.protobuf.Duration][]): - In practice, teams usually precompile into the binary all - types that they + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + extension_options are arbitrary options that can be added by chains - expect it to use in the context of Any. However, for URLs - which use the + when the default options are not sufficient. If any of these are + present - scheme `http`, `https`, or no scheme, one can optionally set - up a type + and can't be handled, they will be ignored + description: TxBody is the body of a transaction that all signers sign over. + tendermint.abci.Event: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + format: byte + value: + type: string + format: byte + 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 - server that maps type URLs to message definitions as follows: + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + tendermint.abci.EventAttribute: + type: object + properties: + key: + type: string + format: byte + value: + type: string + format: byte + 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.Plan: + type: object + properties: + name: + type: string + description: >- + Sets the name for the upgrade. This name will be used by the upgraded - * If no scheme is provided, `https` is assumed. + version of the software to apply any special "on-upgrade" commands + during - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + the first BeginBlock method after the upgrade is applied. It is also + used - Note: this functionality is not currently available in the - official + to detect whether a software version can handle a given upgrade. If no - protobuf release, and it is not used for type URLs beginning - with + 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. - type.googleapis.com. + 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. + Only used if Time is not set. + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + protocol buffer message. This string must contain at least - Schemes other than `http`, `https` (or the empty scheme) might - be + one "/" character. The last segment of the URL's path must + represent - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + the fully qualified name of the type (as in - URL that describes the type of the serialized message. + `path/google.protobuf.Duration`). The name should be in a + canonical form + (e.g., leading "." is not accepted). - Protobuf library provides support to pack/unpack Any values in the - form - of utility functions or additional generated methods of the Any - type. + In practice, teams usually precompile into the binary all types + that they + expect it to use in the context of Any. However, for URLs which + use the - Example 1: Pack and unpack a message in C++. + scheme `http`, `https`, or no scheme, one can optionally set up a + type - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + server that maps type URLs to message definitions as follows: - Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + * If no scheme is provided, `https` is assumed. - Example 3: Pack and unpack a message in Python. + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + Note: this functionality is not currently available in the + official - Example 4: Pack and unpack a message in Go + protobuf release, and it is not used for type URLs beginning with - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + type.googleapis.com. - The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + Schemes other than `http`, `https` (or the empty scheme) might be - methods only use the fully qualified type name after the last '/' + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - in the type URL, for example "foo.bar.com/x/y.z" will yield type + URL that describes the type of the serialized message. - name "y.z". + Protobuf library provides support to pack/unpack Any values in the + form + of utility functions or additional generated methods of the Any type. - JSON - ==== + Example 1: Pack and unpack a message in C++. - The JSON representation of an `Any` value uses the regular + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - representation of the deserialized, embedded message, with an + Example 2: Pack and unpack a message in Java. - additional field `@type` which contains the type URL. Example: + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + Example 3: Pack and unpack a message in Python. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - If the embedded message type is well-known and has a custom JSON + Example 4: Pack and unpack a message in Go - representation, that representation will be embedded adding a - field + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - `value` which holds the custom JSON in addition to the `@type` + The pack methods provided by protobuf library will by default use - field. Example (for message [google.protobuf.Duration][]): + 'type.googleapis.com/full.type.name' as the type URL and the unpack - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - 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 - description: |- - ProposalStatus enumerates the valid statuses of a proposal. + methods only use the fully qualified type name after the last '/' - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal 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. - finalTallyResult: - type: object - properties: - 'yes': - type: string - abstain: - type: string - 'no': - type: string - noWithVeto: - type: string - description: TallyResult defines a standard tally for a governance proposal. - submitTime: - type: string - format: date-time - depositEndTime: - type: string - format: date-time - totalDeposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + in the type URL, for example "foo.bar.com/x/y.z" will yield type + name "y.z". - NOTE: The amount field is an Int which implements the custom - method - signatures required by gogoproto. - votingStartTime: - type: string - format: date-time - votingEndTime: - type: string - format: date-time - 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: - proposalId: - type: string - format: uint64 - 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 + JSON - one "/" character. The last segment of the URL's path must - represent + ==== - the fully qualified name of the type (as in + The JSON representation of an `Any` value uses the regular - `path/google.protobuf.Duration`). The name should be in a - canonical form + representation of the deserialized, embedded message, with an - (e.g., leading "." is not accepted). + additional field `@type` which contains the type URL. Example: + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - In practice, teams usually precompile into the binary all - types that they + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - expect it to use in the context of Any. However, for URLs - which use the + If the embedded message type is well-known and has a custom JSON - scheme `http`, `https`, or no scheme, one can optionally set - up a type + representation, that representation will be embedded adding a field - server that maps type URLs to message definitions as - follows: + `value` which holds the custom JSON in addition to the `@type` + field. Example (for message [google.protobuf.Duration][]): - * If no scheme is provided, `https` is assumed. + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + 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 - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + method. + 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 - Note: this functionality is not currently available in the - official + version of the software to apply any special "on-upgrade" commands + during - protobuf release, and it is not used for type URLs beginning - with + the first BeginBlock method after the upgrade is applied. It is + also used - type.googleapis.com. + 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 - Schemes other than `http`, `https` (or the empty scheme) - might be + assumed that the software is out-of-date when the upgrade Time or + Height is - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + reached and the software will exit. + time: + type: string + format: date-time + description: >- + Deprecated: Time based upgrades have been deprecated. Time based + upgrade logic - URL that describes the type of the serialized message. + 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. + Only used if Time is not set. + info: + type: string + title: >- + Any application specific upgrade info to be included on-chain - Protobuf library provides support to pack/unpack Any values in - the form + such as a git commit that validators could automatically upgrade + to + upgraded_client_state: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - of utility functions or additional generated methods of the Any - type. + protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must + represent - Example 1: Pack and unpack a message in C++. + the fully qualified name of the type (as in - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + `path/google.protobuf.Duration`). The name should be in a + canonical form - Example 2: Pack and unpack a message in Java. + (e.g., leading "." is not accepted). - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - Example 3: Pack and unpack a message in Python. + In practice, teams usually precompile into the binary all + types that they - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + expect it to use in the context of Any. However, for URLs + which use the - Example 4: Pack and unpack a message in Go + scheme `http`, `https`, or no scheme, one can optionally set + up a type - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + server that maps type URLs to message definitions as follows: - The pack methods provided by protobuf library will by default - use - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + * If no scheme is provided, `https` is assumed. - methods only use the fully qualified type name after the last - '/' + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - in the type URL, for example "foo.bar.com/x/y.z" will yield type + Note: this functionality is not currently available in the + official - name "y.z". + protobuf release, and it is not used for type URLs beginning + with + type.googleapis.com. - JSON + Schemes other than `http`, `https` (or the empty scheme) might + be - ==== + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - The JSON representation of an `Any` value uses the regular + URL that describes the type of the serialized message. - representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + Protobuf library provides support to pack/unpack Any values in the + form - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + of utility functions or additional generated methods of the Any + type. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - If the embedded message type is well-known and has a custom JSON + Example 1: Pack and unpack a message in C++. - representation, that representation will be embedded adding a - field + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - `value` which holds the custom JSON in addition to the `@type` + Example 2: Pack and unpack a message in Java. - field. Example (for message [google.protobuf.Duration][]): + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - 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 - description: |- - ProposalStatus enumerates the valid statuses of a proposal. + Example 3: Pack and unpack a message in Python. - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal 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. - finalTallyResult: - type: object - properties: - 'yes': - type: string - abstain: - type: string - 'no': - type: string - noWithVeto: - type: string - description: TallyResult defines a standard tally for a governance proposal. - submitTime: - type: string - format: date-time - depositEndTime: - type: string - format: date-time - totalDeposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + Example 4: Pack and unpack a message in Go - NOTE: The amount field is an Int which implements the custom - method + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - signatures required by gogoproto. - votingStartTime: - type: string - format: date-time - votingEndTime: - type: string - format: date-time - description: Proposal defines the core field members of a governance proposal. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + The pack methods provided by protobuf library will by default use - 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: - type: object - properties: - 'yes': - type: string - abstain: - type: string - 'no': - type: string - noWithVeto: - type: string - description: TallyResult defines a standard tally for a governance proposal. - description: >- - QueryTallyResultResponse is the response type for the Query/Tally RPC - method. - cosmos.gov.v1beta1.QueryVoteResponse: - type: object - properties: - vote: - type: object - properties: - proposalId: - type: string - format: uint64 - voter: - type: string - option: - description: >- - Deprecated: Prefer to use `options` instead. This field is set in - queries + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - if and only if `len(options) == 1` and that option has weight 1. - In all + methods only use the fully qualified type name after the last '/' - 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: - 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. + in the type URL, for example "foo.bar.com/x/y.z" will yield type - - 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. - weight: - type: string - description: WeightedVoteOption defines a unit of vote for vote split. - description: |- - Vote defines a vote on a governance proposal. - A Vote consists of a proposal ID, the voter, and the vote option. - 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: - proposalId: - type: string - format: uint64 - voter: - type: string - option: - description: >- - Deprecated: Prefer to use `options` instead. This field is set - in queries + name "y.z". - 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: - 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. - weight: - type: string - description: WeightedVoteOption defines a unit of vote for vote split. - description: |- - Vote defines a vote on a governance proposal. - A Vote consists of a proposal ID, the voter, and the vote option. - description: votes defined the queried votes. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + JSON - 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. - vetoThreshold: - 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 - abstain: - type: string - 'no': - type: string - noWithVeto: - type: string - description: TallyResult defines a standard tally for a governance proposal. - cosmos.gov.v1beta1.Vote: - type: object - properties: - proposalId: - type: string - format: uint64 - voter: - type: string - option: - description: >- - Deprecated: Prefer to use `options` instead. This field is set in - queries + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field - if and only if `len(options) == 1` and that option has weight 1. In - all + `value` which holds the custom JSON in addition to the `@type` - 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: + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + 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: - option: + name: 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. - weight: + title: name of the app module + version: type: string - description: WeightedVoteOption defines a unit of vote for vote split. - 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 + 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: >- - VoteOption enumerates the valid vote options for a given governance - proposal. + QueryModuleVersionsResponse is the response type for the + Query/ModuleVersions - - 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: + RPC method. + + + Since: cosmos-sdk 0.43 + cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse: type: object properties: - votingPeriod: + upgraded_consensus_state: type: string - description: Length of the voting period. - description: VotingParams defines the params for voting on governance proposals. - cosmos.gov.v1beta1.WeightedVoteOption: + format: byte + title: 'Since: cosmos-sdk 0.43' + description: >- + QueryUpgradedConsensusStateResponse is the response type for the + Query/UpgradedConsensusState + + RPC method. + cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse: + type: object + description: >- + MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount + response type. + ibc.applications.transfer.v1.DenomTrace: type: object properties: - option: + path: 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. + path defines the chain of port/channel identifiers used for tracing + the - - 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. - weight: + source of the fungible token. + base_denom: type: string - description: WeightedVoteOption defines a unit of vote for vote split. - cosmos.slashing.v1beta1.MsgUnjailResponse: + description: base denomination of the relayed fungible token. + description: >- + DenomTrace contains the base denomination for ICS20 fungible tokens and + the + + source tracing information path. + ibc.applications.transfer.v1.MsgTransferResponse: type: object - title: MsgUnjailResponse defines the Msg/Unjail response type - cosmos.slashing.v1beta1.Params: + description: MsgTransferResponse defines the Msg/Transfer response type. + ibc.applications.transfer.v1.Params: type: object properties: - signedBlocksWindow: - type: string - format: int64 - minSignedPerWindow: - type: string - format: byte - downtimeJailDuration: - type: string - slashFractionDoubleSign: - type: string - format: byte - slashFractionDowntime: - type: string - format: byte - description: Params represents the parameters used for by the slashing module. - cosmos.slashing.v1beta1.QueryParamsResponse: + send_enabled: + type: boolean + description: >- + send_enabled enables or disables all cross-chain token transfers from + this + + chain. + receive_enabled: + type: boolean + description: >- + receive_enabled enables or disables all cross-chain token transfers to + this + + chain. + description: >- + Params defines the set of IBC transfer parameters. + + NOTE: To prevent a single token from being transferred, set the + + TransfersEnabled parameter to true and then set the bank module's + SendEnabled + + parameter for the denomination to false. + ibc.applications.transfer.v1.QueryDenomHashResponse: type: object properties: - params: - type: object - properties: - signedBlocksWindow: - type: string - format: int64 - minSignedPerWindow: - type: string - format: byte - downtimeJailDuration: - type: string - slashFractionDoubleSign: - type: string - format: byte - slashFractionDowntime: - 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: + hash: + type: string + description: hash (in hex format) of the denomination trace information. + description: |- + QueryDenomHashResponse is the response type for the Query/DenomHash RPC + method. + ibc.applications.transfer.v1.QueryDenomTraceResponse: type: object properties: - valSigningInfo: + denom_trace: type: object properties: - address: - type: string - startHeight: - type: string - format: int64 - title: Height at which validator was first a candidate OR was unjailed - indexOffset: - 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`. - jailedUntil: + path: 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 + path defines the chain of port/channel identifiers used for + tracing the - once the validator commits an equivocation or for any other - configured misbehiavor. - missedBlocksCounter: + source of the fungible token. + base_denom: type: string - format: int64 - description: >- - A counter kept to avoid unnecessary array reads. - - Note that `Sum(MissedBlocksBitArray)` always equals - `MissedBlocksCounter`. + description: base denomination of the relayed fungible token. description: >- - ValidatorSigningInfo defines a validator's signing info for monitoring - their - - liveness activity. - title: val_signing_info is the signing info of requested val cons address - title: >- - QuerySigningInfoResponse is the response type for the Query/SigningInfo - RPC + DenomTrace contains the base denomination for ICS20 fungible tokens + and the - method - cosmos.slashing.v1beta1.QuerySigningInfosResponse: + source tracing information path. + description: |- + QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC + method. + ibc.applications.transfer.v1.QueryDenomTracesResponse: type: object properties: - info: - type: array - items: - type: object - properties: - address: - type: string - startHeight: - type: string - format: int64 - title: Height at which validator was first a candidate OR was unjailed - indexOffset: - 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`. - jailedUntil: - 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. - missedBlocksCounter: + denom_traces: + type: array + items: + type: object + properties: + path: type: string - format: int64 description: >- - A counter kept to avoid unnecessary array reads. + path defines the chain of port/channel identifiers used for + tracing the - Note that `Sum(MissedBlocksBitArray)` always equals - `MissedBlocksCounter`. + source of the fungible token. + base_denom: + type: string + description: base denomination of the relayed fungible token. description: >- - ValidatorSigningInfo defines a validator's signing info for - monitoring their + DenomTrace contains the base denomination for ICS20 fungible tokens + and the - liveness activity. - title: info is the signing info of all validators + source tracing information path. + description: denom_traces returns all denominations trace information. pagination: + description: pagination defines the pagination in the response. type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -16668,751 +46433,1260 @@ definitions: 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 + description: >- + QueryConnectionsResponse is the response type for the Query/DenomTraces RPC - method - cosmos.slashing.v1beta1.ValidatorSigningInfo: + method. + ibc.applications.transfer.v1.QueryEscrowAddressResponse: type: object properties: - address: - type: string - startHeight: + escrow_address: type: string - format: int64 - title: Height at which validator was first a candidate OR was unjailed - indexOffset: - type: string - format: int64 - description: >- - Index which is incremented each time the validator was a bonded + title: the escrow account address + description: >- + QueryEscrowAddressResponse is the response type of the EscrowAddress RPC + method. + ibc.applications.transfer.v1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + send_enabled: + type: boolean + description: >- + send_enabled enables or disables all cross-chain token transfers + from this - in a block and may have signed a precommit or not. This in conjunction - with the + chain. + receive_enabled: + type: boolean + description: >- + receive_enabled enables or disables all cross-chain token + transfers to this - `SignedBlocksWindow` param determines the index in the - `MissedBlocksBitArray`. - jailedUntil: + chain. + description: QueryParamsResponse is the response type for the Query/Params RPC method. + ibc.core.client.v1.Height: + type: object + properties: + revision_number: 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. - missedBlocksCounter: + format: uint64 + title: the revision that the client is currently on + revision_height: 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 + format: uint64 + title: the height within the given revision description: |- - BondStatus is the status of a validator. + 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 - - 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: + that can be compared against another Height for the purposes of updating + and + + freezing clients + ibc.core.channel.v1.Channel: type: object properties: - commissionRates: - description: >- - commission_rates defines the initial commission rates to be used for - creating a validator. + 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: - rate: - type: string - description: 'rate is the commission rate charged to delegators, as a fraction.' - maxRate: + port_id: type: string description: >- - max_rate defines the maximum commission rate which validator can - ever charge, as a fraction. - maxChangeRate: + port on the counterparty chain which owns the other end of the + channel. + channel_id: type: string - description: >- - max_change_rate defines the maximum daily increase of the - validator commission, as a fraction. - updateTime: + 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 - 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: + 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: - rate: - type: string - description: 'rate is the commission rate charged to delegators, as a fraction.' - maxRate: + port_id: type: string description: >- - max_rate defines the maximum commission rate which validator can ever - charge, as a fraction. - maxChangeRate: + port on the counterparty chain which owns the other end of the + channel. + channel_id: 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: + title: channel end on the counterparty chain + title: Counterparty defines a channel end counterparty + ibc.core.channel.v1.IdentifiedChannel: type: object properties: - delegatorAddress: - type: string - description: delegator_address is the bech32-encoded address of the delegator. - validatorAddress: + state: + title: current state of the channel end type: string - description: validator_address is the bech32-encoded address of the validator. - shares: + 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 - 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: + 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: - delegatorAddress: + port_id: type: string - description: delegator_address is the bech32-encoded address of the delegator. - validatorAddress: - type: string - description: validator_address is the bech32-encoded address of the validator. - shares: + description: >- + port on the counterparty chain which owns the other end of the + channel. + channel_id: 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: + 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 + 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 + description: MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. + ibc.core.channel.v1.MsgChannelOpenTryResponse: + type: object + description: MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. + ibc.core.channel.v1.MsgRecvPacketResponse: + type: object + description: MsgRecvPacketResponse defines the Msg/RecvPacket response type. + ibc.core.channel.v1.MsgTimeoutOnCloseResponse: + type: object + description: MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. + ibc.core.channel.v1.MsgTimeoutResponse: + type: object + 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: - denom: + revision_number: type: string - amount: + format: uint64 + title: the revision that the client is currently on + revision_height: type: string - description: |- - Coin defines a token with a denomination and an amount. + format: uint64 + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping - 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: + 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: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: + port_id: type: string - description: >- - identity defines an optional identity signature (ex. UPort or - Keybase). - website: + description: channel port identifier. + channel_id: type: string - description: website defines an optional website link. - securityContact: + description: channel unique identifier. + sequence: type: string - description: security_contact defines an optional email for security contact. - details: + format: uint64 + description: packet sequence. + data: type: string - description: details define other optional details. - description: Description defines a validator description. - cosmos.staking.v1beta1.HistoricalInfo: + 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: - header: + identified_client_state: + title: client state associated with the channel type: object properties: - version: - title: basic block info + client_id: + type: string + title: client identifier + client_state: type: object properties: - block: - type: string - format: uint64 - app: + '@type': type: string - format: uint64 + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} description: >- - Consensus captures the consensus rules for processing a block in - the blockchain, + `Any` contains an arbitrary serialized protocol buffer message + along with a - including all blockchain data structures and the rules of the - application's + URL that describes the type of the serialized message. - state transition machine. - chainId: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - lastBlockId: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - partSetHeader: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - lastCommitHash: - type: string - format: byte - title: hashes of block data - dataHash: - type: string - format: byte - validatorsHash: - type: string - format: byte - title: hashes from the app output from the prev block - nextValidatorsHash: - type: string - format: byte - consensusHash: - type: string - format: byte - appHash: - type: string - format: byte - lastResultsHash: - type: string - format: byte - evidenceHash: + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the 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: client state + 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: byte - title: consensus info - proposerAddress: + format: uint64 + title: the revision that the client is currently on + revision_height: type: string - format: byte - description: Header defines the structure of a Tendermint block header. - valset: - type: array - items: - type: object - properties: - operatorAddress: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensusPubkey: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + 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 - protocol buffer message. This string must contain at least + breaking changes In these cases, the RevisionNumber is incremented so + that - one "/" character. The last segment of the URL's path must - represent + height continues to be monitonically increasing even as the + RevisionHeight - the fully qualified name of the type (as in + gets reset + title: |- + QueryChannelClientStateResponse is the Response type for the + Query/QueryChannelClientState RPC method + ibc.core.channel.v1.QueryChannelConsensusStateResponse: + type: object + properties: + consensus_state: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - `path/google.protobuf.Duration`). The name should be in a - canonical form + protocol buffer message. This string must contain at least - (e.g., leading "." is not accepted). + one "/" character. The last segment of the URL's path must + represent + the fully qualified name of the type (as in - In practice, teams usually precompile into the binary all - types that they + `path/google.protobuf.Duration`). The name should be in a + canonical form - expect it to use in the context of Any. However, for URLs - which use the + (e.g., leading "." is not accepted). - scheme `http`, `https`, or no scheme, one can optionally set - up a type - server that maps type URLs to message definitions as - follows: + In practice, teams usually precompile into the binary all types + that they + expect it to use in the context of Any. However, for URLs which + use the - * If no scheme is provided, `https` is assumed. + scheme `http`, `https`, or no scheme, one can optionally set up a + type - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + server that maps type URLs to message definitions as follows: - Note: this functionality is not currently available in the - official - protobuf release, and it is not used for type URLs beginning - with + * If no scheme is provided, `https` is assumed. - type.googleapis.com. + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + Note: this functionality is not currently available in the + official - Schemes other than `http`, `https` (or the empty scheme) - might be + protobuf release, and it is not used for type URLs beginning with - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + type.googleapis.com. - URL that describes the type of the serialized message. + Schemes other than `http`, `https` (or the empty scheme) might be - Protobuf library provides support to pack/unpack Any values in - the form + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - of utility functions or additional generated methods of the Any - type. + URL that describes the type of the serialized message. - Example 1: Pack and unpack a message in C++. + Protobuf library provides support to pack/unpack Any values in the + form - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + of utility functions or additional generated methods of the Any type. - Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Example 1: Pack and unpack a message in C++. - Example 3: Pack and unpack a message in Python. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + Example 2: Pack and unpack a message in Java. - Example 4: Pack and unpack a message in Go + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + Example 3: Pack and unpack a message in Python. - The pack methods provided by protobuf library will by default - use + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + Example 4: Pack and unpack a message in Go - methods only use the fully qualified type name after the last - '/' + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - in the type URL, for example "foo.bar.com/x/y.z" will yield type + The pack methods provided by protobuf library will by default use - name "y.z". + 'type.googleapis.com/full.type.name' as the type URL and the unpack + methods only use the fully qualified type name after the last '/' + in the type URL, for example "foo.bar.com/x/y.z" will yield type - JSON + name "y.z". - ==== - The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an + JSON - additional field `@type` which contains the type URL. Example: + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the 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: consensus state associated with the channel + 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 - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + RevisionNumber the same. However some consensus algorithms may choose + to - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + reset the height in certain conditions e.g. hard forks, state-machine - If the embedded message type is well-known and has a custom JSON + breaking changes In these cases, the RevisionNumber is incremented so + that - representation, that representation will be embedded adding a - field + height continues to be monitonically increasing even as the + RevisionHeight - `value` which holds the custom JSON in addition to the `@type` + gets reset + description: >- + QueryChannelResponse is the response type for the Query/Channel RPC + method. - field. Example (for message [google.protobuf.Duration][]): + Besides the Channel end, it includes a proof and the height from which the - { - "@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). + 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: - - 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). - delegatorShares: + - 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 - description: >- - delegator_shares defines total shares issued to a validator's - delegators. - description: - description: description defines the description terms for the validator. + 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: - 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. - securityContact: + port_id: type: string description: >- - security_contact defines an optional email for security - contact. - details: + port on the counterparty chain which owns the other end of + the channel. + channel_id: type: string - description: details define other optional details. - unbondingHeight: + 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 - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbondingTime: + title: >- + opaque channel version, which is agreed upon during the + handshake + port_id: 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: - commissionRates: - 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. - maxRate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - maxChangeRate: - type: string - description: >- - max_change_rate defines the maximum daily increase of - the validator commission, as a fraction. - updateTime: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - minSelfDelegation: + title: port identifier + channel_id: type: string - description: >- - min_self_delegation is the validator's self declared minimum - self delegation. - description: >- - Validator defines a validator, together with the total amount of the + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - Validator's bond shares and their exchange rate to coins. Slashing - results in + 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. - a decrease in the exchange rate, allowing correct calculation of - future + 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 - undelegations without iterating over delegators. When coins are - delegated to + RevisionNumber the same. However some consensus algorithms may choose + to - this validator, the validator is credited with a delegation whose - number of + reset the height in certain conditions e.g. hard forks, state-machine - bond shares is based on the amount of coins delegated divided by the - current + breaking changes In these cases, the RevisionNumber is incremented so + that - exchange rate. Voting power can be calculated as total bonded shares + height continues to be monitonically increasing even as the + RevisionHeight - multiplied by exchange rate. + gets reset description: >- - HistoricalInfo contains header and validator information for a given - block. + 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 - It is stored as part of staking module's state, which persists the `n` - most + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - recent HistoricalInfo + 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. - (`n` is set by the staking module's `historical_entries` parameter). - cosmos.staking.v1beta1.MsgBeginRedelegateResponse: - type: object - properties: - completionTime: - type: string - format: date-time - description: MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. - 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: - completionTime: - type: string - format: date-time - description: MsgUndelegateResponse defines the Msg/Undelegate response type. - cosmos.staking.v1beta1.Params: - type: object - properties: - unbondingTime: - type: string - description: unbonding_time is the time duration of unbonding. - maxValidators: - type: integer - format: int64 - description: max_validators is the maximum number of validators. - maxEntries: - type: integer - format: int64 + 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: >- - max_entries is the max entries for either unbonding delegation or - redelegation (per pair/trio). - historicalEntries: - type: integer - format: int64 - description: historical_entries is the number of historical entries to persist. - bondDenom: - type: string - description: bond_denom defines the bondable coin denomination. - description: Params defines the parameters for the staking module. - cosmos.staking.v1beta1.Pool: + 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: - notBondedTokens: + next_sequence_receive: type: string - bondedTokens: + format: uint64 + title: next sequence receive number + proof: 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: - delegationResponse: + format: byte + title: merkle proof of existence + proof_height: + title: height at which the proof was retrieved type: object properties: - delegation: - type: object - properties: - delegatorAddress: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validatorAddress: - 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 + 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 - owned by one delegator, and is associated with the voting power of - one + RevisionNumber the same. However some consensus algorithms may choose + to - validator. - balance: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + reset the height in certain conditions e.g. hard forks, state-machine + breaking changes In these cases, the RevisionNumber is incremented so + that - NOTE: The amount field is an Int which implements the custom - method + height continues to be monitonically increasing even as the + RevisionHeight - signatures required by gogoproto. + 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: >- - DelegationResponse is equivalent to Delegation except that it contains - a + Normally the RevisionHeight is incremented at each height while + keeping - 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: + 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: - delegationResponses: + acknowledgements: type: array items: type: object properties: - delegation: - type: object - properties: - delegatorAddress: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validatorAddress: - 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. - + 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 - NOTE: The amount field is an Int which implements the custom - method + packet commitments, acknowledgements, and receipts. - signatures required by gogoproto. - description: >- - DelegationResponse is equivalent to Delegation except that it - contains a + Caller is responsible for knowing the context necessary to interpret + this - balance in addition to shares which is more suitable for client - responses. - description: delegation_responses defines all the delegations' info of a delegator. + state as a commitment, acknowledgement, or a receipt. pagination: - description: pagination defines the pagination in the response. + title: pagination response type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -17426,1232 +47700,1115 @@ definitions: 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: + 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: - unbondingResponses: + commitments: type: array items: type: object properties: - delegatorAddress: + port_id: type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validatorAddress: + description: channel port identifier. + channel_id: type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - entries: - type: array - items: - type: object - properties: - creationHeight: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding took - place. - completionTime: - type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initialBalance: - 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. - description: >- - UnbondingDelegationEntry defines an unbonding object with - relevant metadata. - description: entries are the unbonding delegation entries. + 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: >- - UnbondingDelegation stores all of a single delegator's unbonding - bonds + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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 - for a single validator in an time-ordered list. - pagination: - description: pagination defines the pagination in the response. + 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: - nextKey: + revision_number: type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + format: uint64 + title: the revision that the client is currently on + revision_height: type: string format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + title: the height within the given revision + description: >- + Normally the RevisionHeight is incremented at each height while + keeping - was set, its value is undefined otherwise + 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.State: + type: string + enum: + - STATE_UNINITIALIZED_UNSPECIFIED + - STATE_INIT + - STATE_TRYOPEN + - STATE_OPEN + - STATE_CLOSED + default: STATE_UNINITIALIZED_UNSPECIFIED description: |- - QueryUnbondingDelegatorDelegationsResponse is response type for the - Query/UnbondingDelegatorDelegations RPC method. - cosmos.staking.v1beta1.QueryDelegatorValidatorResponse: + 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.IdentifiedClientState: type: object properties: - validator: + client_id: + type: string + title: client identifier + client_state: type: object properties: - operatorAddress: + '@type': type: string description: >- - operator_address defines the address of the validator's operator; - bech encoded in JSON. - consensusPubkey: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + A URL/resource name that uniquely identifies the type of the + serialized - protocol buffer message. This string must contain at least + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary all - types that they + In practice, teams usually precompile into the binary all types + that they - expect it to use in the context of Any. However, for URLs - which use the + expect it to use in the context of Any. However, for URLs which + use the - scheme `http`, `https`, or no scheme, one can optionally set - up a type + scheme `http`, `https`, or no scheme, one can optionally set up a + type - server that maps type URLs to message definitions as follows: + server that maps type URLs to message definitions as follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in the - official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs beginning - with + protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) might - be + Schemes other than `http`, `https` (or the empty scheme) might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values in the - form + Protobuf library provides support to pack/unpack Any values in the + form - of utility functions or additional generated methods of the Any - type. + of utility functions or additional generated methods of the Any type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - The pack methods provided by protobuf library will by default use + The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + 'type.googleapis.com/full.type.name' as the type URL and the unpack - methods only use the fully qualified type name after the last '/' + methods only use the fully qualified type name after the last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` - name "y.z". + field. Example (for message [google.protobuf.Duration][]): + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: client state + 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 - JSON + reset the height in certain conditions e.g. hard forks, state-machine - ==== + breaking changes In these cases, the RevisionNumber is incremented so + that - The JSON representation of an `Any` value uses the regular + height continues to be monitonically increasing even as the + RevisionHeight - representation of the deserialized, embedded message, with an + gets reset + consensus_state: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - additional field `@type` which contains the type URL. Example: + protocol buffer message. This string must contain at least - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + one "/" character. The last segment of the URL's path must + represent - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + the fully qualified name of the type (as in - If the embedded message type is well-known and has a custom JSON + `path/google.protobuf.Duration`). The name should be in a + canonical form - representation, that representation will be embedded adding a - field + (e.g., leading "." is not accepted). - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + In practice, teams usually precompile into the binary all types + that they - { - "@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). - delegatorShares: - 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. - securityContact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbondingHeight: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbondingTime: - 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: - commissionRates: - 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. - maxRate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - maxChangeRate: - type: string - description: >- - max_change_rate defines the maximum daily increase of the - validator commission, as a fraction. - updateTime: - type: string - format: date-time - description: update_time is the last time the commission rate was changed. - minSelfDelegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum self - delegation. - description: >- - Validator defines a validator, together with the total amount of the + expect it to use in the context of Any. However, for URLs which + use the - Validator's bond shares and their exchange rate to coins. Slashing - results in + scheme `http`, `https`, or no scheme, one can optionally set up a + type - a decrease in the exchange rate, allowing correct calculation of - future + server that maps type URLs to message definitions as follows: - undelegations without iterating over delegators. When coins are - delegated to - this validator, the validator is credited with a delegation whose - number of + * If no scheme is provided, `https` is assumed. - bond shares is based on the amount of coins delegated divided by the - current + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - exchange rate. Voting power can be calculated as total bonded shares + Note: this functionality is not currently available in the + official - 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: - operatorAddress: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensusPubkey: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + protobuf release, and it is not used for type URLs beginning with - protocol buffer message. This string must contain at least + type.googleapis.com. - one "/" character. The last segment of the URL's path must - represent - the fully qualified name of the type (as in + Schemes other than `http`, `https` (or the empty scheme) might be - `path/google.protobuf.Duration`). The name should be in a - canonical form + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - (e.g., leading "." is not accepted). + URL that describes the type of the serialized message. - In practice, teams usually precompile into the binary all - types that they + Protobuf library provides support to pack/unpack Any values in the + form - expect it to use in the context of Any. However, for URLs - which use the + of utility functions or additional generated methods of the Any type. - scheme `http`, `https`, or no scheme, one can optionally set - up a type - server that maps type URLs to message definitions as - follows: + Example 1: Pack and unpack a message in C++. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - * If no scheme is provided, `https` is assumed. + Example 2: Pack and unpack a message in Java. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Note: this functionality is not currently available in the - official + Example 3: Pack and unpack a message in Python. - protobuf release, and it is not used for type URLs beginning - with + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - type.googleapis.com. + Example 4: Pack and unpack a message in Go + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - Schemes other than `http`, `https` (or the empty scheme) - might be + The pack methods provided by protobuf library will by default use - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + 'type.googleapis.com/full.type.name' as the type URL and the unpack - URL that describes the type of the serialized message. + methods only use the fully qualified type name after the last '/' + in the type URL, for example "foo.bar.com/x/y.z" will yield type - Protobuf library provides support to pack/unpack Any values in - the form + name "y.z". - of utility functions or additional generated methods of the Any - type. - Example 1: Pack and unpack a message in C++. + JSON - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + ==== - Example 2: Pack and unpack a message in Java. + The JSON representation of an `Any` value uses the regular - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + representation of the deserialized, embedded message, with an - Example 3: Pack and unpack a message in Python. + additional field `@type` which contains the type URL. Example: - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - Example 4: Pack and unpack a message in Go + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + If the embedded message type is well-known and has a custom JSON - The pack methods provided by protobuf library will by default - use + representation, that representation will be embedded adding a field - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + `value` which holds the custom JSON in addition to the `@type` - methods only use the fully qualified type name after the last - '/' + field. Example (for message [google.protobuf.Duration][]): - in the type URL, for example "foo.bar.com/x/y.z" will yield type + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: consensus state + description: >- + ConsensusStateWithHeight defines a consensus state with an additional + height - name "y.z". + 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. + 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. + description: >- + QueryClientParamsResponse is the response type for the Query/ClientParams + RPC + method. + ibc.core.client.v1.QueryClientStateResponse: + type: object + properties: + 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 - JSON + one "/" character. The last segment of the URL's path must + represent - ==== + the fully qualified name of the type (as in - The JSON representation of an `Any` value uses the regular + `path/google.protobuf.Duration`). The name should be in a + canonical form - representation of the deserialized, embedded message, with an + (e.g., leading "." is not accepted). - additional field `@type` which contains the type URL. Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + In practice, teams usually precompile into the binary all types + that they - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + expect it to use in the context of Any. However, for URLs which + use the - If the embedded message type is well-known and has a custom JSON + scheme `http`, `https`, or no scheme, one can optionally set up a + type - representation, that representation will be embedded adding a - field + server that maps type URLs to message definitions as follows: - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + * If no scheme is provided, `https` is assumed. - { - "@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). - delegatorShares: - 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. - securityContact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbondingHeight: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbondingTime: - 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: - commissionRates: - 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. - maxRate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - maxChangeRate: - type: string - description: >- - max_change_rate defines the maximum daily increase of - the validator commission, as a fraction. - updateTime: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - minSelfDelegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum - self delegation. - description: >- - Validator defines a validator, together with the total amount of the + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Validator's bond shares and their exchange rate to coins. Slashing - results in + Note: this functionality is not currently available in the + official - a decrease in the exchange rate, allowing correct calculation of - future + protobuf release, and it is not used for type URLs beginning with - undelegations without iterating over delegators. When coins are - delegated to + type.googleapis.com. - 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 + Schemes other than `http`, `https` (or the empty scheme) might be - exchange rate. Voting power can be calculated as total bonded shares + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - multiplied by exchange rate. - description: validators defines the the validators' info of a delegator. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + URL that describes the type of the serialized message. - 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 + Protobuf library provides support to pack/unpack Any values in the + form - state transition machine. - chainId: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - lastBlockId: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - partSetHeader: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - lastCommitHash: - type: string - format: byte - title: hashes of block data - dataHash: - type: string - format: byte - validatorsHash: - type: string - format: byte - title: hashes from the app output from the prev block - nextValidatorsHash: - type: string - format: byte - consensusHash: - type: string - format: byte - appHash: - type: string - format: byte - lastResultsHash: - type: string - format: byte - evidenceHash: - type: string - format: byte - title: consensus info - proposerAddress: - type: string - format: byte - description: Header defines the structure of a Tendermint block header. - valset: - type: array - items: - type: object - properties: - operatorAddress: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensusPubkey: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + of utility functions or additional generated methods of the Any type. - protocol buffer message. This string must contain at - least - one "/" character. The last segment of the URL's path - must represent + Example 1: Pack and unpack a message in C++. - the fully qualified name of the type (as in + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - `path/google.protobuf.Duration`). The name should be in - a canonical form + Example 2: Pack and unpack a message in Java. - (e.g., leading "." is not accepted). + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. - In practice, teams usually precompile into the binary - all types that they + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - expect it to use in the context of Any. However, for - URLs which use the + Example 4: Pack and unpack a message in Go - scheme `http`, `https`, or no scheme, one can optionally - set up a type + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - server that maps type URLs to message definitions as - follows: + The pack methods provided by protobuf library will by default use + 'type.googleapis.com/full.type.name' as the type URL and the unpack - * If no scheme is provided, `https` is assumed. + methods only use the fully qualified type name after the last '/' - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + in the type URL, for example "foo.bar.com/x/y.z" will yield type - Note: this functionality is not currently available in - the official + name "y.z". - protobuf release, and it is not used for type URLs - beginning with - type.googleapis.com. + JSON - Schemes other than `http`, `https` (or the empty scheme) - might be + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the 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: client state associated with the request identifier + 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 - used with implementation specific semantics. - additionalProperties: {} + 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: + type: object + properties: + '@type': + type: string description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + A URL/resource name that uniquely identifies the type of the + serialized - URL that describes the type of the serialized message. + protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must + represent - Protobuf library provides support to pack/unpack Any values - in the form + the fully qualified name of the type (as in - of utility functions or additional generated methods of the - Any type. + `path/google.protobuf.Duration`). The name should be in a + canonical form + (e.g., leading "." is not accepted). - Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + In practice, teams usually precompile into the binary all + types that they - Example 2: Pack and unpack a message in Java. + expect it to use in the context of Any. However, for URLs + which use the - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + scheme `http`, `https`, or no scheme, one can optionally set + up a type - Example 3: Pack and unpack a message in Python. + server that maps type URLs to message definitions as + follows: - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + * If no scheme is provided, `https` is assumed. - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - The pack methods provided by protobuf library will by - default use + Note: this functionality is not currently available in the + official - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + protobuf release, and it is not used for type URLs beginning + with - methods only use the fully qualified type name after the - last '/' + type.googleapis.com. - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - name "y.z". + Schemes other than `http`, `https` (or the empty scheme) + might be + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + URL that describes the type of the serialized message. - JSON - ==== + Protobuf library provides support to pack/unpack Any values in + the form - The JSON representation of an `Any` value uses the regular + of utility functions or additional generated methods of the Any + type. - representation of the deserialized, embedded message, with - an - additional field `@type` which contains the type URL. - Example: + Example 1: Pack and unpack a message in C++. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + Example 2: Pack and unpack a message in Java. - If the embedded message type is well-known and has a custom - JSON + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - representation, that representation will be embedded adding - a field + Example 3: Pack and unpack a message in Python. - `value` which holds the custom JSON in addition to the - `@type` + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - field. Example (for message [google.protobuf.Duration][]): + Example 4: Pack and unpack a message in Go - { - "@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). - delegatorShares: - 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. - securityContact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbondingHeight: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which - this validator has begun unbonding. - unbondingTime: - 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: - commissionRates: - 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. - maxRate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - maxChangeRate: - type: string - description: >- - max_change_rate defines the maximum daily increase - of the validator commission, as a fraction. - updateTime: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - minSelfDelegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum - self delegation. - description: >- - Validator defines a validator, together with the total amount of - the + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - Validator's bond shares and their exchange rate to coins. - Slashing results in + The pack methods provided by protobuf library will by default + use - a decrease in the exchange rate, allowing correct calculation of - future + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - undelegations without iterating over delegators. When coins are - delegated to + methods only use the fully qualified type name after the last + '/' - this validator, the validator is credited with a delegation - whose number of + in the type URL, for example "foo.bar.com/x/y.z" will yield type - bond shares is based on the amount of coins delegated divided by - the current + name "y.z". - 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: - unbondingTime: - type: string - description: unbonding_time is the time duration of unbonding. - maxValidators: - type: integer - format: int64 - description: max_validators is the maximum number of validators. - maxEntries: - type: integer - format: int64 - description: >- - max_entries is the max entries for either unbonding delegation or - redelegation (per pair/trio). - historicalEntries: - type: integer - format: int64 - description: historical_entries is the number of historical entries to persist. - bondDenom: - type: string - description: bond_denom defines the bondable coin denomination. - 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: - notBondedTokens: - type: string - bondedTokens: - type: string - description: QueryPoolResponse is response type for the Query/Pool RPC method. - cosmos.staking.v1beta1.QueryRedelegationsResponse: - type: object - properties: - redelegationResponses: - type: array - items: - type: object - properties: - redelegation: - type: object - properties: - delegatorAddress: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validatorSrcAddress: - type: string - description: >- - validator_src_address is the validator redelegation source - operator address. - validatorDstAddress: - type: string - description: >- - validator_dst_address is the validator redelegation - destination operator address. - entries: - type: array - items: - type: object - properties: - creationHeight: - type: string - format: int64 - description: >- - creation_height defines the height which the - redelegation took place. - completionTime: - type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initialBalance: - type: string - description: >- - initial_balance defines the initial balance when - redelegation started. - sharesDst: - type: string - description: >- - shares_dst is the amount of destination-validator - shares created by redelegation. - 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 + JSON - from a particular source validator to a particular destination - validator. - entries: - type: array - items: - type: object - properties: - redelegationEntry: - type: object - properties: - creationHeight: - type: string - format: int64 - description: >- - creation_height defines the height which the - redelegation took place. - completionTime: - type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initialBalance: - type: string - description: >- - initial_balance defines the initial balance when - redelegation started. - sharesDst: - type: string - description: >- - shares_dst is the amount of destination-validator - shares created by redelegation. - 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 + The JSON representation of an `Any` value uses the regular - responses. - description: >- - RedelegationResponse is equivalent to a Redelegation except that its - entries + representation of the deserialized, embedded message, with an - contain a balance in addition to shares which is more suitable for + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the 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: client state + description: >- + IdentifiedClientState defines a client state with an additional client - responses. + identifier field. + description: list of stored ClientStates of the chain. pagination: - description: pagination defines the pagination in the response. + title: pagination response type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -18665,114 +48822,75 @@ definitions: 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: >- - QueryRedelegationsResponse is response type for the Query/Redelegations + QueryClientStatesResponse is the response type for the Query/ClientStates RPC method. - cosmos.staking.v1beta1.QueryUnbondingDelegationResponse: + ibc.core.client.v1.QueryClientStatusResponse: type: object properties: - unbond: - type: object - properties: - delegatorAddress: - type: string - description: delegator_address is the bech32-encoded address of the delegator. - validatorAddress: - type: string - description: validator_address is the bech32-encoded address of the validator. - entries: - type: array - items: - type: object - properties: - creationHeight: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding took - place. - completionTime: - type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initialBalance: - 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. - 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: + 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: - delegationResponses: + consensus_state_heights: type: array items: type: object properties: - delegation: - type: object - properties: - delegatorAddress: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validatorAddress: - 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 + 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 - owned by one delegator, and is associated with the voting power - of one + RevisionNumber the same. However some consensus algorithms may + choose to - validator. - balance: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + reset the height in certain conditions e.g. hard forks, + state-machine + breaking changes In these cases, the RevisionNumber is incremented + so that - NOTE: The amount field is an Int which implements the custom - method + height continues to be monitonically increasing even as the + RevisionHeight - signatures required by gogoproto. - description: >- - DelegationResponse is equivalent to Delegation except that it - contains a + gets reset + title: >- + Height is a monotonically increasing data type - balance in addition to shares which is more suitable for client - responses. + that can be compared against another Height for the purposes of + updating and + + freezing clients + title: consensus state heights pagination: - description: pagination defines the pagination in the response. + title: pagination response type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -18786,351 +48904,439 @@ definitions: 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: |- - QueryValidatorDelegationsResponse is response type for the - Query/ValidatorDelegations RPC method - cosmos.staking.v1beta1.QueryValidatorResponse: + QueryConsensusStateHeightsResponse is the response type for the + Query/ConsensusStateHeights RPC method + ibc.core.client.v1.QueryConsensusStateResponse: type: object properties: - validator: + consensus_state: type: object properties: - operatorAddress: + '@type': type: string description: >- - operator_address defines the address of the validator's operator; - bech encoded in JSON. - consensusPubkey: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + A URL/resource name that uniquely identifies the type of the + serialized - protocol buffer message. This string must contain at least + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary all - types that they + In practice, teams usually precompile into the binary all types + that they - expect it to use in the context of Any. However, for URLs - which use the + expect it to use in the context of Any. However, for URLs which + use the - scheme `http`, `https`, or no scheme, one can optionally set - up a type + scheme `http`, `https`, or no scheme, one can optionally set up a + type - server that maps type URLs to message definitions as follows: + server that maps type URLs to message definitions as follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the 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: >- + consensus state associated with the client identifier at the given + height + proof: + type: string + format: byte + title: merkle proof of existence + proof_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 + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in - Note: this functionality is not currently available in the - official + `path/google.protobuf.Duration`). The name should be in a + canonical form - protobuf release, and it is not used for type URLs beginning - with + (e.g., leading "." is not accepted). - type.googleapis.com. + In practice, teams usually precompile into the binary all + types that they - Schemes other than `http`, `https` (or the empty scheme) might - be + expect it to use in the context of Any. However, for URLs + which use the - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + scheme `http`, `https`, or no scheme, one can optionally set + up a type - URL that describes the type of the serialized message. + server that maps type URLs to message definitions as + follows: - Protobuf library provides support to pack/unpack Any values in the - form + * If no scheme is provided, `https` is assumed. - of utility functions or additional generated methods of the Any - type. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + Note: this functionality is not currently available in the + official - Example 1: Pack and unpack a message in C++. + protobuf release, and it is not used for type URLs beginning + with - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + type.googleapis.com. - Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Schemes other than `http`, `https` (or the empty scheme) + might be - Example 3: Pack and unpack a message in Python. + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + URL that describes the type of the serialized message. - Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + Protobuf library provides support to pack/unpack Any values in + the form - The pack methods provided by protobuf library will by default use + of utility functions or additional generated methods of the Any + type. - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - methods only use the fully qualified type name after the last '/' + Example 1: Pack and unpack a message in C++. - in the type URL, for example "foo.bar.com/x/y.z" will yield type + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - name "y.z". + Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. - JSON + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - ==== + Example 4: Pack and unpack a message in Go - The JSON representation of an `Any` value uses the regular + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - representation of the deserialized, embedded message, with an + The pack methods provided by protobuf library will by default + use - additional field `@type` which contains the type URL. Example: + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + methods only use the fully qualified type name after the last + '/' - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + in the type URL, for example "foo.bar.com/x/y.z" will yield type - If the embedded message type is well-known and has a custom JSON + name "y.z". - representation, that representation will be embedded adding a - field - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + JSON - { - "@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). - delegatorShares: - 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. - securityContact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbondingHeight: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbondingTime: - 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: - commissionRates: - 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. - maxRate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - maxChangeRate: - type: string - description: >- - max_change_rate defines the maximum daily increase of the - validator commission, as a fraction. - updateTime: - type: string - format: date-time - description: update_time is the last time the commission rate was changed. - minSelfDelegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum self - delegation. - 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 + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - a decrease in the exchange rate, allowing correct calculation of - future + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - undelegations without iterating over delegators. When coins are - delegated to + If the embedded message type is well-known and has a custom JSON - this validator, the validator is credited with a delegation whose - number of + representation, that representation will be embedded adding a + field - bond shares is based on the amount of coins delegated divided by the - current + `value` which holds the custom JSON in addition to the `@type` - exchange rate. Voting power can be calculated as total bonded shares + field. Example (for message [google.protobuf.Duration][]): - multiplied by exchange rate. - title: QueryValidatorResponse is response type for the Query/Validator RPC method - cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse: - type: object - properties: - unbondingResponses: - type: array - items: - type: object - properties: - delegatorAddress: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validatorAddress: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - entries: - type: array - items: - type: object - properties: - creationHeight: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding took - place. - completionTime: - type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initialBalance: - 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. - description: >- - UnbondingDelegationEntry defines an unbonding object with - relevant metadata. - description: entries are the unbonding delegation entries. + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: consensus state description: >- - UnbondingDelegation stores all of a single delegator's unbonding - bonds + ConsensusStateWithHeight defines a consensus state with an + additional height - for a single validator in an time-ordered list. + field. + title: consensus states associated with the identifier pagination: - description: pagination defines the pagination in the response. + title: pagination response type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -19144,609 +49350,833 @@ definitions: 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: + 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: - validators: - type: array - items: - type: object - properties: - operatorAddress: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensusPubkey: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + upgraded_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 + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary all - types that they + In practice, teams usually precompile into the binary all types + that they - expect it to use in the context of Any. However, for URLs - which use the + expect it to use in the context of Any. However, for URLs which + use the - scheme `http`, `https`, or no scheme, one can optionally set - up a type + scheme `http`, `https`, or no scheme, one can optionally set up a + type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in the - official + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - protobuf release, and it is not used for type URLs beginning - with + If the embedded message type is well-known and has a custom JSON - type.googleapis.com. + representation, that representation will be embedded adding a field + `value` which holds the custom JSON in addition to the `@type` - Schemes other than `http`, `https` (or the empty scheme) - might be + field. Example (for message [google.protobuf.Duration][]): - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: client state associated with the request identifier + description: |- + QueryUpgradedClientStateResponse is the response type for the + Query/UpgradedClientState RPC method. + ibc.core.client.v1.QueryUpgradedConsensusStateResponse: + type: object + properties: + upgraded_consensus_state: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - URL that describes the type of the serialized message. + protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must + represent - Protobuf library provides support to pack/unpack Any values in - the form + the fully qualified name of the type (as in - of utility functions or additional generated methods of the Any - type. + `path/google.protobuf.Duration`). The name should be in a + canonical form + (e.g., leading "." is not accepted). - Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + In practice, teams usually precompile into the binary all types + that they - Example 2: Pack and unpack a message in Java. + expect it to use in the context of Any. However, for URLs which + use the - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + scheme `http`, `https`, or no scheme, one can optionally set up a + type - Example 3: Pack and unpack a message in Python. + server that maps type URLs to message definitions as follows: - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + * If no scheme is provided, `https` is assumed. - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - The pack methods provided by protobuf library will by default - use + Note: this functionality is not currently available in the + official - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + protobuf release, and it is not used for type URLs beginning with - methods only use the fully qualified type name after the last - '/' + type.googleapis.com. - in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". + Schemes other than `http`, `https` (or the empty scheme) might be + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + URL that describes the type of the serialized message. - JSON - ==== + Protobuf library provides support to pack/unpack Any values in the + form - The JSON representation of an `Any` value uses the regular + of utility functions or additional generated methods of the Any type. - representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + Example 1: Pack and unpack a message in C++. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + Example 2: Pack and unpack a message in Java. - If the embedded message type is well-known and has a custom JSON + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - representation, that representation will be embedded adding a - field + Example 3: Pack and unpack a message in Python. - `value` which holds the custom JSON in addition to the `@type` + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - field. Example (for message [google.protobuf.Duration][]): + Example 4: Pack and unpack a message in Go - { - "@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). - delegatorShares: - 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. - securityContact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbondingHeight: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbondingTime: - 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: - commissionRates: - 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. - maxRate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - maxChangeRate: - type: string - description: >- - max_change_rate defines the maximum daily increase of - the validator commission, as a fraction. - updateTime: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - minSelfDelegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum - self delegation. - description: >- - Validator defines a validator, together with the total amount of the + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use - Validator's bond shares and their exchange rate to coins. Slashing - results in + 'type.googleapis.com/full.type.name' as the type URL and the unpack - a decrease in the exchange rate, allowing correct calculation of - future + methods only use the fully qualified type name after the last '/' - undelegations without iterating over delegators. When coins are - delegated to + in the type URL, for example "foo.bar.com/x/y.z" will yield type - this validator, the validator is credited with a delegation whose - number of + name "y.z". - 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: - nextKey: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + JSON - was set, its value is undefined otherwise - title: >- - QueryValidatorsResponse is response type for the Query/Validators RPC - method - cosmos.staking.v1beta1.Redelegation: + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the 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: Consensus state associated with the request identifier + description: |- + QueryUpgradedConsensusStateResponse is the response type for the + Query/UpgradedConsensusState RPC method. + ibc.core.commitment.v1.MerklePrefix: type: object properties: - delegatorAddress: + key_prefix: type: string - description: delegator_address is the bech32-encoded address of the delegator. - validatorSrcAddress: - type: string - description: >- - validator_src_address is the validator redelegation source operator - address. - validatorDstAddress: + 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: >- - validator_dst_address is the validator redelegation destination - operator address. - entries: + description: client associated with this connection. + versions: type: array items: type: object properties: - creationHeight: - type: string - format: int64 - description: >- - creation_height defines the height which the redelegation took - place. - completionTime: - type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initialBalance: - type: string - description: >- - initial_balance defines the initial balance when redelegation - started. - sharesDst: + identifier: type: string - description: >- - shares_dst is the amount of destination-validator shares created - by redelegation. + title: unique version identifier + features: + type: array + items: + type: string + title: list of features compatible with the specified identifier 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 + Version defines the versioning scheme used to negotiate the IBC + verison in - from a particular source validator to a particular destination validator. - cosmos.staking.v1beta1.RedelegationEntry: - type: object - properties: - creationHeight: - type: string - format: int64 - description: creation_height defines the height which the redelegation took place. - completionTime: - type: string - format: date-time - description: completion_time defines the unix time for redelegation completion. - initialBalance: - type: string - description: initial_balance defines the initial balance when redelegation started. - sharesDst: - type: string + the connection handshake. description: >- - shares_dst is the amount of destination-validator shares created by - redelegation. - description: RedelegationEntry defines a redelegation object with relevant metadata. - cosmos.staking.v1beta1.RedelegationEntryResponse: - type: object - properties: - redelegationEntry: + 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: - creationHeight: - type: string - format: int64 - description: >- - creation_height defines the height which the redelegation took - place. - completionTime: - type: string - format: date-time - description: completion_time defines the unix time for redelegation completion. - initialBalance: + client_id: type: string description: >- - initial_balance defines the initial balance when redelegation - started. - sharesDst: + identifies the client on the counterparty chain associated with a + given + + connection. + connection_id: type: string description: >- - shares_dst is the amount of destination-validator shares created - by redelegation. - description: >- - RedelegationEntry defines a redelegation object with relevant - metadata. - balance: + 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 - description: >- - RedelegationEntryResponse is equivalent to a RedelegationEntry except that - it + format: uint64 + description: >- + delay period that must pass before a consensus state can be used for - contains a balance in addition to shares which is more suitable for client + packet-verification NOTE: delay period logic is only implemented by + some - responses. - cosmos.staking.v1beta1.RedelegationResponse: + 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: - redelegation: - type: object - properties: - delegatorAddress: - type: string - description: delegator_address is the bech32-encoded address of the delegator. - validatorSrcAddress: - type: string - description: >- - validator_src_address is the validator redelegation source - operator address. - validatorDstAddress: - type: string - description: >- - validator_dst_address is the validator redelegation destination - operator address. - entries: - type: array - items: - type: object - properties: - creationHeight: - type: string - format: int64 - description: >- - creation_height defines the height which the redelegation - took place. - completionTime: - type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initialBalance: - type: string - description: >- - initial_balance defines the initial balance when - redelegation started. - sharesDst: - type: string - description: >- - shares_dst is the amount of destination-validator shares - created by redelegation. - description: >- - RedelegationEntry defines a redelegation object with relevant - metadata. - description: entries are the redelegation entries. + client_id: + type: string 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: - redelegationEntry: - type: object - properties: - creationHeight: - type: string - format: int64 - description: >- - creation_height defines the height which the redelegation - took place. - completionTime: - type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initialBalance: - type: string - description: >- - initial_balance defines the initial balance when - redelegation started. - sharesDst: - type: string - description: >- - shares_dst is the amount of destination-validator shares - created by redelegation. - description: >- - RedelegationEntry defines a redelegation object with relevant - metadata. - balance: - type: string - description: >- - RedelegationEntryResponse is equivalent to a RedelegationEntry - except that it + identifies the client on the counterparty chain associated with a + given - contains a balance in addition to shares which is more suitable for - client + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty chain associated + with a - responses. - description: >- - RedelegationResponse is equivalent to a Redelegation except that its - entries + 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. - contain a balance in addition to shares which is more suitable for client + The constructed key from the Path and the key will be + append(Path.KeyPath, - responses. - cosmos.staking.v1beta1.UnbondingDelegation: + append(Path.KeyPrefix, key...)) + description: >- + Counterparty defines the counterparty chain associated with a connection + end. + ibc.core.connection.v1.IdentifiedConnection: type: object properties: - delegatorAddress: + id: type: string - description: delegator_address is the bech32-encoded address of the delegator. - validatorAddress: + description: connection identifier. + client_id: type: string - description: validator_address is the bech32-encoded address of the validator. - entries: + description: client associated with this connection. + versions: type: array items: type: object properties: - creationHeight: - type: string - format: int64 - description: creation_height is the height which the unbonding took place. - completionTime: - type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initialBalance: - type: string - description: >- - initial_balance defines the tokens initially scheduled to - receive at completion. - balance: + identifier: type: string - description: balance defines the tokens to receive at completion. + title: unique version identifier + features: + type: array + items: + type: string + title: list of features compatible with the specified identifier description: >- - UnbondingDelegationEntry defines an unbonding object with relevant - metadata. - description: entries are the unbonding delegation entries. + 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: |- - UnbondingDelegation stores all of a single delegator's unbonding bonds - for a single validator in an time-ordered list. - cosmos.staking.v1beta1.UnbondingDelegationEntry: + 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.QueryClientConnectionsResponse: type: object properties: - creationHeight: - type: string - format: int64 - description: creation_height is the height which the unbonding took place. - completionTime: + connection_paths: + type: array + items: + type: string + description: slice of all the connection paths associated with a client. + proof: type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initialBalance: + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the 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: client state + 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: >- - initial_balance defines the tokens initially scheduled to receive at - completion. - balance: - type: string - description: balance defines the tokens to receive at completion. - description: >- - UnbondingDelegationEntry defines an unbonding object with relevant - metadata. - cosmos.staking.v1beta1.Validator: + 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: - operatorAddress: - type: string - description: >- - operator_address defines the address of the validator's operator; bech - encoded in JSON. - consensusPubkey: + consensus_state: type: object properties: '@type': @@ -19871,373 +50301,301 @@ definitions: JSON - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the 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). - delegatorShares: - 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. - securityContact: - type: string - description: security_contact defines an optional email for security contact. - details: - type: string - description: details define other optional details. - unbondingHeight: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbondingTime: - 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: - commissionRates: - 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. - maxRate: - type: string - description: >- - max_rate defines the maximum commission rate which validator - can ever charge, as a fraction. - maxChangeRate: - type: string - description: >- - max_change_rate defines the maximum daily increase of the - validator commission, as a fraction. - updateTime: - type: string - format: date-time - description: update_time is the last time the commission rate was changed. - minSelfDelegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum self - delegation. - 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. - tendermint.types.BlockID: - type: object - properties: - hash: - type: string - format: byte - partSetHeader: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - 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. - chainId: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - lastBlockId: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - partSetHeader: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - lastCommitHash: - type: string - format: byte - title: hashes of block data - dataHash: - type: string - format: byte - validatorsHash: - type: string - format: byte - title: hashes from the app output from the prev block - nextValidatorsHash: - type: string - format: byte - consensusHash: - type: string - format: byte - appHash: - type: string - format: byte - lastResultsHash: - type: string - format: byte - evidenceHash: - type: string - format: byte - title: consensus info - proposerAddress: - type: string - format: byte - description: Header defines the structure of a Tendermint block header. - tendermint.types.PartSetHeader: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - 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.vesting.v1beta1.MsgCreateVestingAccountResponse: - type: object - description: >- - MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount - response type. - ibc.applications.transfer.v1.DenomTrace: - type: object - properties: - path: - type: string - description: >- - path defines the chain of port/channel identifiers used for tracing - the + The JSON representation of an `Any` value uses the regular - source of the fungible token. - baseDenom: - type: string - description: base denomination of the relayed fungible token. - description: >- - DenomTrace contains the base denomination for ICS20 fungible tokens and - the + representation of the deserialized, embedded message, with an - source tracing information path. - ibc.applications.transfer.v1.MsgTransferResponse: - type: object - description: MsgTransferResponse defines the Msg/Transfer response type. - ibc.applications.transfer.v1.Params: - type: object - properties: - sendEnabled: - type: boolean - description: >- - send_enabled enables or disables all cross-chain token transfers from - this + additional field `@type` which contains the type URL. Example: - chain. - receiveEnabled: - type: boolean + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the 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: consensus state associated with the channel + 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: >- - receive_enabled enables or disables all cross-chain token transfers to - this + Normally the RevisionHeight is incremented at each height while + keeping - chain. - description: >- - Params defines the set of IBC transfer parameters. + RevisionNumber the same. However some consensus algorithms may choose + to - NOTE: To prevent a single token from being transferred, set the + reset the height in certain conditions e.g. hard forks, state-machine - TransfersEnabled parameter to true and then set the bank module's - SendEnabled + breaking changes In these cases, the RevisionNumber is incremented so + that - parameter for the denomination to false. - ibc.applications.transfer.v1.QueryDenomTraceResponse: + 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.QueryConnectionResponse: type: object properties: - denomTrace: + connection: + title: connection associated with the request identifier type: object properties: - path: + 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: >- - path defines the chain of port/channel identifiers used for - tracing the + IBC version which can be utilised to determine encodings or + protocols for - source of the fungible token. - baseDenom: + channels or packets utilising this connection. + state: + description: current state of the connection end. type: string - description: base denomination of the relayed fungible token. + 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: >- - DenomTrace contains the base denomination for ICS20 fungible tokens - and the + ConnectionEnd defines a stateful object on a chain connected to + another - source tracing information path. - description: |- - QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC - method. - ibc.applications.transfer.v1.QueryDenomTracesResponse: + 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: - denomTraces: + connections: type: array items: type: object properties: - path: + id: type: string - description: >- - path defines the chain of port/channel identifiers used for - tracing the + 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 - source of the fungible token. - baseDenom: + 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 - description: base denomination of the relayed fungible token. - description: >- - DenomTrace contains the base denomination for ICS20 fungible tokens - and the + 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 - source tracing information path. - description: denom_traces returns all denominations trace information. + 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: - description: pagination defines the pagination in the response. + title: pagination response type: object properties: - nextKey: + next_key: type: string format: byte title: |- @@ -20251,55 +50609,87 @@ definitions: 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/DenomTraces + QueryConnectionsResponse is the response type for the Query/Connections RPC method. - ibc.applications.transfer.v1.QueryParamsResponse: + 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: - params: - description: params defines the parameters of the module. - type: object - properties: - sendEnabled: - type: boolean - description: >- - send_enabled enables or disables all cross-chain token transfers - from this - - chain. - receiveEnabled: - type: boolean - description: >- - receive_enabled enables or disables all cross-chain token - transfers to this - - chain. - description: QueryParamsResponse is the response type for the Query/Params RPC method. - ibc.core.client.v1.Height: + 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. + ibc.core.port.v1.QueryAppVersionResponse: type: object properties: - revisionNumber: + port_id: type: string - format: uint64 - title: the revision that the client is currently on - revisionHeight: + title: port id associated with the request identifiers + version: 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: supported app version + description: >- + QueryAppVersionResponse is the response type for the Query/AppVersion RPC + method. diff --git a/go.mod b/go.mod index b6e878e6..37df31ba 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/bze-alphateam/bze go 1.19 require ( - github.com/cosmos/cosmos-sdk v0.45.9 - github.com/cosmos/ibc-go v1.2.2 + github.com/cosmos/cosmos-sdk v0.45.10 + github.com/cosmos/ibc-go/v2 v2.4.2 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 github.com/gorilla/mux v1.8.0 @@ -12,8 +12,8 @@ require ( github.com/spf13/cast v1.5.0 github.com/spf13/cobra v1.5.0 github.com/stretchr/testify v1.8.0 - github.com/tendermint/spm v0.1.8 - github.com/tendermint/tendermint v0.34.21 + github.com/tendermint/starport v0.19.2 + github.com/tendermint/tendermint v0.34.22 github.com/tendermint/tm-db v0.6.6 google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c google.golang.org/grpc v1.50.1 @@ -45,7 +45,7 @@ require ( github.com/dgraph-io/badger/v2 v2.2007.2 // indirect github.com/dgraph-io/ristretto v0.0.3 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect - github.com/dustin/go-humanize v1.0.0 // indirect + github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac // indirect github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect @@ -69,23 +69,23 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 // indirect github.com/improbable-eng/grpc-web v0.14.1 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect github.com/klauspost/compress v1.15.9 // indirect github.com/lib/pq v1.10.6 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/magiconair/properties v1.8.6 // indirect - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect + github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.2 // indirect + github.com/pelletier/go-toml/v2 v2.0.5 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -94,16 +94,16 @@ require ( github.com/prometheus/common v0.34.0 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/rakyll/statik v0.1.7 // indirect - github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/regen-network/cosmos-proto v0.3.1 // indirect github.com/rs/cors v1.8.2 // indirect github.com/rs/zerolog v1.27.0 // indirect - github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect + github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/spf13/afero v1.8.2 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.12.0 // indirect - github.com/subosito/gotenv v1.4.0 // indirect + github.com/spf13/viper v1.13.0 // indirect + github.com/subosito/gotenv v1.4.1 // indirect github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/btcd v0.1.1 // indirect @@ -111,14 +111,14 @@ require ( github.com/tendermint/go-amino v0.16.0 // indirect github.com/zondax/hid v0.9.0 // indirect go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect + golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect golang.org/x/net v0.1.0 // indirect golang.org/x/sys v0.1.0 // indirect golang.org/x/term v0.1.0 // indirect golang.org/x/text v0.4.0 // indirect google.golang.org/protobuf v1.28.1 // indirect - gopkg.in/ini.v1 v1.66.6 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/go.sum b/go.sum index 49ac5ad8..1dfbf1bb 100644 --- a/go.sum +++ b/go.sum @@ -52,23 +52,35 @@ github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMb github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/99designs/keyring v1.1.6 h1:kVDC2uCgVwecxCk+9zoCt2uEL6dt+dfVzMvGgnVcIuM= github.com/99designs/keyring v1.1.6/go.mod h1:16e0ds7LGQQcT59QqkTg72Hh5ShM51Byv5PEmW6uoRU= +github.com/AlecAivazis/survey/v2 v2.1.1/go.mod h1:9FJRdMdDm8rnT+zHVbvQT2RTSTLq0Ttd6q3Vl2fahjk= github.com/Antonboom/errname v0.1.4/go.mod h1:jRXo3m0E0EuCnK3wbsSVH3X55Z4iTDLl6ZfCxwFj4TM= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= +github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= +github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= +github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -85,14 +97,36 @@ github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF0 github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= +github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= +github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= +github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= +github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= +github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= +github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= +github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= +github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= +github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= +github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= +github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= +github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= +github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= @@ -108,14 +142,23 @@ github.com/adlio/schema v1.1.13/go.mod h1:L5Z7tw+7lRK1Fnpi/LT/ooCP1elkXn0krMWBQH github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= +github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI= +github.com/alecthomas/chroma v0.8.2/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM= +github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= +github.com/alecthomas/kong v0.2.4/go.mod h1:kQOmtJgV+Lb4aj+I2LEn40cbtawdWJ9Y8QLq+lElKxE= +github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2/go.mod h1:jnzFpU88PccN/tPPhCpnNU8mZphvKxYM9lLNkd8e+os= github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= @@ -129,27 +172,39 @@ github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4 github.com/armon/go-metrics v0.3.10 h1:FR+drcQStOe+32sYyJYyZ7FIdgoGGBnwLl+flodp8Uo= github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/ashanbrown/forbidigo v1.2.0/go.mod h1:vVW7PEdqEFqapJe95xHkTfB1+XvZXBFg8t0sG2FIxmI= github.com/ashanbrown/makezero v0.0.0-20210520155254-b6261585ddde/go.mod h1:oG9Dnez7/ESBqc4EdrdNlryeo7d0KcW1ftXHm7nU/UU= +github.com/atotto/clipboard v0.1.2/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.36.30/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= +github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= +github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= +github.com/briandowns/spinner v1.11.1/go.mod h1:QOuQk7x+EaDASo80FEXwlwiA+j/PPIcX3FScO+3/ZPQ= +github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= @@ -173,9 +228,15 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= +github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= +github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= +github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= +github.com/calmh/randomart v1.1.0/go.mod h1:DQUbPVyP+7PAs21w/AnfMKG5NioxS3TbZ2F9MSK/jFM= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= @@ -184,11 +245,24 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charithe/durationcheck v0.0.8/go.mod h1:SSbRIBVfMjCi/kEB6K65XEA83D6prSM8ap1UCpNKtgg= +github.com/charmbracelet/bubbles v0.7.5/go.mod h1:IRTORFvhEI6OUH7WhN2Ks8Z8miNGimk1BE6cmHijOkM= +github.com/charmbracelet/bubbles v0.7.6/go.mod h1:0D4XRYK0tjo8JMvflz1obpVcOikNZSG46SFauoZj22s= +github.com/charmbracelet/bubbletea v0.12.2/go.mod h1:3gZkYELUOiEUOp0bTInkxguucy/xRbGSOcbMs1geLxg= +github.com/charmbracelet/bubbletea v0.13.1/go.mod h1:tp9tr9Dadh0PLhgiwchE5zZJXm5543JYjHG9oY+5qSg= +github.com/charmbracelet/charm v0.8.6/go.mod h1:8dE3uX+TYSpa7Q6e/CmjN6WSd7koSAKNQTGWugFREx4= +github.com/charmbracelet/glamour v0.2.1-0.20210311152407-2b8307dcb400/go.mod h1:VO5pQW96Vj3qJy9ikwb5Zo8lcvt2ZDFoE3UXl+SduQs= +github.com/charmbracelet/glow v1.4.0/go.mod h1:PmzpVs6fvXd60PmqRkbKtSz412SfDFPD3XbraI1hnJQ= github.com/chavacava/garif v0.0.0-20210405164556-e8a0a408d6af/go.mod h1:Qjyv4H3//PWVzTeCezG2b9IRn6myJxJSr4TD/xo6ojU= +github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= +github.com/chris-ramon/douceur v0.2.0/go.mod h1:wDW5xjJdeoMm1mRt4sD4c/LbF/mWdEpRXQKjTR8nIBE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= +github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= +github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= +github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= @@ -200,19 +274,106 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE github.com/coinbase/rosetta-sdk-go v0.6.10/go.mod h1:J/JFMsfcePrjJZkwQFLh+hJErkAmdm9Iyy3D5Y0LfXo= github.com/coinbase/rosetta-sdk-go v0.7.0 h1:lmTO/JEpCvZgpbkOITL95rA80CPKb5CtMzLaqF2mCNg= github.com/coinbase/rosetta-sdk-go v0.7.0/go.mod h1:7nD3oBPIiHqhRprqvMgPoGxe/nyq3yftRmpsy29coWE= +github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= +github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= +github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= +github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= +github.com/containerd/btrfs v0.0.0-20201111183144-404b9149801e/go.mod h1:jg2QkJcsabfHugurUvvPhS3E08Oxiuh5W/g1ybB4e0E= +github.com/containerd/btrfs v0.0.0-20210316141732-918d888fb676/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= +github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= +github.com/containerd/cgroups v0.0.0-20190717030353-c4b9ac5c7601/go.mod h1:X9rLEHIqSf/wfK8NsPqxJmeZgW4pcfzdXITDrUSJ6uI= +github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= +github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= +github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= +github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= +github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= +github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= +github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= +github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= +github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= +github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= +github.com/containerd/containerd v1.2.10/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.3.1-0.20191213020239-082f7e3aed57/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.4.0-beta.2.0.20200729163537-40b22ef07410/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.4.9/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7V960Tmcumvqn8Mc+pCYQ= +github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= +github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= +github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= +github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s= +github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= +github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= +github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= +github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= +github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= +github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= +github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= +github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= +github.com/containerd/fifo v0.0.0-20201026212402-0724c46b320c/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= +github.com/containerd/fifo v0.0.0-20210316144830-115abcc95a1d/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= +github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= +github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU= +github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= +github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= +github.com/containerd/go-runc v0.0.0-20190911050354-e029b79d8cda/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= +github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g= +github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= +github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= +github.com/containerd/imgcrypt v1.0.1/go.mod h1:mdd8cEPW7TPgNG4FpuP3sGBiQ7Yi/zak9TYCG3juvb0= +github.com/containerd/imgcrypt v1.0.4-0.20210301171431-0ae5c75f59ba/go.mod h1:6TNsg0ctmizkrOgXRNQjAPFWpMYRWuiB6dSF4Pfa5SA= +github.com/containerd/imgcrypt v1.1.1-0.20210312161619-7ed62a527887/go.mod h1:5AZJNI6sLHJljKuI9IHnw1pWqo/F0nGDOuR9zgTs7ow= +github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= +github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= +github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= +github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= +github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= +github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= +github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c/go.mod h1:LPm1u0xBw8r8NOKoOdNMeVHSawSsltak+Ihv+etqsE8= +github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= +github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= +github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= +github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= +github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk= +github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= +github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= +github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw= +github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y= +github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= +github.com/containerd/zfs v0.0.0-20210324211415-d5c4544f0433/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= +github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= +github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= +github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= +github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= +github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= +github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= +github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= +github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= @@ -221,8 +382,10 @@ github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= github.com/cosmos/cosmos-sdk v0.44.2/go.mod h1:fwQJdw+aECatpTvQTo1tSfHEsxACdZYU80QCZUPnHr4= github.com/cosmos/cosmos-sdk v0.44.3/go.mod h1:bA3+VenaR/l/vDiYzaiwbWvRPWHMBX2jG0ygiFtiBp0= -github.com/cosmos/cosmos-sdk v0.45.9 h1:Z4s1EZL/mfM8uSSZr8WmyEbWp4hqbWVI5sAIFR432KY= -github.com/cosmos/cosmos-sdk v0.45.9/go.mod h1:Z5M4TX7PsHNHlF/1XanI2DIpORQ+Q/st7oaeufEjnvU= +github.com/cosmos/cosmos-sdk v0.44.4/go.mod h1:0QTCOkE8IWu5LZyfnbbjFjxYRIcV4pBOr7+zPpJwl58= +github.com/cosmos/cosmos-sdk v0.44.5/go.mod h1:maUA6m2TBxOJZkbwl0eRtEBgTX37kcaiOWU5t1HEGaY= +github.com/cosmos/cosmos-sdk v0.45.10 h1:YRf1N6C7OFCc8FJ5wuhcnDDySJNDn5DxSscVgbeXgz4= +github.com/cosmos/cosmos-sdk v0.45.10/go.mod h1:CbfWNs4PuxxsvRD/snQuSBDwIhtsD7rIDTVQyYMKTa0= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= @@ -232,10 +395,14 @@ github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd/go.mod h1:3xOIa github.com/cosmos/iavl v0.15.0-rc5/go.mod h1:WqoPL9yPTQ85QBMT45OOUzPxG/U/JcJoN7uMjgxke/I= github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4= github.com/cosmos/iavl v0.17.1/go.mod h1:7aisPZK8yCpQdy3PMvKeO+bhq1NwDjUwjzxwwROUxFk= +github.com/cosmos/iavl v0.17.2/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= +github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= github.com/cosmos/iavl v0.19.3 h1:cESO0OwTTxQm5rmyESKW+zESheDUYI7CcZDWWDwnuxg= github.com/cosmos/iavl v0.19.3/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/ibc-go v1.2.2 h1:bs6TZ8Es1kycIu2AHlRZ9dzJ+mveqlLN/0sjWtRH88o= github.com/cosmos/ibc-go v1.2.2/go.mod h1:XmYjsRFOs6Q9Cz+CSsX21icNoH27vQKb3squgnCOCbs= +github.com/cosmos/ibc-go/v2 v2.0.2/go.mod h1:XUmW7wmubCRhIEAGtMGS+5IjiSSmcAwihoN/yPGd6Kk= +github.com/cosmos/ibc-go/v2 v2.4.2 h1:NYAVO18/4D7HTAXvjmYlC7aNOJphjCXtKIoTG31hrWE= +github.com/cosmos/ibc-go/v2 v2.4.2/go.mod h1:NJkUbLknnld8MzeH5ihg523HuiUJaI+RLWv+wgklBos= github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= @@ -249,9 +416,14 @@ github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= +github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= +github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= +github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= +github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= github.com/daixiang0/gci v0.2.9/go.mod h1:+4dZ7TISfSmqfAGv59ePaHfNzgGtIkHAhhdKggP1JAc= github.com/danieljoos/wincred v1.0.2 h1:zf4bhty2iLuwgjgpraD2E9UbvO+fe54XXGJbOwe23fU= github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= +github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -260,6 +432,7 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/denis-tingajkin/go-header v0.4.2/go.mod h1:eLRHAVXzE5atsKAnNRDB90WHCFFnBUn4RN0nRcs1LJA= +github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.1/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= @@ -268,21 +441,35 @@ github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDm github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.0.3 h1:jh22xisGBjrEVnRZ1DVTpBVQm0Xndu8sMl0CWDzSIBI= github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= +github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= +github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= +github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= +github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= +github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= +github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac h1:opbrjaN/L8gg6Xh5D04Tem+8xVcz6ajZlGCs49mQgyg= +github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b h1:HBah4D48ypg3J7Np4N+HY/ZR76fx3HEUGxDU6Uk39oQ= github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= @@ -291,6 +478,11 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/proto v1.9.0/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25/go.mod h1:hTr8+TLQmkUkgcuh3mcr5fjrT9c64ZzsBCdCEC6UppY= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= @@ -298,21 +490,25 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/esimonov/ifshort v1.0.2/go.mod h1:yZqNJUrNn20K8Q9n2CrjTKYyVEmX209Hgu+M1LBpeZE= github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= -github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= +github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= -github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 h1:E2s37DuLxFhQDg5gKsWoLBOB0n+ZW8s599zru8FJ2/Y= github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= +github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= @@ -321,20 +517,30 @@ github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= github.com/fullstorydev/grpcurl v1.6.0/go.mod h1:ZQ+ayqbKMJNhzLmbpCiurTVlaK2M/3nqZCxaQ2Ze/sM= github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASxc7x3E= +github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-critic/go-critic v0.5.6/go.mod h1:cVjj0DfqewQVIlIAGexPCaGaZDAqGE29PYDDADIVNEo= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= +github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= @@ -349,15 +555,25 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -375,6 +591,24 @@ github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslW github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= +github.com/gobuffalo/envy v1.8.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= +github.com/gobuffalo/envy v1.9.0/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= +github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= +github.com/gobuffalo/genny v0.6.0/go.mod h1:Vigx9VDiNscYpa/LwrURqGXLSIbzTfapt9+K6gF1kTA= +github.com/gobuffalo/github_flavored_markdown v1.1.0/go.mod h1:TSpTKWcRTI0+v7W3x8dkSKMLJSUpuVitlptCkpeY8ic= +github.com/gobuffalo/helpers v0.5.0/go.mod h1:stpgxJ2C7T99NLyAxGUnYMM2zAtBk5NKQR0SIbd05j4= +github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= +github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= +github.com/gobuffalo/logger v1.0.3/go.mod h1:SoeejUwldiS7ZsyCBphOGURmWdwUFXs0J7TCjEhjKxM= +github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= +github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= +github.com/gobuffalo/plush v3.8.3+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= +github.com/gobuffalo/plushgen v0.1.2/go.mod h1:3U71v6HWZpVER1nInTXeAwdoRNsRd4W8aeIa1Lyp+Bk= +github.com/gobuffalo/tags v2.1.7+incompatible/go.mod h1:9XmhOkyaB7UzvuY4UoZO4s67q8/xRMVJEaakauVQYeY= +github.com/gobuffalo/uuid v2.0.5+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE= +github.com/gobuffalo/validate v2.0.3+incompatible/go.mod h1:N+EtDe0J8252BgfzQUChBgfd6L93m9weay53EWFVsMM= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= @@ -382,12 +616,20 @@ github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/goccy/go-yaml v1.9.4/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= +github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= +github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= +github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= +github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= +github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= +github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -454,13 +696,18 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-github/v37 v37.0.0/go.mod h1:LM7in3NmXDrX58GbEHy7FtNLbI2JijX93RnMKvWG3m4= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/goterm v0.0.0-20190703233501-fc88cf888a3f/go.mod h1:nOFQdrUlIlx6M6ODdSpBj1NVA+VgLC6kmw60mkw34H4= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -488,19 +735,25 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ= +github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gordonklaus/ineffassign v0.0.0-20210225214923-2e10b2664254/go.mod h1:M9mZEtGIsR1oDaZagNPNG9iq9n2HrhZ17dsXk73V3Lw= github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= +github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= @@ -518,6 +771,7 @@ github.com/gostaticanalysis/forcetypeassert v0.0.0-20200621232751-01d4955beaa5/g github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -544,6 +798,7 @@ github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBt github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -551,6 +806,7 @@ github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjh github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= @@ -574,6 +830,7 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 h1:uUjLpLt6bVvZ72SQc/B4dXcPBw4Vgd7soowdRl52qEM= github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87/go.mod h1:XGsKKeXxeRr95aEOgipvluMPlgjr7dGlk9ZTWOjcUcg= +github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A= github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= @@ -581,17 +838,26 @@ github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63 github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/improbable-eng/grpc-web v0.14.1 h1:NrN4PY71A6tAz2sKDvC5JCauENWp0ykG8Oq1H3cpFvw= github.com/improbable-eng/grpc-web v0.14.1/go.mod h1:zEjGHa8DAlkoOXmswrNvhUGEYQA9UI7DhrGeHR1DMGU= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -601,15 +867,22 @@ github.com/jhump/protoreflect v1.9.0/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8 github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b h1:izTof8BKh/nE1wrKOrloNA5q4odOarjf+Xpe+4qow98= github.com/jingyugao/rowserrcheck v1.1.0/go.mod h1:TOQpc2SLx6huPfoFGK3UOnEG+u02D3C1GeosjupAKCA= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= +github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/jpillora/ansi v1.0.2/go.mod h1:D2tT+6uzJvN1nBVQILYWkIdq7zG+b5gcFN5WI/VyjMY= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/jpillora/chisel v1.7.6/go.mod h1:BC2zg11mTIoyGPUjc2EkTgfz3uUUV93+K9tNYCCU/fw= +github.com/jpillora/requestlog v1.0.0/go.mod h1:HTWQb7QfDc2jtHnWe2XEIEeJB7gJPnVdpNn52HXPvy8= +github.com/jpillora/sizestr v1.0.0/go.mod h1:bUhLv4ctkknatr6gR42qPxirmd5+ds1u7mzD+MZ33f0= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -629,6 +902,8 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/julz/importas v0.0.0-20210419104244-841f0c0fe66d/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/errcheck v1.6.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -637,7 +912,9 @@ github.com/kkdai/bstream v1.0.0/go.mod h1:FDnDOHt5Yx4p3FaHcioFT0QjDOtgUpvjeZqAs+ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -650,6 +927,8 @@ github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -675,20 +954,30 @@ github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QT github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= +github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -698,30 +987,43 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= +github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-zglob v0.0.3/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= +github.com/meowgorithm/babyenv v1.3.0/go.mod h1:lwNX+J6AGBFqNrMZ2PTLkM6SO+W4X8DOg9zBDO4j3Ig= +github.com/meowgorithm/babyenv v1.3.1/go.mod h1:lwNX+J6AGBFqNrMZ2PTLkM6SO+W4X8DOg9zBDO4j3Ig= github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= github.com/mgechev/revive v1.1.1/go.mod h1:PKqk4L74K6wVNwY2b6fr+9Qqr/3hIsHVfZCJdbvozrY= +github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= +github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= +github.com/microcosm-cc/bluemonday v1.0.4/go.mod h1:8iwZnFn2CDDNZ0r6UXhF4xawGvzaqzCRa1n3/lO3W2w= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/pkcs11 v1.0.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0= +github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a/go.mod h1:v8eSC2SMp9/7FTKUncp7fH9IwPfw+ysMObcEz5FWheQ= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= +github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= +github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -735,11 +1037,19 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= +github.com/moby/sys/mount v0.3.0/go.mod h1:U2Z3ur2rXPFrFmy4q6WMwWrBOAQGYtYTRVM8BIvzbwk= +github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= +github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= +github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= +github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -754,12 +1064,24 @@ github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5/go.mod h1: github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= +github.com/muesli/gitcha v0.2.0/go.mod h1:Ri8m9TZS4+ORG4JVmVKUQcWZuxDvUW3UKxMdQfzG2zI= +github.com/muesli/go-app-paths v0.2.1/go.mod h1:SxS3Umca63pcFcLtbjVb+J0oD7cl4ixQWoBKhGEtEho= +github.com/muesli/reflow v0.1.0/go.mod h1:I9bWAt7QTg/que/qmUCJBGlj7wEq8OAFBjPNjc6xK4I= +github.com/muesli/reflow v0.2.0/go.mod h1:qT22vjVmM9MIUeLgsVYe/Ye7eZlbv9dZjL3dVhUqLX8= +github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ= +github.com/muesli/sasquatch v0.0.0-20200811221207-66979d92330a/go.mod h1:+XG0ne5zXWBTSbbe7Z3/RWxaT8PZY6zaZ1dX6KjprYY= +github.com/muesli/termenv v0.7.2/go.mod h1:ct2L5N2lmix82RaY3bMWwVu/jUFc9Ule0KGDCiKYPh8= +github.com/muesli/termenv v0.7.4/go.mod h1:pZ7qY9l3F7e5xsAOS0zCew2tME+p7bWeBkotCEcIIcc= +github.com/muesli/termenv v0.8.0/go.mod h1:kzt/D/4a88RoheZmwfqorY3A+tnsSMA9HJC/fQSFKo0= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007/go.mod h1:m2XC9Qq0AlmmVksL6FktJCdTYyLk7V3fKyp0sl1yWQo= github.com/mwitkow/go-proto-validators v0.2.0/go.mod h1:ZfA1hW+UH/2ZHOWvQ3HnQaU0DtnpXu850MZiy+YUgcc= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= @@ -771,6 +1093,7 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= +github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/neilotoole/errgroup v0.1.5/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= @@ -789,30 +1112,54 @@ github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXW github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v1.0.0-rc1.0.20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 h1:rc3tiVYb5z54aKaDfakKn0dDjIyPpTtszkjuMzyt7ec= +github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= +github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= +github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= @@ -837,11 +1184,13 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.2 h1:+jQXlF3scKIcSEKkdHzXhCTDLPFi5r1wnK6yPS+49Gw= -github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= +github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= +github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= @@ -852,6 +1201,7 @@ github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -863,10 +1213,13 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/polyfloyd/go-errorlint v0.0.0-20210722154253-910bb7978349/go.mod h1:wi9BfjxjF/bwiZ701TzmfKu6UKC357IOAtNr0Td0Lvw= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= +github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= @@ -875,6 +1228,7 @@ github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqr github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -882,10 +1236,12 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= @@ -896,10 +1252,14 @@ github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+ github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.34.0 h1:RBmGO9d/FVjqHT0yUGQwBJhkwKV+wPCn7KGpvfab0uE= github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= +github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -919,19 +1279,27 @@ github.com/quasilyte/go-ruleguard/dsl v0.3.2/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQP github.com/quasilyte/go-ruleguard/rules v0.0.0-20201231183845-9e62ed36efe1/go.mod h1:7JTjp89EGyU1d6XfBiXihJNG37wB2VRkd125Q1u7Plc= github.com/quasilyte/go-ruleguard/rules v0.0.0-20210203162857-b223e0831f88/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= +github.com/radovskyb/watcher v1.0.7/go.mod h1:78okwvY5wPdzcb1UYnip1pvrZNIVEIh/Cm+ZuvsUYIg= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rdegges/go-ipify v0.0.0-20150526035502-2d94a6a86c40/go.mod h1:j4c6zEU0eMG1oiZPUy+zD4ykX0NIpjZAEOEAviTWC18= github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= +github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.6.2 h1:aIihoIOHCiLZHxyoNQ+ABL4NKhFTgKLBdMLyEAh98m0= github.com/rogpeppe/go-internal v1.6.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= @@ -950,15 +1318,23 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/ryancurrah/gomodguard v1.2.3/go.mod h1:rYbA/4Tg5c54mV1sv4sQTP5WOPBcoLtnBZ7/TEhXAbg= github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94/go.mod h1:b18R55ulyQ/h3RaWyloPyER7fWQVZvimKKhnI5OfrJQ= +github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= +github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10= -github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxrTy6/VgfVoLuVLFJcURKLH49ie0zSch7gh4= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= +github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/securego/gosec/v2 v2.8.1/go.mod h1:pUmsq6+VyFEElJMUX+QB3p3LWNHXg1R3xh2ssVJPs8Q= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= +github.com/segmentio/ksuid v1.0.3/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= +github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= @@ -966,6 +1342,8 @@ github.com/shirou/gopsutil/v3 v3.21.7/go.mod h1:RGl11Y7XMTQPmHh8F0ayC6haKNBgH4PX github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= +github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -974,33 +1352,42 @@ github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/go-diff v0.6.1/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= +github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -1010,22 +1397,26 @@ github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/y github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= -github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= +github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU= +github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= github.com/ssgreg/nlreturn/v2 v2.1.0/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= +github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v0.0.0-20170130113145-4d4bfba8f1d1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1033,15 +1424,17 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/subosito/gotenv v1.4.0 h1:yAzM1+SmVcz5R4tXGsNMu1jUl2aOJXoiWUCEwwnGrvs= -github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= +github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= +github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= +github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= @@ -1049,22 +1442,26 @@ github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= +github.com/tendermint/flutter/v2 v2.0.1/go.mod h1:hnaVhWhzv2Od1LqZFWrRKwiOHeMonsB9EIWP0AGMPw0= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/spm v0.1.8 h1:ya0o4Um6Hht2LC1X/y0+9Rz0Q8DyUhRIIXR9vgDUTGA= github.com/tendermint/spm v0.1.8/go.mod h1:iHgfQ5YOI6ONc9E7ugGQolVdfSMHpeXfZ/OpXuN/42Q= +github.com/tendermint/spn v0.1.1-0.20211210094128-4ca78a240c57/go.mod h1:p4BO8YC6kOKSKqMfySqaLHfwBmuPE/QcLwnnVhh7H9M= +github.com/tendermint/starport v0.19.2 h1:pRN0x/GyI+gQDO0rY5KtJnvKaZL/rN1UsoofmnIbXV4= +github.com/tendermint/starport v0.19.2/go.mod h1:anz2bi+YpoEqPlTSDo0S6Qc0EEZVxPGk8bViwcr1siM= github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg= github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= github.com/tendermint/tendermint v0.34.13/go.mod h1:6RVVRBqwtKhA+H59APKumO+B7Nye4QXSFc6+TYxAxCI= github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= -github.com/tendermint/tendermint v0.34.21 h1:UiGGnBFHVrZhoQVQ7EfwSOLuCtarqCSsRf8VrklqB7s= -github.com/tendermint/tendermint v0.34.21/go.mod h1:XDvfg6U7grcFTDx7VkzxnhazQ/bspGJAn4DZ6DcLLjQ= +github.com/tendermint/tendermint v0.34.22 h1:XMhtC8s8QqJO4l/dn+TkQvevTRSow3Vixjclr41o+2Q= +github.com/tendermint/tendermint v0.34.22/go.mod h1:YpP5vBEAKUT4g6oyfjKgFeZmdB/GjkJAxfF+cgmJg6Y= github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= github.com/tendermint/tm-db v0.6.6 h1:EzhaOfR0bdKyATqcd5PNeyeq8r+V4bRPHBfyFdD9kGM= github.com/tendermint/tm-db v0.6.6/go.mod h1:wP8d49A85B7/erz/r4YbKssKw6ylsO/hKtFk7E1aWZI= +github.com/tendermint/vue v0.1.58/go.mod h1:Sg9MGPF+uY+SJ79sdZgtC2LnH+FDU2qWuiRxoZn5bmw= github.com/tetafro/godot v1.4.9/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= @@ -1092,19 +1489,31 @@ github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= +github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/uudashr/gocognit v1.0.5/go.mod h1:wgYz0mitoKOTysqxTDMOUXg+Jb5SvtihkfmugIZYpEA= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.16.0/go.mod h1:YOKImeEosDdBPnxc0gy7INqi3m1zK6A+xl6TwOBhHCA= github.com/valyala/quicktemplate v1.6.3/go.mod h1:fwPzK2fHuYEODzJ9pkw0ipCPNHZ2tD5KW4lOuSdPKzY= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE= +github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= +github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= +github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= +github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/vmihailenco/msgpack/v5 v5.1.4/go.mod h1:C5gboKD0TJPqWDTVTtrQNfRbiBwHZGo8UTqP/9/XvLI= github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= +github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= +github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -1117,7 +1526,12 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark-emoji v1.0.1/go.mod h1:2w1E6FEWLcDQkoTE+7HU6QF1F6SLlNGjRIBbIZQFqkQ= +github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= +github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= +github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -1128,10 +1542,12 @@ go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd v0.0.0-20200513171258-e048e166ab9c/go.mod h1:xCI7ZzBfRuGgBXyXO6yfWfDmlWd35khcWpUa4L0xI/k= +go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.mozilla.org/mozlog v0.0.0-20170222151521-4bb13139d403/go.mod h1:jHoPAGnDrCy6kaI2tAze5Prf0Nr0w/oNkROt2lw3n3o= +go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -1154,33 +1570,45 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180501155221-613d6eafa307/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1239,12 +1667,15 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1264,6 +1695,7 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -1316,18 +1748,27 @@ golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190530182044-ad28b68e88f1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1335,22 +1776,28 @@ golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200413165638-669c56c373c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1359,19 +1806,30 @@ golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201020230747-6e5568b54d1a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1379,6 +1837,7 @@ golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1391,13 +1850,16 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1417,6 +1879,7 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1433,12 +1896,15 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190916130336-e45ffcd953cc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1452,6 +1918,7 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191224055732-dd894d0a8a40/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1520,6 +1987,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1544,6 +2012,7 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1552,6 +2021,7 @@ google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1560,6 +2030,7 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= @@ -1570,6 +2041,7 @@ google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1593,6 +2065,7 @@ google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1607,6 +2080,8 @@ google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c h1:QgY/XxIAIeccR+Ca/rDdKubLIU9rcJ3xfy1DC/Wd2Oo= google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= @@ -1627,8 +2102,10 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1639,13 +2116,20 @@ gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= -gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= @@ -1657,6 +2141,7 @@ gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.6/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= @@ -1666,6 +2151,8 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= +gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1674,6 +2161,31 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.2.1/go.mod h1:lPVVZ2BS5TfnjLyizF7o7hv7j9/L+8cZY2hLyjP9cGY= +k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= +k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= +k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= +k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= +k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= +k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= +k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= +k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= +k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= +k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= +k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= +k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= +k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= +k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= +k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= +k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= +k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= +k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= +k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= +k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= +k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= +k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= mvdan.cc/gofumpt v0.1.1/go.mod h1:yXG1r1WqZVKWbVRtBWKWX9+CxGYfA51nSomhM0woR48= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= @@ -1683,5 +2195,10 @@ nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0 rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/testutil/network/network.go b/testutil/network/network.go index b23e0df9..5fdeef64 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -14,7 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/tendermint/spm/cosmoscmd" + "github.com/tendermint/starport/starport/pkg/cosmoscmd" tmrand "github.com/tendermint/tendermint/libs/rand" tmdb "github.com/tendermint/tm-db" diff --git a/testutil/simapp/simapp.go b/testutil/simapp/simapp.go index 7aca597e..f85bffcd 100644 --- a/testutil/simapp/simapp.go +++ b/testutil/simapp/simapp.go @@ -4,7 +4,7 @@ import ( "time" "github.com/cosmos/cosmos-sdk/simapp" - "github.com/tendermint/spm/cosmoscmd" + "github.com/tendermint/starport/starport/pkg/cosmoscmd" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 9c273513..36486b56 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -1,6 +1,4 @@ import { txClient, queryClient, MissingWalletError , registry} from './module' -// @ts-ignore -import { SpVuexError } from '@starport/vuex' import { Commit } from "./module/types/scavenge/commit" import { Scavenge } from "./module/types/scavenge/scavenge" @@ -133,7 +131,7 @@ export default { const sub=JSON.parse(subscription) await dispatch(sub.action, sub.payload) }catch(e) { - throw new SpVuexError('Subscriptions: ' + e.message) + throw new Error('Subscriptions: ' + e.message) } }) }, @@ -154,7 +152,7 @@ export default { if (subscribe) commit('SUBSCRIBE', { action: 'QueryScavenge', payload: { options: { all }, params: {...key},query }}) return getters['getScavenge']( { params: {...key}, query}) ?? {} } catch (e) { - throw new SpVuexError('QueryClient:QueryScavenge', 'API Node Unavailable. Could not perform query: ' + e.message) + throw new Error('QueryClient:QueryScavenge API Node Unavailable. Could not perform query: ' + e.message) } }, @@ -180,7 +178,7 @@ export default { if (subscribe) commit('SUBSCRIBE', { action: 'QueryScavengeAll', payload: { options: { all }, params: {...key},query }}) return getters['getScavengeAll']( { params: {...key}, query}) ?? {} } catch (e) { - throw new SpVuexError('QueryClient:QueryScavengeAll', 'API Node Unavailable. Could not perform query: ' + e.message) + throw new Error('QueryClient:QueryScavengeAll API Node Unavailable. Could not perform query: ' + e.message) } }, @@ -202,7 +200,7 @@ export default { if (subscribe) commit('SUBSCRIBE', { action: 'QueryCommit', payload: { options: { all }, params: {...key},query }}) return getters['getCommit']( { params: {...key}, query}) ?? {} } catch (e) { - throw new SpVuexError('QueryClient:QueryCommit', 'API Node Unavailable. Could not perform query: ' + e.message) + throw new Error('QueryClient:QueryCommit API Node Unavailable. Could not perform query: ' + e.message) } }, @@ -228,7 +226,7 @@ export default { if (subscribe) commit('SUBSCRIBE', { action: 'QueryCommitAll', payload: { options: { all }, params: {...key},query }}) return getters['getCommitAll']( { params: {...key}, query}) ?? {} } catch (e) { - throw new SpVuexError('QueryClient:QueryCommitAll', 'API Node Unavailable. Could not perform query: ' + e.message) + throw new Error('QueryClient:QueryCommitAll API Node Unavailable. Could not perform query: ' + e.message) } }, @@ -243,39 +241,39 @@ export default { return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgSubmitScavenge:Init', 'Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgSubmitScavenge:Send', 'Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgRevealSolution:Init', 'Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgRevealSolution:Send', 'Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCommitSolution:Init', 'Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new SpVuexError('TxClient:MsgCommitSolution:Send', 'Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -287,38 +285,35 @@ export default { return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgSubmitScavenge:Init', 'Could not initialize signing client. Wallet is required.') - }else{ - throw new SpVuexError('TxClient:MsgSubmitScavenge:Create', 'Could not create message: ' + e.message) - + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + } else{ + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, - async MsgRevealSolution({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgRevealSolution:Init', 'Could not initialize signing client. Wallet is required.') - }else{ - throw new SpVuexError('TxClient:MsgRevealSolution:Create', 'Could not create message: ' + e.message) - + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + } else{ + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new SpVuexError('TxClient:MsgCommitSolution:Init', 'Could not initialize signing client. Wallet is required.') - }else{ - throw new SpVuexError('TxClient:MsgCommitSolution:Create', 'Could not create message: ' + e.message) - + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + } else{ + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 0e8c4c98..27b7f752 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -5,14 +5,14 @@ import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; -import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; +import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -46,8 +46,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/rest.ts index cadd27c5..4ce8d5d5 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/rest.ts @@ -115,9 +115,13 @@ export interface V1Beta1PageRequest { * count_total is only respected when offset is used. It is ignored when key * is set. */ - countTotal?: boolean; + count_total?: boolean; - /** reverse is set to true if results are to be returned in the descending order. */ + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ reverse?: boolean; } @@ -132,7 +136,7 @@ corresponding request message has used PageRequest. */ export interface V1Beta1PageResponse { /** @format byte */ - nextKey?: string; + next_key?: string; /** @format uint64 */ total?: string; @@ -347,7 +351,7 @@ export class Api extends HttpClient extends HttpClient>> 3) { case 1: - message.nextKey = reader.bytes(); + message.next_key = reader.bytes(); break; case 2: message.total = longToNumber(reader.uint64() as Long); @@ -229,8 +234,8 @@ export const PageResponse = { fromJSON(object: any): PageResponse { const message = { ...basePageResponse } as PageResponse; - if (object.nextKey !== undefined && object.nextKey !== null) { - message.nextKey = bytesFromBase64(object.nextKey); + if (object.next_key !== undefined && object.next_key !== null) { + message.next_key = bytesFromBase64(object.next_key); } if (object.total !== undefined && object.total !== null) { message.total = Number(object.total); @@ -242,9 +247,9 @@ export const PageResponse = { toJSON(message: PageResponse): unknown { const obj: any = {}; - message.nextKey !== undefined && - (obj.nextKey = base64FromBytes( - message.nextKey !== undefined ? message.nextKey : new Uint8Array() + message.next_key !== undefined && + (obj.next_key = base64FromBytes( + message.next_key !== undefined ? message.next_key : new Uint8Array() )); message.total !== undefined && (obj.total = message.total); return obj; @@ -252,10 +257,10 @@ export const PageResponse = { fromPartial(object: DeepPartial): PageResponse { const message = { ...basePageResponse } as PageResponse; - if (object.nextKey !== undefined && object.nextKey !== null) { - message.nextKey = object.nextKey; + if (object.next_key !== undefined && object.next_key !== null) { + message.next_key = object.next_key; } else { - message.nextKey = new Uint8Array(); + message.next_key = new Uint8Array(); } if (object.total !== undefined && object.total !== null) { message.total = object.total; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/types/google/api/http.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/types/google/api/http.ts index ddc00f8b..ccadff68 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/types/google/api/http.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/types/google/api/http.ts @@ -23,7 +23,7 @@ export interface Http { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fullyDecodeReservedExpansion: boolean; + fully_decode_reserved_expansion: boolean; } /** @@ -281,13 +281,13 @@ export interface HttpRule { * body of response. Other response fields are ignored. When * not set, the response message will be used as HTTP body of response. */ - responseBody: string; + response_body: string; /** * Additional HTTP bindings for the selector. Nested bindings must * not contain an `additional_bindings` field themselves (that is, * the nesting may only be one level deep). */ - additionalBindings: HttpRule[]; + additional_bindings: HttpRule[]; } /** A custom pattern is used for defining custom HTTP verb. */ @@ -298,15 +298,15 @@ export interface CustomHttpPattern { path: string; } -const baseHttp: object = { fullyDecodeReservedExpansion: false }; +const baseHttp: object = { fully_decode_reserved_expansion: false }; export const Http = { encode(message: Http, writer: Writer = Writer.create()): Writer { for (const v of message.rules) { HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (message.fullyDecodeReservedExpansion === true) { - writer.uint32(16).bool(message.fullyDecodeReservedExpansion); + if (message.fully_decode_reserved_expansion === true) { + writer.uint32(16).bool(message.fully_decode_reserved_expansion); } return writer; }, @@ -323,7 +323,7 @@ export const Http = { message.rules.push(HttpRule.decode(reader, reader.uint32())); break; case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + message.fully_decode_reserved_expansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -342,14 +342,14 @@ export const Http = { } } if ( - object.fullyDecodeReservedExpansion !== undefined && - object.fullyDecodeReservedExpansion !== null + object.fully_decode_reserved_expansion !== undefined && + object.fully_decode_reserved_expansion !== null ) { - message.fullyDecodeReservedExpansion = Boolean( - object.fullyDecodeReservedExpansion + message.fully_decode_reserved_expansion = Boolean( + object.fully_decode_reserved_expansion ); } else { - message.fullyDecodeReservedExpansion = false; + message.fully_decode_reserved_expansion = false; } return message; }, @@ -363,8 +363,9 @@ export const Http = { } else { obj.rules = []; } - message.fullyDecodeReservedExpansion !== undefined && - (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); + message.fully_decode_reserved_expansion !== undefined && + (obj.fully_decode_reserved_expansion = + message.fully_decode_reserved_expansion); return obj; }, @@ -377,19 +378,19 @@ export const Http = { } } if ( - object.fullyDecodeReservedExpansion !== undefined && - object.fullyDecodeReservedExpansion !== null + object.fully_decode_reserved_expansion !== undefined && + object.fully_decode_reserved_expansion !== null ) { - message.fullyDecodeReservedExpansion = - object.fullyDecodeReservedExpansion; + message.fully_decode_reserved_expansion = + object.fully_decode_reserved_expansion; } else { - message.fullyDecodeReservedExpansion = false; + message.fully_decode_reserved_expansion = false; } return message; }, }; -const baseHttpRule: object = { selector: "", body: "", responseBody: "" }; +const baseHttpRule: object = { selector: "", body: "", response_body: "" }; export const HttpRule = { encode(message: HttpRule, writer: Writer = Writer.create()): Writer { @@ -420,10 +421,10 @@ export const HttpRule = { if (message.body !== "") { writer.uint32(58).string(message.body); } - if (message.responseBody !== "") { - writer.uint32(98).string(message.responseBody); + if (message.response_body !== "") { + writer.uint32(98).string(message.response_body); } - for (const v of message.additionalBindings) { + for (const v of message.additional_bindings) { HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); } return writer; @@ -433,7 +434,7 @@ export const HttpRule = { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseHttpRule } as HttpRule; - message.additionalBindings = []; + message.additional_bindings = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -462,10 +463,10 @@ export const HttpRule = { message.body = reader.string(); break; case 12: - message.responseBody = reader.string(); + message.response_body = reader.string(); break; case 11: - message.additionalBindings.push( + message.additional_bindings.push( HttpRule.decode(reader, reader.uint32()) ); break; @@ -479,7 +480,7 @@ export const HttpRule = { fromJSON(object: any): HttpRule { const message = { ...baseHttpRule } as HttpRule; - message.additionalBindings = []; + message.additional_bindings = []; if (object.selector !== undefined && object.selector !== null) { message.selector = String(object.selector); } else { @@ -520,17 +521,17 @@ export const HttpRule = { } else { message.body = ""; } - if (object.responseBody !== undefined && object.responseBody !== null) { - message.responseBody = String(object.responseBody); + if (object.response_body !== undefined && object.response_body !== null) { + message.response_body = String(object.response_body); } else { - message.responseBody = ""; + message.response_body = ""; } if ( - object.additionalBindings !== undefined && - object.additionalBindings !== null + object.additional_bindings !== undefined && + object.additional_bindings !== null ) { - for (const e of object.additionalBindings) { - message.additionalBindings.push(HttpRule.fromJSON(e)); + for (const e of object.additional_bindings) { + message.additional_bindings.push(HttpRule.fromJSON(e)); } } return message; @@ -549,21 +550,21 @@ export const HttpRule = { ? CustomHttpPattern.toJSON(message.custom) : undefined); message.body !== undefined && (obj.body = message.body); - message.responseBody !== undefined && - (obj.responseBody = message.responseBody); - if (message.additionalBindings) { - obj.additionalBindings = message.additionalBindings.map((e) => + message.response_body !== undefined && + (obj.response_body = message.response_body); + if (message.additional_bindings) { + obj.additional_bindings = message.additional_bindings.map((e) => e ? HttpRule.toJSON(e) : undefined ); } else { - obj.additionalBindings = []; + obj.additional_bindings = []; } return obj; }, fromPartial(object: DeepPartial): HttpRule { const message = { ...baseHttpRule } as HttpRule; - message.additionalBindings = []; + message.additional_bindings = []; if (object.selector !== undefined && object.selector !== null) { message.selector = object.selector; } else { @@ -604,17 +605,17 @@ export const HttpRule = { } else { message.body = ""; } - if (object.responseBody !== undefined && object.responseBody !== null) { - message.responseBody = object.responseBody; + if (object.response_body !== undefined && object.response_body !== null) { + message.response_body = object.response_body; } else { - message.responseBody = ""; + message.response_body = ""; } if ( - object.additionalBindings !== undefined && - object.additionalBindings !== null + object.additional_bindings !== undefined && + object.additional_bindings !== null ) { - for (const e of object.additionalBindings) { - message.additionalBindings.push(HttpRule.fromPartial(e)); + for (const e of object.additional_bindings) { + message.additional_bindings.push(HttpRule.fromPartial(e)); } } return message; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/types/google/protobuf/descriptor.ts index 9e508660..a0167cb2 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/types/google/protobuf/descriptor.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/types/google/protobuf/descriptor.ts @@ -21,15 +21,15 @@ export interface FileDescriptorProto { /** Names of files imported by this file. */ dependency: string[]; /** Indexes of the public imported files in the dependency list above. */ - publicDependency: number[]; + public_dependency: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weakDependency: number[]; + weak_dependency: number[]; /** All top-level definitions in this file. */ - messageType: DescriptorProto[]; - enumType: EnumDescriptorProto[]; + message_type: DescriptorProto[]; + enum_type: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; options: FileOptions | undefined; @@ -39,7 +39,7 @@ export interface FileDescriptorProto { * functionality of the descriptors -- the information is needed only by * development tools. */ - sourceCodeInfo: SourceCodeInfo | undefined; + source_code_info: SourceCodeInfo | undefined; /** * The syntax of the proto file. * The supported values are "proto2" and "proto3". @@ -52,17 +52,17 @@ export interface DescriptorProto { name: string; field: FieldDescriptorProto[]; extension: FieldDescriptorProto[]; - nestedType: DescriptorProto[]; - enumType: EnumDescriptorProto[]; - extensionRange: DescriptorProto_ExtensionRange[]; - oneofDecl: OneofDescriptorProto[]; + nested_type: DescriptorProto[]; + enum_type: EnumDescriptorProto[]; + extension_range: DescriptorProto_ExtensionRange[]; + oneof_decl: OneofDescriptorProto[]; options: MessageOptions | undefined; - reservedRange: DescriptorProto_ReservedRange[]; + reserved_range: DescriptorProto_ReservedRange[]; /** * Reserved field names, which may not be used by fields in the same message. * A given name may only be reserved once. */ - reservedName: string[]; + reserved_name: string[]; } export interface DescriptorProto_ExtensionRange { @@ -87,7 +87,7 @@ export interface DescriptorProto_ReservedRange { export interface ExtensionRangeOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpreted_option: UninterpretedOption[]; } /** Describes a field within a message. */ @@ -107,7 +107,7 @@ export interface FieldDescriptorProto { * message are searched, then within the parent, on up to the root * namespace). */ - typeName: string; + type_name: string; /** * For extensions, this is the name of the type being extended. It is * resolved in the same manner as type_name. @@ -120,19 +120,19 @@ export interface FieldDescriptorProto { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - defaultValue: string; + default_value: string; /** * If set, gives the index of a oneof in the containing type's oneof_decl * list. This field is a member of that oneof. */ - oneofIndex: number; + oneof_index: number; /** * JSON name of this field. The value is set by protocol compiler. If the * user has set a "json_name" option on this field, that option's value * will be used. Otherwise, it's deduced from the field's name by converting * it to camelCase. */ - jsonName: string; + json_name: string; options: FieldOptions | undefined; /** * If true, this is a proto3 "optional". When a proto3 field is optional, it @@ -157,7 +157,7 @@ export interface FieldDescriptorProto { * Proto2 optional fields do not set this flag, because they already indicate * optional with `LABEL_OPTIONAL`. */ - proto3Optional: boolean; + proto3_optional: boolean; } export enum FieldDescriptorProto_Type { @@ -373,12 +373,12 @@ export interface EnumDescriptorProto { * by enum values in the same enum declaration. Reserved ranges may not * overlap. */ - reservedRange: EnumDescriptorProto_EnumReservedRange[]; + reserved_range: EnumDescriptorProto_EnumReservedRange[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reservedName: string[]; + reserved_name: string[]; } /** @@ -417,13 +417,13 @@ export interface MethodDescriptorProto { * Input and output type names. These are resolved in the same way as * FieldDescriptorProto.type_name, but must refer to a message type. */ - inputType: string; - outputType: string; + input_type: string; + output_type: string; options: MethodOptions | undefined; /** Identifies if client streams multiple client messages */ - clientStreaming: boolean; + client_streaming: boolean; /** Identifies if server streams multiple server messages */ - serverStreaming: boolean; + server_streaming: boolean; } export interface FileOptions { @@ -433,7 +433,7 @@ export interface FileOptions { * inappropriate because proto packages do not normally start with backwards * domain names. */ - javaPackage: string; + java_package: string; /** * Controls the name of the wrapper Java class generated for the .proto file. * That class will always contain the .proto file's getDescriptor() method as @@ -441,7 +441,7 @@ export interface FileOptions { * If java_multiple_files is disabled, then all the other classes from the * .proto file will be nested inside the single wrapper outer class. */ - javaOuterClassname: string; + java_outer_classname: string; /** * If enabled, then the Java code generator will generate a separate .java * file for each top-level message, enum, and service defined in the .proto @@ -450,13 +450,13 @@ export interface FileOptions { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - javaMultipleFiles: boolean; + java_multiple_files: boolean; /** * This option does nothing. * * @deprecated */ - javaGenerateEqualsAndHash: boolean; + java_generate_equals_and_hash: boolean; /** * If set true, then the Java2 code generator will generate code that * throws an exception whenever an attempt is made to assign a non-UTF-8 @@ -465,8 +465,8 @@ export interface FileOptions { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - javaStringCheckUtf8: boolean; - optimizeFor: FileOptions_OptimizeMode; + java_string_check_utf8: boolean; + optimize_for: FileOptions_OptimizeMode; /** * Sets the Go package where structs generated from this .proto will be * placed. If omitted, the Go package will be derived from the following: @@ -474,7 +474,7 @@ export interface FileOptions { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - goPackage: string; + go_package: string; /** * Should generic services be generated in each language? "Generic" services * are not specific to any particular RPC system. They are generated by the @@ -487,10 +487,10 @@ export interface FileOptions { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - ccGenericServices: boolean; - javaGenericServices: boolean; - pyGenericServices: boolean; - phpGenericServices: boolean; + cc_generic_services: boolean; + java_generic_services: boolean; + py_generic_services: boolean; + php_generic_services: boolean; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -502,49 +502,49 @@ export interface FileOptions { * Enables the use of arenas for the proto messages in this file. This applies * only to generated classes for C++. */ - ccEnableArenas: boolean; + cc_enable_arenas: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objcClassPrefix: string; + objc_class_prefix: string; /** Namespace for generated classes; defaults to the package. */ - csharpNamespace: string; + csharp_namespace: string; /** * By default Swift generators will take the proto package and CamelCase it * replacing '.' with underscore and use that to prefix the types/symbols * defined. When this options is provided, they will use this value instead * to prefix the types/symbols defined. */ - swiftPrefix: string; + swift_prefix: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - phpClassPrefix: string; + php_class_prefix: string; /** * Use this option to change the namespace of php generated classes. Default * is empty. When this option is empty, the package name will be used for * determining the namespace. */ - phpNamespace: string; + php_namespace: string; /** * Use this option to change the namespace of php generated metadata classes. * Default is empty. When this option is empty, the proto file name will be * used for determining the namespace. */ - phpMetadataNamespace: string; + php_metadata_namespace: string; /** * Use this option to change the package of ruby generated classes. Default * is empty. When this option is not set, the package name will be used for * determining the ruby package. */ - rubyPackage: string; + ruby_package: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpreted_option: UninterpretedOption[]; } /** Generated classes can be optimized for speed or code size. */ @@ -614,13 +614,13 @@ export interface MessageOptions { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - messageSetWireFormat: boolean; + message_set_wire_format: boolean; /** * Disables the generation of the standard "descriptor()" accessor, which can * conflict with a field of the same name. This is meant to make migration * from proto1 easier; new code should avoid fields named "descriptor". */ - noStandardDescriptorAccessor: boolean; + no_standard_descriptor_accessor: boolean; /** * Is this message deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -651,9 +651,9 @@ export interface MessageOptions { * instead. The option should only be implicitly set by the proto compiler * parser. */ - mapEntry: boolean; + map_entry: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpreted_option: UninterpretedOption[]; } export interface FieldOptions { @@ -727,7 +727,7 @@ export interface FieldOptions { /** For Google-internal migration only. Do not use. */ weak: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpreted_option: UninterpretedOption[]; } export enum FieldOptions_CType { @@ -812,7 +812,7 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpreted_option: UninterpretedOption[]; } export interface EnumOptions { @@ -820,7 +820,7 @@ export interface EnumOptions { * Set this option to true to allow mapping different tag names to the same * value. */ - allowAlias: boolean; + allow_alias: boolean; /** * Is this enum deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -829,7 +829,7 @@ export interface EnumOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpreted_option: UninterpretedOption[]; } export interface EnumValueOptions { @@ -841,7 +841,7 @@ export interface EnumValueOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpreted_option: UninterpretedOption[]; } export interface ServiceOptions { @@ -853,7 +853,7 @@ export interface ServiceOptions { */ deprecated: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpreted_option: UninterpretedOption[]; } export interface MethodOptions { @@ -864,9 +864,9 @@ export interface MethodOptions { * this is a formalization for deprecating methods. */ deprecated: boolean; - idempotencyLevel: MethodOptions_IdempotencyLevel; + idempotency_level: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + uninterpreted_option: UninterpretedOption[]; } /** @@ -932,12 +932,12 @@ export interface UninterpretedOption { * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifierValue: string; - positiveIntValue: number; - negativeIntValue: number; - doubleValue: number; - stringValue: Uint8Array; - aggregateValue: string; + identifier_value: string; + positive_int_value: number; + negative_int_value: number; + double_value: number; + string_value: Uint8Array; + aggregate_value: string; } /** @@ -948,8 +948,8 @@ export interface UninterpretedOption { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { - namePart: string; - isExtension: boolean; + name_part: string; + is_extension: boolean; } /** @@ -1089,9 +1089,9 @@ export interface SourceCodeInfo_Location { * * // ignored detached comments. */ - leadingComments: string; - trailingComments: string; - leadingDetachedComments: string[]; + leading_comments: string; + trailing_comments: string; + leading_detached_comments: string[]; } /** @@ -1114,7 +1114,7 @@ export interface GeneratedCodeInfo_Annotation { */ path: number[]; /** Identifies the filesystem path to the original source .proto. */ - sourceFile: string; + source_file: string; /** * Identifies the starting offset in bytes in the generated code * that relates to the identified object. @@ -1198,8 +1198,8 @@ const baseFileDescriptorProto: object = { name: "", package: "", dependency: "", - publicDependency: 0, - weakDependency: 0, + public_dependency: 0, + weak_dependency: 0, syntax: "", }; @@ -1218,19 +1218,19 @@ export const FileDescriptorProto = { writer.uint32(26).string(v!); } writer.uint32(82).fork(); - for (const v of message.publicDependency) { + for (const v of message.public_dependency) { writer.int32(v); } writer.ldelim(); writer.uint32(90).fork(); - for (const v of message.weakDependency) { + for (const v of message.weak_dependency) { writer.int32(v); } writer.ldelim(); - for (const v of message.messageType) { + for (const v of message.message_type) { DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.enumType) { + for (const v of message.enum_type) { EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); } for (const v of message.service) { @@ -1242,9 +1242,9 @@ export const FileDescriptorProto = { if (message.options !== undefined) { FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.sourceCodeInfo !== undefined) { + if (message.source_code_info !== undefined) { SourceCodeInfo.encode( - message.sourceCodeInfo, + message.source_code_info, writer.uint32(74).fork() ).ldelim(); } @@ -1259,10 +1259,10 @@ export const FileDescriptorProto = { let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseFileDescriptorProto } as FileDescriptorProto; message.dependency = []; - message.publicDependency = []; - message.weakDependency = []; - message.messageType = []; - message.enumType = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; message.service = []; message.extension = []; while (reader.pos < end) { @@ -1281,29 +1281,29 @@ export const FileDescriptorProto = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.publicDependency.push(reader.int32()); + message.public_dependency.push(reader.int32()); } } else { - message.publicDependency.push(reader.int32()); + message.public_dependency.push(reader.int32()); } break; case 11: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.weakDependency.push(reader.int32()); + message.weak_dependency.push(reader.int32()); } } else { - message.weakDependency.push(reader.int32()); + message.weak_dependency.push(reader.int32()); } break; case 4: - message.messageType.push( + message.message_type.push( DescriptorProto.decode(reader, reader.uint32()) ); break; case 5: - message.enumType.push( + message.enum_type.push( EnumDescriptorProto.decode(reader, reader.uint32()) ); break; @@ -1321,7 +1321,7 @@ export const FileDescriptorProto = { message.options = FileOptions.decode(reader, reader.uint32()); break; case 9: - message.sourceCodeInfo = SourceCodeInfo.decode( + message.source_code_info = SourceCodeInfo.decode( reader, reader.uint32() ); @@ -1340,10 +1340,10 @@ export const FileDescriptorProto = { fromJSON(object: any): FileDescriptorProto { const message = { ...baseFileDescriptorProto } as FileDescriptorProto; message.dependency = []; - message.publicDependency = []; - message.weakDependency = []; - message.messageType = []; - message.enumType = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; message.service = []; message.extension = []; if (object.name !== undefined && object.name !== null) { @@ -1362,26 +1362,29 @@ export const FileDescriptorProto = { } } if ( - object.publicDependency !== undefined && - object.publicDependency !== null + object.public_dependency !== undefined && + object.public_dependency !== null ) { - for (const e of object.publicDependency) { - message.publicDependency.push(Number(e)); + for (const e of object.public_dependency) { + message.public_dependency.push(Number(e)); } } - if (object.weakDependency !== undefined && object.weakDependency !== null) { - for (const e of object.weakDependency) { - message.weakDependency.push(Number(e)); + if ( + object.weak_dependency !== undefined && + object.weak_dependency !== null + ) { + for (const e of object.weak_dependency) { + message.weak_dependency.push(Number(e)); } } - if (object.messageType !== undefined && object.messageType !== null) { - for (const e of object.messageType) { - message.messageType.push(DescriptorProto.fromJSON(e)); + if (object.message_type !== undefined && object.message_type !== null) { + for (const e of object.message_type) { + message.message_type.push(DescriptorProto.fromJSON(e)); } } - if (object.enumType !== undefined && object.enumType !== null) { - for (const e of object.enumType) { - message.enumType.push(EnumDescriptorProto.fromJSON(e)); + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromJSON(e)); } } if (object.service !== undefined && object.service !== null) { @@ -1399,10 +1402,15 @@ export const FileDescriptorProto = { } else { message.options = undefined; } - if (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) { - message.sourceCodeInfo = SourceCodeInfo.fromJSON(object.sourceCodeInfo); + if ( + object.source_code_info !== undefined && + object.source_code_info !== null + ) { + message.source_code_info = SourceCodeInfo.fromJSON( + object.source_code_info + ); } else { - message.sourceCodeInfo = undefined; + message.source_code_info = undefined; } if (object.syntax !== undefined && object.syntax !== null) { message.syntax = String(object.syntax); @@ -1421,29 +1429,29 @@ export const FileDescriptorProto = { } else { obj.dependency = []; } - if (message.publicDependency) { - obj.publicDependency = message.publicDependency.map((e) => e); + if (message.public_dependency) { + obj.public_dependency = message.public_dependency.map((e) => e); } else { - obj.publicDependency = []; + obj.public_dependency = []; } - if (message.weakDependency) { - obj.weakDependency = message.weakDependency.map((e) => e); + if (message.weak_dependency) { + obj.weak_dependency = message.weak_dependency.map((e) => e); } else { - obj.weakDependency = []; + obj.weak_dependency = []; } - if (message.messageType) { - obj.messageType = message.messageType.map((e) => + if (message.message_type) { + obj.message_type = message.message_type.map((e) => e ? DescriptorProto.toJSON(e) : undefined ); } else { - obj.messageType = []; + obj.message_type = []; } - if (message.enumType) { - obj.enumType = message.enumType.map((e) => + if (message.enum_type) { + obj.enum_type = message.enum_type.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined ); } else { - obj.enumType = []; + obj.enum_type = []; } if (message.service) { obj.service = message.service.map((e) => @@ -1463,9 +1471,9 @@ export const FileDescriptorProto = { (obj.options = message.options ? FileOptions.toJSON(message.options) : undefined); - message.sourceCodeInfo !== undefined && - (obj.sourceCodeInfo = message.sourceCodeInfo - ? SourceCodeInfo.toJSON(message.sourceCodeInfo) + message.source_code_info !== undefined && + (obj.source_code_info = message.source_code_info + ? SourceCodeInfo.toJSON(message.source_code_info) : undefined); message.syntax !== undefined && (obj.syntax = message.syntax); return obj; @@ -1474,10 +1482,10 @@ export const FileDescriptorProto = { fromPartial(object: DeepPartial): FileDescriptorProto { const message = { ...baseFileDescriptorProto } as FileDescriptorProto; message.dependency = []; - message.publicDependency = []; - message.weakDependency = []; - message.messageType = []; - message.enumType = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; message.service = []; message.extension = []; if (object.name !== undefined && object.name !== null) { @@ -1496,26 +1504,29 @@ export const FileDescriptorProto = { } } if ( - object.publicDependency !== undefined && - object.publicDependency !== null + object.public_dependency !== undefined && + object.public_dependency !== null ) { - for (const e of object.publicDependency) { - message.publicDependency.push(e); + for (const e of object.public_dependency) { + message.public_dependency.push(e); } } - if (object.weakDependency !== undefined && object.weakDependency !== null) { - for (const e of object.weakDependency) { - message.weakDependency.push(e); + if ( + object.weak_dependency !== undefined && + object.weak_dependency !== null + ) { + for (const e of object.weak_dependency) { + message.weak_dependency.push(e); } } - if (object.messageType !== undefined && object.messageType !== null) { - for (const e of object.messageType) { - message.messageType.push(DescriptorProto.fromPartial(e)); + if (object.message_type !== undefined && object.message_type !== null) { + for (const e of object.message_type) { + message.message_type.push(DescriptorProto.fromPartial(e)); } } - if (object.enumType !== undefined && object.enumType !== null) { - for (const e of object.enumType) { - message.enumType.push(EnumDescriptorProto.fromPartial(e)); + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromPartial(e)); } } if (object.service !== undefined && object.service !== null) { @@ -1533,12 +1544,15 @@ export const FileDescriptorProto = { } else { message.options = undefined; } - if (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) { - message.sourceCodeInfo = SourceCodeInfo.fromPartial( - object.sourceCodeInfo + if ( + object.source_code_info !== undefined && + object.source_code_info !== null + ) { + message.source_code_info = SourceCodeInfo.fromPartial( + object.source_code_info ); } else { - message.sourceCodeInfo = undefined; + message.source_code_info = undefined; } if (object.syntax !== undefined && object.syntax !== null) { message.syntax = object.syntax; @@ -1549,7 +1563,7 @@ export const FileDescriptorProto = { }, }; -const baseDescriptorProto: object = { name: "", reservedName: "" }; +const baseDescriptorProto: object = { name: "", reserved_name: "" }; export const DescriptorProto = { encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { @@ -1562,31 +1576,31 @@ export const DescriptorProto = { for (const v of message.extension) { FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); } - for (const v of message.nestedType) { + for (const v of message.nested_type) { DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.enumType) { + for (const v of message.enum_type) { EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.extensionRange) { + for (const v of message.extension_range) { DescriptorProto_ExtensionRange.encode( v!, writer.uint32(42).fork() ).ldelim(); } - for (const v of message.oneofDecl) { + for (const v of message.oneof_decl) { OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); } if (message.options !== undefined) { MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); } - for (const v of message.reservedRange) { + for (const v of message.reserved_range) { DescriptorProto_ReservedRange.encode( v!, writer.uint32(74).fork() ).ldelim(); } - for (const v of message.reservedName) { + for (const v of message.reserved_name) { writer.uint32(82).string(v!); } return writer; @@ -1598,12 +1612,12 @@ export const DescriptorProto = { const message = { ...baseDescriptorProto } as DescriptorProto; message.field = []; message.extension = []; - message.nestedType = []; - message.enumType = []; - message.extensionRange = []; - message.oneofDecl = []; - message.reservedRange = []; - message.reservedName = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1621,22 +1635,22 @@ export const DescriptorProto = { ); break; case 3: - message.nestedType.push( + message.nested_type.push( DescriptorProto.decode(reader, reader.uint32()) ); break; case 4: - message.enumType.push( + message.enum_type.push( EnumDescriptorProto.decode(reader, reader.uint32()) ); break; case 5: - message.extensionRange.push( + message.extension_range.push( DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) ); break; case 8: - message.oneofDecl.push( + message.oneof_decl.push( OneofDescriptorProto.decode(reader, reader.uint32()) ); break; @@ -1644,12 +1658,12 @@ export const DescriptorProto = { message.options = MessageOptions.decode(reader, reader.uint32()); break; case 9: - message.reservedRange.push( + message.reserved_range.push( DescriptorProto_ReservedRange.decode(reader, reader.uint32()) ); break; case 10: - message.reservedName.push(reader.string()); + message.reserved_name.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1663,12 +1677,12 @@ export const DescriptorProto = { const message = { ...baseDescriptorProto } as DescriptorProto; message.field = []; message.extension = []; - message.nestedType = []; - message.enumType = []; - message.extensionRange = []; - message.oneofDecl = []; - message.reservedRange = []; - message.reservedName = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; if (object.name !== undefined && object.name !== null) { message.name = String(object.name); } else { @@ -1684,24 +1698,29 @@ export const DescriptorProto = { message.extension.push(FieldDescriptorProto.fromJSON(e)); } } - if (object.nestedType !== undefined && object.nestedType !== null) { - for (const e of object.nestedType) { - message.nestedType.push(DescriptorProto.fromJSON(e)); + if (object.nested_type !== undefined && object.nested_type !== null) { + for (const e of object.nested_type) { + message.nested_type.push(DescriptorProto.fromJSON(e)); } } - if (object.enumType !== undefined && object.enumType !== null) { - for (const e of object.enumType) { - message.enumType.push(EnumDescriptorProto.fromJSON(e)); + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromJSON(e)); } } - if (object.extensionRange !== undefined && object.extensionRange !== null) { - for (const e of object.extensionRange) { - message.extensionRange.push(DescriptorProto_ExtensionRange.fromJSON(e)); + if ( + object.extension_range !== undefined && + object.extension_range !== null + ) { + for (const e of object.extension_range) { + message.extension_range.push( + DescriptorProto_ExtensionRange.fromJSON(e) + ); } } - if (object.oneofDecl !== undefined && object.oneofDecl !== null) { - for (const e of object.oneofDecl) { - message.oneofDecl.push(OneofDescriptorProto.fromJSON(e)); + if (object.oneof_decl !== undefined && object.oneof_decl !== null) { + for (const e of object.oneof_decl) { + message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); } } if (object.options !== undefined && object.options !== null) { @@ -1709,14 +1728,14 @@ export const DescriptorProto = { } else { message.options = undefined; } - if (object.reservedRange !== undefined && object.reservedRange !== null) { - for (const e of object.reservedRange) { - message.reservedRange.push(DescriptorProto_ReservedRange.fromJSON(e)); + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); } } - if (object.reservedName !== undefined && object.reservedName !== null) { - for (const e of object.reservedName) { - message.reservedName.push(String(e)); + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(String(e)); } } return message; @@ -1739,49 +1758,49 @@ export const DescriptorProto = { } else { obj.extension = []; } - if (message.nestedType) { - obj.nestedType = message.nestedType.map((e) => + if (message.nested_type) { + obj.nested_type = message.nested_type.map((e) => e ? DescriptorProto.toJSON(e) : undefined ); } else { - obj.nestedType = []; + obj.nested_type = []; } - if (message.enumType) { - obj.enumType = message.enumType.map((e) => + if (message.enum_type) { + obj.enum_type = message.enum_type.map((e) => e ? EnumDescriptorProto.toJSON(e) : undefined ); } else { - obj.enumType = []; + obj.enum_type = []; } - if (message.extensionRange) { - obj.extensionRange = message.extensionRange.map((e) => + if (message.extension_range) { + obj.extension_range = message.extension_range.map((e) => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined ); } else { - obj.extensionRange = []; + obj.extension_range = []; } - if (message.oneofDecl) { - obj.oneofDecl = message.oneofDecl.map((e) => + if (message.oneof_decl) { + obj.oneof_decl = message.oneof_decl.map((e) => e ? OneofDescriptorProto.toJSON(e) : undefined ); } else { - obj.oneofDecl = []; + obj.oneof_decl = []; } message.options !== undefined && (obj.options = message.options ? MessageOptions.toJSON(message.options) : undefined); - if (message.reservedRange) { - obj.reservedRange = message.reservedRange.map((e) => + if (message.reserved_range) { + obj.reserved_range = message.reserved_range.map((e) => e ? DescriptorProto_ReservedRange.toJSON(e) : undefined ); } else { - obj.reservedRange = []; + obj.reserved_range = []; } - if (message.reservedName) { - obj.reservedName = message.reservedName.map((e) => e); + if (message.reserved_name) { + obj.reserved_name = message.reserved_name.map((e) => e); } else { - obj.reservedName = []; + obj.reserved_name = []; } return obj; }, @@ -1790,12 +1809,12 @@ export const DescriptorProto = { const message = { ...baseDescriptorProto } as DescriptorProto; message.field = []; message.extension = []; - message.nestedType = []; - message.enumType = []; - message.extensionRange = []; - message.oneofDecl = []; - message.reservedRange = []; - message.reservedName = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; if (object.name !== undefined && object.name !== null) { message.name = object.name; } else { @@ -1811,26 +1830,29 @@ export const DescriptorProto = { message.extension.push(FieldDescriptorProto.fromPartial(e)); } } - if (object.nestedType !== undefined && object.nestedType !== null) { - for (const e of object.nestedType) { - message.nestedType.push(DescriptorProto.fromPartial(e)); + if (object.nested_type !== undefined && object.nested_type !== null) { + for (const e of object.nested_type) { + message.nested_type.push(DescriptorProto.fromPartial(e)); } } - if (object.enumType !== undefined && object.enumType !== null) { - for (const e of object.enumType) { - message.enumType.push(EnumDescriptorProto.fromPartial(e)); + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromPartial(e)); } } - if (object.extensionRange !== undefined && object.extensionRange !== null) { - for (const e of object.extensionRange) { - message.extensionRange.push( + if ( + object.extension_range !== undefined && + object.extension_range !== null + ) { + for (const e of object.extension_range) { + message.extension_range.push( DescriptorProto_ExtensionRange.fromPartial(e) ); } } - if (object.oneofDecl !== undefined && object.oneofDecl !== null) { - for (const e of object.oneofDecl) { - message.oneofDecl.push(OneofDescriptorProto.fromPartial(e)); + if (object.oneof_decl !== undefined && object.oneof_decl !== null) { + for (const e of object.oneof_decl) { + message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); } } if (object.options !== undefined && object.options !== null) { @@ -1838,16 +1860,16 @@ export const DescriptorProto = { } else { message.options = undefined; } - if (object.reservedRange !== undefined && object.reservedRange !== null) { - for (const e of object.reservedRange) { - message.reservedRange.push( + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( DescriptorProto_ReservedRange.fromPartial(e) ); } } - if (object.reservedName !== undefined && object.reservedName !== null) { - for (const e of object.reservedName) { - message.reservedName.push(e); + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(e); } } return message; @@ -2059,7 +2081,7 @@ export const ExtensionRangeOptions = { message: ExtensionRangeOptions, writer: Writer = Writer.create() ): Writer { - for (const v of message.uninterpretedOption) { + for (const v of message.uninterpreted_option) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; @@ -2069,12 +2091,12 @@ export const ExtensionRangeOptions = { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpretedOption.push( + message.uninterpreted_option.push( UninterpretedOption.decode(reader, reader.uint32()) ); break; @@ -2088,13 +2110,13 @@ export const ExtensionRangeOptions = { fromJSON(object: any): ExtensionRangeOptions { const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); } } return message; @@ -2102,12 +2124,12 @@ export const ExtensionRangeOptions = { toJSON(message: ExtensionRangeOptions): unknown { const obj: any = {}; - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => e ? UninterpretedOption.toJSON(e) : undefined ); } else { - obj.uninterpretedOption = []; + obj.uninterpreted_option = []; } return obj; }, @@ -2116,13 +2138,13 @@ export const ExtensionRangeOptions = { object: DeepPartial ): ExtensionRangeOptions { const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); } } return message; @@ -2134,12 +2156,12 @@ const baseFieldDescriptorProto: object = { number: 0, label: 1, type: 1, - typeName: "", + type_name: "", extendee: "", - defaultValue: "", - oneofIndex: 0, - jsonName: "", - proto3Optional: false, + default_value: "", + oneof_index: 0, + json_name: "", + proto3_optional: false, }; export const FieldDescriptorProto = { @@ -2159,26 +2181,26 @@ export const FieldDescriptorProto = { if (message.type !== 1) { writer.uint32(40).int32(message.type); } - if (message.typeName !== "") { - writer.uint32(50).string(message.typeName); + if (message.type_name !== "") { + writer.uint32(50).string(message.type_name); } if (message.extendee !== "") { writer.uint32(18).string(message.extendee); } - if (message.defaultValue !== "") { - writer.uint32(58).string(message.defaultValue); + if (message.default_value !== "") { + writer.uint32(58).string(message.default_value); } - if (message.oneofIndex !== 0) { - writer.uint32(72).int32(message.oneofIndex); + if (message.oneof_index !== 0) { + writer.uint32(72).int32(message.oneof_index); } - if (message.jsonName !== "") { - writer.uint32(82).string(message.jsonName); + if (message.json_name !== "") { + writer.uint32(82).string(message.json_name); } if (message.options !== undefined) { FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); } - if (message.proto3Optional === true) { - writer.uint32(136).bool(message.proto3Optional); + if (message.proto3_optional === true) { + writer.uint32(136).bool(message.proto3_optional); } return writer; }, @@ -2203,25 +2225,25 @@ export const FieldDescriptorProto = { message.type = reader.int32() as any; break; case 6: - message.typeName = reader.string(); + message.type_name = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: - message.defaultValue = reader.string(); + message.default_value = reader.string(); break; case 9: - message.oneofIndex = reader.int32(); + message.oneof_index = reader.int32(); break; case 10: - message.jsonName = reader.string(); + message.json_name = reader.string(); break; case 8: message.options = FieldOptions.decode(reader, reader.uint32()); break; case 17: - message.proto3Optional = reader.bool(); + message.proto3_optional = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2253,40 +2275,43 @@ export const FieldDescriptorProto = { } else { message.type = 1; } - if (object.typeName !== undefined && object.typeName !== null) { - message.typeName = String(object.typeName); + if (object.type_name !== undefined && object.type_name !== null) { + message.type_name = String(object.type_name); } else { - message.typeName = ""; + message.type_name = ""; } if (object.extendee !== undefined && object.extendee !== null) { message.extendee = String(object.extendee); } else { message.extendee = ""; } - if (object.defaultValue !== undefined && object.defaultValue !== null) { - message.defaultValue = String(object.defaultValue); + if (object.default_value !== undefined && object.default_value !== null) { + message.default_value = String(object.default_value); } else { - message.defaultValue = ""; + message.default_value = ""; } - if (object.oneofIndex !== undefined && object.oneofIndex !== null) { - message.oneofIndex = Number(object.oneofIndex); + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneof_index = Number(object.oneof_index); } else { - message.oneofIndex = 0; + message.oneof_index = 0; } - if (object.jsonName !== undefined && object.jsonName !== null) { - message.jsonName = String(object.jsonName); + if (object.json_name !== undefined && object.json_name !== null) { + message.json_name = String(object.json_name); } else { - message.jsonName = ""; + message.json_name = ""; } if (object.options !== undefined && object.options !== null) { message.options = FieldOptions.fromJSON(object.options); } else { message.options = undefined; } - if (object.proto3Optional !== undefined && object.proto3Optional !== null) { - message.proto3Optional = Boolean(object.proto3Optional); + if ( + object.proto3_optional !== undefined && + object.proto3_optional !== null + ) { + message.proto3_optional = Boolean(object.proto3_optional); } else { - message.proto3Optional = false; + message.proto3_optional = false; } return message; }, @@ -2299,18 +2324,19 @@ export const FieldDescriptorProto = { (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); message.type !== undefined && (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.typeName !== undefined && (obj.typeName = message.typeName); + message.type_name !== undefined && (obj.type_name = message.type_name); message.extendee !== undefined && (obj.extendee = message.extendee); - message.defaultValue !== undefined && - (obj.defaultValue = message.defaultValue); - message.oneofIndex !== undefined && (obj.oneofIndex = message.oneofIndex); - message.jsonName !== undefined && (obj.jsonName = message.jsonName); + message.default_value !== undefined && + (obj.default_value = message.default_value); + message.oneof_index !== undefined && + (obj.oneof_index = message.oneof_index); + message.json_name !== undefined && (obj.json_name = message.json_name); message.options !== undefined && (obj.options = message.options ? FieldOptions.toJSON(message.options) : undefined); - message.proto3Optional !== undefined && - (obj.proto3Optional = message.proto3Optional); + message.proto3_optional !== undefined && + (obj.proto3_optional = message.proto3_optional); return obj; }, @@ -2336,40 +2362,43 @@ export const FieldDescriptorProto = { } else { message.type = 1; } - if (object.typeName !== undefined && object.typeName !== null) { - message.typeName = object.typeName; + if (object.type_name !== undefined && object.type_name !== null) { + message.type_name = object.type_name; } else { - message.typeName = ""; + message.type_name = ""; } if (object.extendee !== undefined && object.extendee !== null) { message.extendee = object.extendee; } else { message.extendee = ""; } - if (object.defaultValue !== undefined && object.defaultValue !== null) { - message.defaultValue = object.defaultValue; + if (object.default_value !== undefined && object.default_value !== null) { + message.default_value = object.default_value; } else { - message.defaultValue = ""; + message.default_value = ""; } - if (object.oneofIndex !== undefined && object.oneofIndex !== null) { - message.oneofIndex = object.oneofIndex; + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneof_index = object.oneof_index; } else { - message.oneofIndex = 0; + message.oneof_index = 0; } - if (object.jsonName !== undefined && object.jsonName !== null) { - message.jsonName = object.jsonName; + if (object.json_name !== undefined && object.json_name !== null) { + message.json_name = object.json_name; } else { - message.jsonName = ""; + message.json_name = ""; } if (object.options !== undefined && object.options !== null) { message.options = FieldOptions.fromPartial(object.options); } else { message.options = undefined; } - if (object.proto3Optional !== undefined && object.proto3Optional !== null) { - message.proto3Optional = object.proto3Optional; + if ( + object.proto3_optional !== undefined && + object.proto3_optional !== null + ) { + message.proto3_optional = object.proto3_optional; } else { - message.proto3Optional = false; + message.proto3_optional = false; } return message; }, @@ -2453,7 +2482,7 @@ export const OneofDescriptorProto = { }, }; -const baseEnumDescriptorProto: object = { name: "", reservedName: "" }; +const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; export const EnumDescriptorProto = { encode( @@ -2469,13 +2498,13 @@ export const EnumDescriptorProto = { if (message.options !== undefined) { EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); } - for (const v of message.reservedRange) { + for (const v of message.reserved_range) { EnumDescriptorProto_EnumReservedRange.encode( v!, writer.uint32(34).fork() ).ldelim(); } - for (const v of message.reservedName) { + for (const v of message.reserved_name) { writer.uint32(42).string(v!); } return writer; @@ -2486,8 +2515,8 @@ export const EnumDescriptorProto = { let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; message.value = []; - message.reservedRange = []; - message.reservedName = []; + message.reserved_range = []; + message.reserved_name = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2503,7 +2532,7 @@ export const EnumDescriptorProto = { message.options = EnumOptions.decode(reader, reader.uint32()); break; case 4: - message.reservedRange.push( + message.reserved_range.push( EnumDescriptorProto_EnumReservedRange.decode( reader, reader.uint32() @@ -2511,7 +2540,7 @@ export const EnumDescriptorProto = { ); break; case 5: - message.reservedName.push(reader.string()); + message.reserved_name.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2524,8 +2553,8 @@ export const EnumDescriptorProto = { fromJSON(object: any): EnumDescriptorProto { const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; message.value = []; - message.reservedRange = []; - message.reservedName = []; + message.reserved_range = []; + message.reserved_name = []; if (object.name !== undefined && object.name !== null) { message.name = String(object.name); } else { @@ -2541,16 +2570,16 @@ export const EnumDescriptorProto = { } else { message.options = undefined; } - if (object.reservedRange !== undefined && object.reservedRange !== null) { - for (const e of object.reservedRange) { - message.reservedRange.push( + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( EnumDescriptorProto_EnumReservedRange.fromJSON(e) ); } } - if (object.reservedName !== undefined && object.reservedName !== null) { - for (const e of object.reservedName) { - message.reservedName.push(String(e)); + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(String(e)); } } return message; @@ -2570,17 +2599,17 @@ export const EnumDescriptorProto = { (obj.options = message.options ? EnumOptions.toJSON(message.options) : undefined); - if (message.reservedRange) { - obj.reservedRange = message.reservedRange.map((e) => + if (message.reserved_range) { + obj.reserved_range = message.reserved_range.map((e) => e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined ); } else { - obj.reservedRange = []; + obj.reserved_range = []; } - if (message.reservedName) { - obj.reservedName = message.reservedName.map((e) => e); + if (message.reserved_name) { + obj.reserved_name = message.reserved_name.map((e) => e); } else { - obj.reservedName = []; + obj.reserved_name = []; } return obj; }, @@ -2588,8 +2617,8 @@ export const EnumDescriptorProto = { fromPartial(object: DeepPartial): EnumDescriptorProto { const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; message.value = []; - message.reservedRange = []; - message.reservedName = []; + message.reserved_range = []; + message.reserved_name = []; if (object.name !== undefined && object.name !== null) { message.name = object.name; } else { @@ -2605,16 +2634,16 @@ export const EnumDescriptorProto = { } else { message.options = undefined; } - if (object.reservedRange !== undefined && object.reservedRange !== null) { - for (const e of object.reservedRange) { - message.reservedRange.push( + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( EnumDescriptorProto_EnumReservedRange.fromPartial(e) ); } } - if (object.reservedName !== undefined && object.reservedName !== null) { - for (const e of object.reservedName) { - message.reservedName.push(e); + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(e); } } return message; @@ -2926,10 +2955,10 @@ export const ServiceDescriptorProto = { const baseMethodDescriptorProto: object = { name: "", - inputType: "", - outputType: "", - clientStreaming: false, - serverStreaming: false, + input_type: "", + output_type: "", + client_streaming: false, + server_streaming: false, }; export const MethodDescriptorProto = { @@ -2940,20 +2969,20 @@ export const MethodDescriptorProto = { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.inputType !== "") { - writer.uint32(18).string(message.inputType); + if (message.input_type !== "") { + writer.uint32(18).string(message.input_type); } - if (message.outputType !== "") { - writer.uint32(26).string(message.outputType); + if (message.output_type !== "") { + writer.uint32(26).string(message.output_type); } if (message.options !== undefined) { MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); } - if (message.clientStreaming === true) { - writer.uint32(40).bool(message.clientStreaming); + if (message.client_streaming === true) { + writer.uint32(40).bool(message.client_streaming); } - if (message.serverStreaming === true) { - writer.uint32(48).bool(message.serverStreaming); + if (message.server_streaming === true) { + writer.uint32(48).bool(message.server_streaming); } return writer; }, @@ -2969,19 +2998,19 @@ export const MethodDescriptorProto = { message.name = reader.string(); break; case 2: - message.inputType = reader.string(); + message.input_type = reader.string(); break; case 3: - message.outputType = reader.string(); + message.output_type = reader.string(); break; case 4: message.options = MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.clientStreaming = reader.bool(); + message.client_streaming = reader.bool(); break; case 6: - message.serverStreaming = reader.bool(); + message.server_streaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -2998,15 +3027,15 @@ export const MethodDescriptorProto = { } else { message.name = ""; } - if (object.inputType !== undefined && object.inputType !== null) { - message.inputType = String(object.inputType); + if (object.input_type !== undefined && object.input_type !== null) { + message.input_type = String(object.input_type); } else { - message.inputType = ""; + message.input_type = ""; } - if (object.outputType !== undefined && object.outputType !== null) { - message.outputType = String(object.outputType); + if (object.output_type !== undefined && object.output_type !== null) { + message.output_type = String(object.output_type); } else { - message.outputType = ""; + message.output_type = ""; } if (object.options !== undefined && object.options !== null) { message.options = MethodOptions.fromJSON(object.options); @@ -3014,20 +3043,20 @@ export const MethodDescriptorProto = { message.options = undefined; } if ( - object.clientStreaming !== undefined && - object.clientStreaming !== null + object.client_streaming !== undefined && + object.client_streaming !== null ) { - message.clientStreaming = Boolean(object.clientStreaming); + message.client_streaming = Boolean(object.client_streaming); } else { - message.clientStreaming = false; + message.client_streaming = false; } if ( - object.serverStreaming !== undefined && - object.serverStreaming !== null + object.server_streaming !== undefined && + object.server_streaming !== null ) { - message.serverStreaming = Boolean(object.serverStreaming); + message.server_streaming = Boolean(object.server_streaming); } else { - message.serverStreaming = false; + message.server_streaming = false; } return message; }, @@ -3035,16 +3064,17 @@ export const MethodDescriptorProto = { toJSON(message: MethodDescriptorProto): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.inputType !== undefined && (obj.inputType = message.inputType); - message.outputType !== undefined && (obj.outputType = message.outputType); + message.input_type !== undefined && (obj.input_type = message.input_type); + message.output_type !== undefined && + (obj.output_type = message.output_type); message.options !== undefined && (obj.options = message.options ? MethodOptions.toJSON(message.options) : undefined); - message.clientStreaming !== undefined && - (obj.clientStreaming = message.clientStreaming); - message.serverStreaming !== undefined && - (obj.serverStreaming = message.serverStreaming); + message.client_streaming !== undefined && + (obj.client_streaming = message.client_streaming); + message.server_streaming !== undefined && + (obj.server_streaming = message.server_streaming); return obj; }, @@ -3057,15 +3087,15 @@ export const MethodDescriptorProto = { } else { message.name = ""; } - if (object.inputType !== undefined && object.inputType !== null) { - message.inputType = object.inputType; + if (object.input_type !== undefined && object.input_type !== null) { + message.input_type = object.input_type; } else { - message.inputType = ""; + message.input_type = ""; } - if (object.outputType !== undefined && object.outputType !== null) { - message.outputType = object.outputType; + if (object.output_type !== undefined && object.output_type !== null) { + message.output_type = object.output_type; } else { - message.outputType = ""; + message.output_type = ""; } if (object.options !== undefined && object.options !== null) { message.options = MethodOptions.fromPartial(object.options); @@ -3073,111 +3103,111 @@ export const MethodDescriptorProto = { message.options = undefined; } if ( - object.clientStreaming !== undefined && - object.clientStreaming !== null + object.client_streaming !== undefined && + object.client_streaming !== null ) { - message.clientStreaming = object.clientStreaming; + message.client_streaming = object.client_streaming; } else { - message.clientStreaming = false; + message.client_streaming = false; } if ( - object.serverStreaming !== undefined && - object.serverStreaming !== null + object.server_streaming !== undefined && + object.server_streaming !== null ) { - message.serverStreaming = object.serverStreaming; + message.server_streaming = object.server_streaming; } else { - message.serverStreaming = false; + message.server_streaming = false; } return message; }, }; const baseFileOptions: object = { - javaPackage: "", - javaOuterClassname: "", - javaMultipleFiles: false, - javaGenerateEqualsAndHash: false, - javaStringCheckUtf8: false, - optimizeFor: 1, - goPackage: "", - ccGenericServices: false, - javaGenericServices: false, - pyGenericServices: false, - phpGenericServices: false, + java_package: "", + java_outer_classname: "", + java_multiple_files: false, + java_generate_equals_and_hash: false, + java_string_check_utf8: false, + optimize_for: 1, + go_package: "", + cc_generic_services: false, + java_generic_services: false, + py_generic_services: false, + php_generic_services: false, deprecated: false, - ccEnableArenas: false, - objcClassPrefix: "", - csharpNamespace: "", - swiftPrefix: "", - phpClassPrefix: "", - phpNamespace: "", - phpMetadataNamespace: "", - rubyPackage: "", + cc_enable_arenas: false, + objc_class_prefix: "", + csharp_namespace: "", + swift_prefix: "", + php_class_prefix: "", + php_namespace: "", + php_metadata_namespace: "", + ruby_package: "", }; export const FileOptions = { encode(message: FileOptions, writer: Writer = Writer.create()): Writer { - if (message.javaPackage !== "") { - writer.uint32(10).string(message.javaPackage); + if (message.java_package !== "") { + writer.uint32(10).string(message.java_package); } - if (message.javaOuterClassname !== "") { - writer.uint32(66).string(message.javaOuterClassname); + if (message.java_outer_classname !== "") { + writer.uint32(66).string(message.java_outer_classname); } - if (message.javaMultipleFiles === true) { - writer.uint32(80).bool(message.javaMultipleFiles); + if (message.java_multiple_files === true) { + writer.uint32(80).bool(message.java_multiple_files); } - if (message.javaGenerateEqualsAndHash === true) { - writer.uint32(160).bool(message.javaGenerateEqualsAndHash); + if (message.java_generate_equals_and_hash === true) { + writer.uint32(160).bool(message.java_generate_equals_and_hash); } - if (message.javaStringCheckUtf8 === true) { - writer.uint32(216).bool(message.javaStringCheckUtf8); + if (message.java_string_check_utf8 === true) { + writer.uint32(216).bool(message.java_string_check_utf8); } - if (message.optimizeFor !== 1) { - writer.uint32(72).int32(message.optimizeFor); + if (message.optimize_for !== 1) { + writer.uint32(72).int32(message.optimize_for); } - if (message.goPackage !== "") { - writer.uint32(90).string(message.goPackage); + if (message.go_package !== "") { + writer.uint32(90).string(message.go_package); } - if (message.ccGenericServices === true) { - writer.uint32(128).bool(message.ccGenericServices); + if (message.cc_generic_services === true) { + writer.uint32(128).bool(message.cc_generic_services); } - if (message.javaGenericServices === true) { - writer.uint32(136).bool(message.javaGenericServices); + if (message.java_generic_services === true) { + writer.uint32(136).bool(message.java_generic_services); } - if (message.pyGenericServices === true) { - writer.uint32(144).bool(message.pyGenericServices); + if (message.py_generic_services === true) { + writer.uint32(144).bool(message.py_generic_services); } - if (message.phpGenericServices === true) { - writer.uint32(336).bool(message.phpGenericServices); + if (message.php_generic_services === true) { + writer.uint32(336).bool(message.php_generic_services); } if (message.deprecated === true) { writer.uint32(184).bool(message.deprecated); } - if (message.ccEnableArenas === true) { - writer.uint32(248).bool(message.ccEnableArenas); + if (message.cc_enable_arenas === true) { + writer.uint32(248).bool(message.cc_enable_arenas); } - if (message.objcClassPrefix !== "") { - writer.uint32(290).string(message.objcClassPrefix); + if (message.objc_class_prefix !== "") { + writer.uint32(290).string(message.objc_class_prefix); } - if (message.csharpNamespace !== "") { - writer.uint32(298).string(message.csharpNamespace); + if (message.csharp_namespace !== "") { + writer.uint32(298).string(message.csharp_namespace); } - if (message.swiftPrefix !== "") { - writer.uint32(314).string(message.swiftPrefix); + if (message.swift_prefix !== "") { + writer.uint32(314).string(message.swift_prefix); } - if (message.phpClassPrefix !== "") { - writer.uint32(322).string(message.phpClassPrefix); + if (message.php_class_prefix !== "") { + writer.uint32(322).string(message.php_class_prefix); } - if (message.phpNamespace !== "") { - writer.uint32(330).string(message.phpNamespace); + if (message.php_namespace !== "") { + writer.uint32(330).string(message.php_namespace); } - if (message.phpMetadataNamespace !== "") { - writer.uint32(354).string(message.phpMetadataNamespace); + if (message.php_metadata_namespace !== "") { + writer.uint32(354).string(message.php_metadata_namespace); } - if (message.rubyPackage !== "") { - writer.uint32(362).string(message.rubyPackage); + if (message.ruby_package !== "") { + writer.uint32(362).string(message.ruby_package); } - for (const v of message.uninterpretedOption) { + for (const v of message.uninterpreted_option) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; @@ -3187,72 +3217,72 @@ export const FileOptions = { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseFileOptions } as FileOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.javaPackage = reader.string(); + message.java_package = reader.string(); break; case 8: - message.javaOuterClassname = reader.string(); + message.java_outer_classname = reader.string(); break; case 10: - message.javaMultipleFiles = reader.bool(); + message.java_multiple_files = reader.bool(); break; case 20: - message.javaGenerateEqualsAndHash = reader.bool(); + message.java_generate_equals_and_hash = reader.bool(); break; case 27: - message.javaStringCheckUtf8 = reader.bool(); + message.java_string_check_utf8 = reader.bool(); break; case 9: - message.optimizeFor = reader.int32() as any; + message.optimize_for = reader.int32() as any; break; case 11: - message.goPackage = reader.string(); + message.go_package = reader.string(); break; case 16: - message.ccGenericServices = reader.bool(); + message.cc_generic_services = reader.bool(); break; case 17: - message.javaGenericServices = reader.bool(); + message.java_generic_services = reader.bool(); break; case 18: - message.pyGenericServices = reader.bool(); + message.py_generic_services = reader.bool(); break; case 42: - message.phpGenericServices = reader.bool(); + message.php_generic_services = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: - message.ccEnableArenas = reader.bool(); + message.cc_enable_arenas = reader.bool(); break; case 36: - message.objcClassPrefix = reader.string(); + message.objc_class_prefix = reader.string(); break; case 37: - message.csharpNamespace = reader.string(); + message.csharp_namespace = reader.string(); break; case 39: - message.swiftPrefix = reader.string(); + message.swift_prefix = reader.string(); break; case 40: - message.phpClassPrefix = reader.string(); + message.php_class_prefix = reader.string(); break; case 41: - message.phpNamespace = reader.string(); + message.php_namespace = reader.string(); break; case 44: - message.phpMetadataNamespace = reader.string(); + message.php_metadata_namespace = reader.string(); break; case 45: - message.rubyPackage = reader.string(); + message.ruby_package = reader.string(); break; case 999: - message.uninterpretedOption.push( + message.uninterpreted_option.push( UninterpretedOption.decode(reader, reader.uint32()) ); break; @@ -3266,150 +3296,156 @@ export const FileOptions = { fromJSON(object: any): FileOptions { const message = { ...baseFileOptions } as FileOptions; - message.uninterpretedOption = []; - if (object.javaPackage !== undefined && object.javaPackage !== null) { - message.javaPackage = String(object.javaPackage); + message.uninterpreted_option = []; + if (object.java_package !== undefined && object.java_package !== null) { + message.java_package = String(object.java_package); } else { - message.javaPackage = ""; + message.java_package = ""; } if ( - object.javaOuterClassname !== undefined && - object.javaOuterClassname !== null + object.java_outer_classname !== undefined && + object.java_outer_classname !== null ) { - message.javaOuterClassname = String(object.javaOuterClassname); + message.java_outer_classname = String(object.java_outer_classname); } else { - message.javaOuterClassname = ""; + message.java_outer_classname = ""; } if ( - object.javaMultipleFiles !== undefined && - object.javaMultipleFiles !== null + object.java_multiple_files !== undefined && + object.java_multiple_files !== null ) { - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + message.java_multiple_files = Boolean(object.java_multiple_files); } else { - message.javaMultipleFiles = false; + message.java_multiple_files = false; } if ( - object.javaGenerateEqualsAndHash !== undefined && - object.javaGenerateEqualsAndHash !== null + object.java_generate_equals_and_hash !== undefined && + object.java_generate_equals_and_hash !== null ) { - message.javaGenerateEqualsAndHash = Boolean( - object.javaGenerateEqualsAndHash + message.java_generate_equals_and_hash = Boolean( + object.java_generate_equals_and_hash ); } else { - message.javaGenerateEqualsAndHash = false; + message.java_generate_equals_and_hash = false; } if ( - object.javaStringCheckUtf8 !== undefined && - object.javaStringCheckUtf8 !== null + object.java_string_check_utf8 !== undefined && + object.java_string_check_utf8 !== null ) { - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); } else { - message.javaStringCheckUtf8 = false; + message.java_string_check_utf8 = false; } - if (object.optimizeFor !== undefined && object.optimizeFor !== null) { - message.optimizeFor = fileOptions_OptimizeModeFromJSON( - object.optimizeFor + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimize_for = fileOptions_OptimizeModeFromJSON( + object.optimize_for ); } else { - message.optimizeFor = 1; + message.optimize_for = 1; } - if (object.goPackage !== undefined && object.goPackage !== null) { - message.goPackage = String(object.goPackage); + if (object.go_package !== undefined && object.go_package !== null) { + message.go_package = String(object.go_package); } else { - message.goPackage = ""; + message.go_package = ""; } if ( - object.ccGenericServices !== undefined && - object.ccGenericServices !== null + object.cc_generic_services !== undefined && + object.cc_generic_services !== null ) { - message.ccGenericServices = Boolean(object.ccGenericServices); + message.cc_generic_services = Boolean(object.cc_generic_services); } else { - message.ccGenericServices = false; + message.cc_generic_services = false; } if ( - object.javaGenericServices !== undefined && - object.javaGenericServices !== null + object.java_generic_services !== undefined && + object.java_generic_services !== null ) { - message.javaGenericServices = Boolean(object.javaGenericServices); + message.java_generic_services = Boolean(object.java_generic_services); } else { - message.javaGenericServices = false; + message.java_generic_services = false; } if ( - object.pyGenericServices !== undefined && - object.pyGenericServices !== null + object.py_generic_services !== undefined && + object.py_generic_services !== null ) { - message.pyGenericServices = Boolean(object.pyGenericServices); + message.py_generic_services = Boolean(object.py_generic_services); } else { - message.pyGenericServices = false; + message.py_generic_services = false; } if ( - object.phpGenericServices !== undefined && - object.phpGenericServices !== null + object.php_generic_services !== undefined && + object.php_generic_services !== null ) { - message.phpGenericServices = Boolean(object.phpGenericServices); + message.php_generic_services = Boolean(object.php_generic_services); } else { - message.phpGenericServices = false; + message.php_generic_services = false; } if (object.deprecated !== undefined && object.deprecated !== null) { message.deprecated = Boolean(object.deprecated); } else { message.deprecated = false; } - if (object.ccEnableArenas !== undefined && object.ccEnableArenas !== null) { - message.ccEnableArenas = Boolean(object.ccEnableArenas); + if ( + object.cc_enable_arenas !== undefined && + object.cc_enable_arenas !== null + ) { + message.cc_enable_arenas = Boolean(object.cc_enable_arenas); } else { - message.ccEnableArenas = false; + message.cc_enable_arenas = false; } if ( - object.objcClassPrefix !== undefined && - object.objcClassPrefix !== null + object.objc_class_prefix !== undefined && + object.objc_class_prefix !== null ) { - message.objcClassPrefix = String(object.objcClassPrefix); + message.objc_class_prefix = String(object.objc_class_prefix); } else { - message.objcClassPrefix = ""; + message.objc_class_prefix = ""; } if ( - object.csharpNamespace !== undefined && - object.csharpNamespace !== null + object.csharp_namespace !== undefined && + object.csharp_namespace !== null ) { - message.csharpNamespace = String(object.csharpNamespace); + message.csharp_namespace = String(object.csharp_namespace); } else { - message.csharpNamespace = ""; + message.csharp_namespace = ""; } - if (object.swiftPrefix !== undefined && object.swiftPrefix !== null) { - message.swiftPrefix = String(object.swiftPrefix); + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swift_prefix = String(object.swift_prefix); } else { - message.swiftPrefix = ""; + message.swift_prefix = ""; } - if (object.phpClassPrefix !== undefined && object.phpClassPrefix !== null) { - message.phpClassPrefix = String(object.phpClassPrefix); + if ( + object.php_class_prefix !== undefined && + object.php_class_prefix !== null + ) { + message.php_class_prefix = String(object.php_class_prefix); } else { - message.phpClassPrefix = ""; + message.php_class_prefix = ""; } - if (object.phpNamespace !== undefined && object.phpNamespace !== null) { - message.phpNamespace = String(object.phpNamespace); + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.php_namespace = String(object.php_namespace); } else { - message.phpNamespace = ""; + message.php_namespace = ""; } if ( - object.phpMetadataNamespace !== undefined && - object.phpMetadataNamespace !== null + object.php_metadata_namespace !== undefined && + object.php_metadata_namespace !== null ) { - message.phpMetadataNamespace = String(object.phpMetadataNamespace); + message.php_metadata_namespace = String(object.php_metadata_namespace); } else { - message.phpMetadataNamespace = ""; + message.php_metadata_namespace = ""; } - if (object.rubyPackage !== undefined && object.rubyPackage !== null) { - message.rubyPackage = String(object.rubyPackage); + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.ruby_package = String(object.ruby_package); } else { - message.rubyPackage = ""; + message.ruby_package = ""; } if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); } } return message; @@ -3417,196 +3453,204 @@ export const FileOptions = { toJSON(message: FileOptions): unknown { const obj: any = {}; - message.javaPackage !== undefined && - (obj.javaPackage = message.javaPackage); - message.javaOuterClassname !== undefined && - (obj.javaOuterClassname = message.javaOuterClassname); - message.javaMultipleFiles !== undefined && - (obj.javaMultipleFiles = message.javaMultipleFiles); - message.javaGenerateEqualsAndHash !== undefined && - (obj.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash); - message.javaStringCheckUtf8 !== undefined && - (obj.javaStringCheckUtf8 = message.javaStringCheckUtf8); - message.optimizeFor !== undefined && - (obj.optimizeFor = fileOptions_OptimizeModeToJSON(message.optimizeFor)); - message.goPackage !== undefined && (obj.goPackage = message.goPackage); - message.ccGenericServices !== undefined && - (obj.ccGenericServices = message.ccGenericServices); - message.javaGenericServices !== undefined && - (obj.javaGenericServices = message.javaGenericServices); - message.pyGenericServices !== undefined && - (obj.pyGenericServices = message.pyGenericServices); - message.phpGenericServices !== undefined && - (obj.phpGenericServices = message.phpGenericServices); + message.java_package !== undefined && + (obj.java_package = message.java_package); + message.java_outer_classname !== undefined && + (obj.java_outer_classname = message.java_outer_classname); + message.java_multiple_files !== undefined && + (obj.java_multiple_files = message.java_multiple_files); + message.java_generate_equals_and_hash !== undefined && + (obj.java_generate_equals_and_hash = + message.java_generate_equals_and_hash); + message.java_string_check_utf8 !== undefined && + (obj.java_string_check_utf8 = message.java_string_check_utf8); + message.optimize_for !== undefined && + (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); + message.go_package !== undefined && (obj.go_package = message.go_package); + message.cc_generic_services !== undefined && + (obj.cc_generic_services = message.cc_generic_services); + message.java_generic_services !== undefined && + (obj.java_generic_services = message.java_generic_services); + message.py_generic_services !== undefined && + (obj.py_generic_services = message.py_generic_services); + message.php_generic_services !== undefined && + (obj.php_generic_services = message.php_generic_services); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.ccEnableArenas !== undefined && - (obj.ccEnableArenas = message.ccEnableArenas); - message.objcClassPrefix !== undefined && - (obj.objcClassPrefix = message.objcClassPrefix); - message.csharpNamespace !== undefined && - (obj.csharpNamespace = message.csharpNamespace); - message.swiftPrefix !== undefined && - (obj.swiftPrefix = message.swiftPrefix); - message.phpClassPrefix !== undefined && - (obj.phpClassPrefix = message.phpClassPrefix); - message.phpNamespace !== undefined && - (obj.phpNamespace = message.phpNamespace); - message.phpMetadataNamespace !== undefined && - (obj.phpMetadataNamespace = message.phpMetadataNamespace); - message.rubyPackage !== undefined && - (obj.rubyPackage = message.rubyPackage); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => + message.cc_enable_arenas !== undefined && + (obj.cc_enable_arenas = message.cc_enable_arenas); + message.objc_class_prefix !== undefined && + (obj.objc_class_prefix = message.objc_class_prefix); + message.csharp_namespace !== undefined && + (obj.csharp_namespace = message.csharp_namespace); + message.swift_prefix !== undefined && + (obj.swift_prefix = message.swift_prefix); + message.php_class_prefix !== undefined && + (obj.php_class_prefix = message.php_class_prefix); + message.php_namespace !== undefined && + (obj.php_namespace = message.php_namespace); + message.php_metadata_namespace !== undefined && + (obj.php_metadata_namespace = message.php_metadata_namespace); + message.ruby_package !== undefined && + (obj.ruby_package = message.ruby_package); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => e ? UninterpretedOption.toJSON(e) : undefined ); } else { - obj.uninterpretedOption = []; + obj.uninterpreted_option = []; } return obj; }, fromPartial(object: DeepPartial): FileOptions { const message = { ...baseFileOptions } as FileOptions; - message.uninterpretedOption = []; - if (object.javaPackage !== undefined && object.javaPackage !== null) { - message.javaPackage = object.javaPackage; + message.uninterpreted_option = []; + if (object.java_package !== undefined && object.java_package !== null) { + message.java_package = object.java_package; } else { - message.javaPackage = ""; + message.java_package = ""; } if ( - object.javaOuterClassname !== undefined && - object.javaOuterClassname !== null + object.java_outer_classname !== undefined && + object.java_outer_classname !== null ) { - message.javaOuterClassname = object.javaOuterClassname; + message.java_outer_classname = object.java_outer_classname; } else { - message.javaOuterClassname = ""; + message.java_outer_classname = ""; } if ( - object.javaMultipleFiles !== undefined && - object.javaMultipleFiles !== null + object.java_multiple_files !== undefined && + object.java_multiple_files !== null ) { - message.javaMultipleFiles = object.javaMultipleFiles; + message.java_multiple_files = object.java_multiple_files; } else { - message.javaMultipleFiles = false; + message.java_multiple_files = false; } if ( - object.javaGenerateEqualsAndHash !== undefined && - object.javaGenerateEqualsAndHash !== null + object.java_generate_equals_and_hash !== undefined && + object.java_generate_equals_and_hash !== null ) { - message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash; + message.java_generate_equals_and_hash = + object.java_generate_equals_and_hash; } else { - message.javaGenerateEqualsAndHash = false; + message.java_generate_equals_and_hash = false; } if ( - object.javaStringCheckUtf8 !== undefined && - object.javaStringCheckUtf8 !== null + object.java_string_check_utf8 !== undefined && + object.java_string_check_utf8 !== null ) { - message.javaStringCheckUtf8 = object.javaStringCheckUtf8; + message.java_string_check_utf8 = object.java_string_check_utf8; } else { - message.javaStringCheckUtf8 = false; + message.java_string_check_utf8 = false; } - if (object.optimizeFor !== undefined && object.optimizeFor !== null) { - message.optimizeFor = object.optimizeFor; + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimize_for = object.optimize_for; } else { - message.optimizeFor = 1; + message.optimize_for = 1; } - if (object.goPackage !== undefined && object.goPackage !== null) { - message.goPackage = object.goPackage; + if (object.go_package !== undefined && object.go_package !== null) { + message.go_package = object.go_package; } else { - message.goPackage = ""; + message.go_package = ""; } if ( - object.ccGenericServices !== undefined && - object.ccGenericServices !== null + object.cc_generic_services !== undefined && + object.cc_generic_services !== null ) { - message.ccGenericServices = object.ccGenericServices; + message.cc_generic_services = object.cc_generic_services; } else { - message.ccGenericServices = false; + message.cc_generic_services = false; } if ( - object.javaGenericServices !== undefined && - object.javaGenericServices !== null + object.java_generic_services !== undefined && + object.java_generic_services !== null ) { - message.javaGenericServices = object.javaGenericServices; + message.java_generic_services = object.java_generic_services; } else { - message.javaGenericServices = false; + message.java_generic_services = false; } if ( - object.pyGenericServices !== undefined && - object.pyGenericServices !== null + object.py_generic_services !== undefined && + object.py_generic_services !== null ) { - message.pyGenericServices = object.pyGenericServices; + message.py_generic_services = object.py_generic_services; } else { - message.pyGenericServices = false; + message.py_generic_services = false; } if ( - object.phpGenericServices !== undefined && - object.phpGenericServices !== null + object.php_generic_services !== undefined && + object.php_generic_services !== null ) { - message.phpGenericServices = object.phpGenericServices; + message.php_generic_services = object.php_generic_services; } else { - message.phpGenericServices = false; + message.php_generic_services = false; } if (object.deprecated !== undefined && object.deprecated !== null) { message.deprecated = object.deprecated; } else { message.deprecated = false; } - if (object.ccEnableArenas !== undefined && object.ccEnableArenas !== null) { - message.ccEnableArenas = object.ccEnableArenas; + if ( + object.cc_enable_arenas !== undefined && + object.cc_enable_arenas !== null + ) { + message.cc_enable_arenas = object.cc_enable_arenas; } else { - message.ccEnableArenas = false; + message.cc_enable_arenas = false; } if ( - object.objcClassPrefix !== undefined && - object.objcClassPrefix !== null + object.objc_class_prefix !== undefined && + object.objc_class_prefix !== null ) { - message.objcClassPrefix = object.objcClassPrefix; + message.objc_class_prefix = object.objc_class_prefix; } else { - message.objcClassPrefix = ""; + message.objc_class_prefix = ""; } if ( - object.csharpNamespace !== undefined && - object.csharpNamespace !== null + object.csharp_namespace !== undefined && + object.csharp_namespace !== null ) { - message.csharpNamespace = object.csharpNamespace; + message.csharp_namespace = object.csharp_namespace; } else { - message.csharpNamespace = ""; + message.csharp_namespace = ""; } - if (object.swiftPrefix !== undefined && object.swiftPrefix !== null) { - message.swiftPrefix = object.swiftPrefix; + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swift_prefix = object.swift_prefix; } else { - message.swiftPrefix = ""; + message.swift_prefix = ""; } - if (object.phpClassPrefix !== undefined && object.phpClassPrefix !== null) { - message.phpClassPrefix = object.phpClassPrefix; + if ( + object.php_class_prefix !== undefined && + object.php_class_prefix !== null + ) { + message.php_class_prefix = object.php_class_prefix; } else { - message.phpClassPrefix = ""; + message.php_class_prefix = ""; } - if (object.phpNamespace !== undefined && object.phpNamespace !== null) { - message.phpNamespace = object.phpNamespace; + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.php_namespace = object.php_namespace; } else { - message.phpNamespace = ""; + message.php_namespace = ""; } if ( - object.phpMetadataNamespace !== undefined && - object.phpMetadataNamespace !== null + object.php_metadata_namespace !== undefined && + object.php_metadata_namespace !== null ) { - message.phpMetadataNamespace = object.phpMetadataNamespace; + message.php_metadata_namespace = object.php_metadata_namespace; } else { - message.phpMetadataNamespace = ""; + message.php_metadata_namespace = ""; } - if (object.rubyPackage !== undefined && object.rubyPackage !== null) { - message.rubyPackage = object.rubyPackage; + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.ruby_package = object.ruby_package; } else { - message.rubyPackage = ""; + message.ruby_package = ""; } if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); } } return message; @@ -3614,27 +3658,27 @@ export const FileOptions = { }; const baseMessageOptions: object = { - messageSetWireFormat: false, - noStandardDescriptorAccessor: false, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, deprecated: false, - mapEntry: false, + map_entry: false, }; export const MessageOptions = { encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { - if (message.messageSetWireFormat === true) { - writer.uint32(8).bool(message.messageSetWireFormat); + if (message.message_set_wire_format === true) { + writer.uint32(8).bool(message.message_set_wire_format); } - if (message.noStandardDescriptorAccessor === true) { - writer.uint32(16).bool(message.noStandardDescriptorAccessor); + if (message.no_standard_descriptor_accessor === true) { + writer.uint32(16).bool(message.no_standard_descriptor_accessor); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.mapEntry === true) { - writer.uint32(56).bool(message.mapEntry); + if (message.map_entry === true) { + writer.uint32(56).bool(message.map_entry); } - for (const v of message.uninterpretedOption) { + for (const v of message.uninterpreted_option) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; @@ -3644,24 +3688,24 @@ export const MessageOptions = { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.messageSetWireFormat = reader.bool(); + message.message_set_wire_format = reader.bool(); break; case 2: - message.noStandardDescriptorAccessor = reader.bool(); + message.no_standard_descriptor_accessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: - message.mapEntry = reader.bool(); + message.map_entry = reader.bool(); break; case 999: - message.uninterpretedOption.push( + message.uninterpreted_option.push( UninterpretedOption.decode(reader, reader.uint32()) ); break; @@ -3675,41 +3719,41 @@ export const MessageOptions = { fromJSON(object: any): MessageOptions { const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; if ( - object.messageSetWireFormat !== undefined && - object.messageSetWireFormat !== null + object.message_set_wire_format !== undefined && + object.message_set_wire_format !== null ) { - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + message.message_set_wire_format = Boolean(object.message_set_wire_format); } else { - message.messageSetWireFormat = false; + message.message_set_wire_format = false; } if ( - object.noStandardDescriptorAccessor !== undefined && - object.noStandardDescriptorAccessor !== null + object.no_standard_descriptor_accessor !== undefined && + object.no_standard_descriptor_accessor !== null ) { - message.noStandardDescriptorAccessor = Boolean( - object.noStandardDescriptorAccessor + message.no_standard_descriptor_accessor = Boolean( + object.no_standard_descriptor_accessor ); } else { - message.noStandardDescriptorAccessor = false; + message.no_standard_descriptor_accessor = false; } if (object.deprecated !== undefined && object.deprecated !== null) { message.deprecated = Boolean(object.deprecated); } else { message.deprecated = false; } - if (object.mapEntry !== undefined && object.mapEntry !== null) { - message.mapEntry = Boolean(object.mapEntry); + if (object.map_entry !== undefined && object.map_entry !== null) { + message.map_entry = Boolean(object.map_entry); } else { - message.mapEntry = false; + message.map_entry = false; } if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); } } return message; @@ -3717,58 +3761,59 @@ export const MessageOptions = { toJSON(message: MessageOptions): unknown { const obj: any = {}; - message.messageSetWireFormat !== undefined && - (obj.messageSetWireFormat = message.messageSetWireFormat); - message.noStandardDescriptorAccessor !== undefined && - (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); + message.message_set_wire_format !== undefined && + (obj.message_set_wire_format = message.message_set_wire_format); + message.no_standard_descriptor_accessor !== undefined && + (obj.no_standard_descriptor_accessor = + message.no_standard_descriptor_accessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => + message.map_entry !== undefined && (obj.map_entry = message.map_entry); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => e ? UninterpretedOption.toJSON(e) : undefined ); } else { - obj.uninterpretedOption = []; + obj.uninterpreted_option = []; } return obj; }, fromPartial(object: DeepPartial): MessageOptions { const message = { ...baseMessageOptions } as MessageOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; if ( - object.messageSetWireFormat !== undefined && - object.messageSetWireFormat !== null + object.message_set_wire_format !== undefined && + object.message_set_wire_format !== null ) { - message.messageSetWireFormat = object.messageSetWireFormat; + message.message_set_wire_format = object.message_set_wire_format; } else { - message.messageSetWireFormat = false; + message.message_set_wire_format = false; } if ( - object.noStandardDescriptorAccessor !== undefined && - object.noStandardDescriptorAccessor !== null + object.no_standard_descriptor_accessor !== undefined && + object.no_standard_descriptor_accessor !== null ) { - message.noStandardDescriptorAccessor = - object.noStandardDescriptorAccessor; + message.no_standard_descriptor_accessor = + object.no_standard_descriptor_accessor; } else { - message.noStandardDescriptorAccessor = false; + message.no_standard_descriptor_accessor = false; } if (object.deprecated !== undefined && object.deprecated !== null) { message.deprecated = object.deprecated; } else { message.deprecated = false; } - if (object.mapEntry !== undefined && object.mapEntry !== null) { - message.mapEntry = object.mapEntry; + if (object.map_entry !== undefined && object.map_entry !== null) { + message.map_entry = object.map_entry; } else { - message.mapEntry = false; + message.map_entry = false; } if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); } } return message; @@ -3804,7 +3849,7 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - for (const v of message.uninterpretedOption) { + for (const v of message.uninterpreted_option) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; @@ -3814,7 +3859,7 @@ export const FieldOptions = { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3837,7 +3882,7 @@ export const FieldOptions = { message.weak = reader.bool(); break; case 999: - message.uninterpretedOption.push( + message.uninterpreted_option.push( UninterpretedOption.decode(reader, reader.uint32()) ); break; @@ -3851,7 +3896,7 @@ export const FieldOptions = { fromJSON(object: any): FieldOptions { const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; if (object.ctype !== undefined && object.ctype !== null) { message.ctype = fieldOptions_CTypeFromJSON(object.ctype); } else { @@ -3883,11 +3928,11 @@ export const FieldOptions = { message.weak = false; } if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); } } return message; @@ -3903,19 +3948,19 @@ export const FieldOptions = { message.lazy !== undefined && (obj.lazy = message.lazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => e ? UninterpretedOption.toJSON(e) : undefined ); } else { - obj.uninterpretedOption = []; + obj.uninterpreted_option = []; } return obj; }, fromPartial(object: DeepPartial): FieldOptions { const message = { ...baseFieldOptions } as FieldOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; if (object.ctype !== undefined && object.ctype !== null) { message.ctype = object.ctype; } else { @@ -3947,11 +3992,11 @@ export const FieldOptions = { message.weak = false; } if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); } } return message; @@ -3962,7 +4007,7 @@ const baseOneofOptions: object = {}; export const OneofOptions = { encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { - for (const v of message.uninterpretedOption) { + for (const v of message.uninterpreted_option) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; @@ -3972,12 +4017,12 @@ export const OneofOptions = { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 999: - message.uninterpretedOption.push( + message.uninterpreted_option.push( UninterpretedOption.decode(reader, reader.uint32()) ); break; @@ -3991,13 +4036,13 @@ export const OneofOptions = { fromJSON(object: any): OneofOptions { const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); } } return message; @@ -4005,42 +4050,42 @@ export const OneofOptions = { toJSON(message: OneofOptions): unknown { const obj: any = {}; - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => e ? UninterpretedOption.toJSON(e) : undefined ); } else { - obj.uninterpretedOption = []; + obj.uninterpreted_option = []; } return obj; }, fromPartial(object: DeepPartial): OneofOptions { const message = { ...baseOneofOptions } as OneofOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); } } return message; }, }; -const baseEnumOptions: object = { allowAlias: false, deprecated: false }; +const baseEnumOptions: object = { allow_alias: false, deprecated: false }; export const EnumOptions = { encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { - if (message.allowAlias === true) { - writer.uint32(16).bool(message.allowAlias); + if (message.allow_alias === true) { + writer.uint32(16).bool(message.allow_alias); } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - for (const v of message.uninterpretedOption) { + for (const v of message.uninterpreted_option) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; @@ -4050,18 +4095,18 @@ export const EnumOptions = { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.allowAlias = reader.bool(); + message.allow_alias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: - message.uninterpretedOption.push( + message.uninterpreted_option.push( UninterpretedOption.decode(reader, reader.uint32()) ); break; @@ -4075,11 +4120,11 @@ export const EnumOptions = { fromJSON(object: any): EnumOptions { const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpretedOption = []; - if (object.allowAlias !== undefined && object.allowAlias !== null) { - message.allowAlias = Boolean(object.allowAlias); + message.uninterpreted_option = []; + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allow_alias = Boolean(object.allow_alias); } else { - message.allowAlias = false; + message.allow_alias = false; } if (object.deprecated !== undefined && object.deprecated !== null) { message.deprecated = Boolean(object.deprecated); @@ -4087,11 +4132,11 @@ export const EnumOptions = { message.deprecated = false; } if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); } } return message; @@ -4099,25 +4144,26 @@ export const EnumOptions = { toJSON(message: EnumOptions): unknown { const obj: any = {}; - message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); + message.allow_alias !== undefined && + (obj.allow_alias = message.allow_alias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => e ? UninterpretedOption.toJSON(e) : undefined ); } else { - obj.uninterpretedOption = []; + obj.uninterpreted_option = []; } return obj; }, fromPartial(object: DeepPartial): EnumOptions { const message = { ...baseEnumOptions } as EnumOptions; - message.uninterpretedOption = []; - if (object.allowAlias !== undefined && object.allowAlias !== null) { - message.allowAlias = object.allowAlias; + message.uninterpreted_option = []; + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allow_alias = object.allow_alias; } else { - message.allowAlias = false; + message.allow_alias = false; } if (object.deprecated !== undefined && object.deprecated !== null) { message.deprecated = object.deprecated; @@ -4125,11 +4171,11 @@ export const EnumOptions = { message.deprecated = false; } if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); } } return message; @@ -4143,7 +4189,7 @@ export const EnumValueOptions = { if (message.deprecated === true) { writer.uint32(8).bool(message.deprecated); } - for (const v of message.uninterpretedOption) { + for (const v of message.uninterpreted_option) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; @@ -4153,7 +4199,7 @@ export const EnumValueOptions = { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4161,7 +4207,7 @@ export const EnumValueOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpretedOption.push( + message.uninterpreted_option.push( UninterpretedOption.decode(reader, reader.uint32()) ); break; @@ -4175,18 +4221,18 @@ export const EnumValueOptions = { fromJSON(object: any): EnumValueOptions { const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; if (object.deprecated !== undefined && object.deprecated !== null) { message.deprecated = Boolean(object.deprecated); } else { message.deprecated = false; } if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); } } return message; @@ -4195,30 +4241,30 @@ export const EnumValueOptions = { toJSON(message: EnumValueOptions): unknown { const obj: any = {}; message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => e ? UninterpretedOption.toJSON(e) : undefined ); } else { - obj.uninterpretedOption = []; + obj.uninterpreted_option = []; } return obj; }, fromPartial(object: DeepPartial): EnumValueOptions { const message = { ...baseEnumValueOptions } as EnumValueOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; if (object.deprecated !== undefined && object.deprecated !== null) { message.deprecated = object.deprecated; } else { message.deprecated = false; } if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); } } return message; @@ -4232,7 +4278,7 @@ export const ServiceOptions = { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - for (const v of message.uninterpretedOption) { + for (const v of message.uninterpreted_option) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; @@ -4242,7 +4288,7 @@ export const ServiceOptions = { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4250,7 +4296,7 @@ export const ServiceOptions = { message.deprecated = reader.bool(); break; case 999: - message.uninterpretedOption.push( + message.uninterpreted_option.push( UninterpretedOption.decode(reader, reader.uint32()) ); break; @@ -4264,18 +4310,18 @@ export const ServiceOptions = { fromJSON(object: any): ServiceOptions { const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; if (object.deprecated !== undefined && object.deprecated !== null) { message.deprecated = Boolean(object.deprecated); } else { message.deprecated = false; } if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); } } return message; @@ -4284,47 +4330,47 @@ export const ServiceOptions = { toJSON(message: ServiceOptions): unknown { const obj: any = {}; message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => e ? UninterpretedOption.toJSON(e) : undefined ); } else { - obj.uninterpretedOption = []; + obj.uninterpreted_option = []; } return obj; }, fromPartial(object: DeepPartial): ServiceOptions { const message = { ...baseServiceOptions } as ServiceOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; if (object.deprecated !== undefined && object.deprecated !== null) { message.deprecated = object.deprecated; } else { message.deprecated = false; } if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); } } return message; }, }; -const baseMethodOptions: object = { deprecated: false, idempotencyLevel: 0 }; +const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; export const MethodOptions = { encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } - if (message.idempotencyLevel !== 0) { - writer.uint32(272).int32(message.idempotencyLevel); + if (message.idempotency_level !== 0) { + writer.uint32(272).int32(message.idempotency_level); } - for (const v of message.uninterpretedOption) { + for (const v of message.uninterpreted_option) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; @@ -4334,7 +4380,7 @@ export const MethodOptions = { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4342,10 +4388,10 @@ export const MethodOptions = { message.deprecated = reader.bool(); break; case 34: - message.idempotencyLevel = reader.int32() as any; + message.idempotency_level = reader.int32() as any; break; case 999: - message.uninterpretedOption.push( + message.uninterpreted_option.push( UninterpretedOption.decode(reader, reader.uint32()) ); break; @@ -4359,28 +4405,28 @@ export const MethodOptions = { fromJSON(object: any): MethodOptions { const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; if (object.deprecated !== undefined && object.deprecated !== null) { message.deprecated = Boolean(object.deprecated); } else { message.deprecated = false; } if ( - object.idempotencyLevel !== undefined && - object.idempotencyLevel !== null + object.idempotency_level !== undefined && + object.idempotency_level !== null ) { - message.idempotencyLevel = methodOptions_IdempotencyLevelFromJSON( - object.idempotencyLevel + message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( + object.idempotency_level ); } else { - message.idempotencyLevel = 0; + message.idempotency_level = 0; } if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); } } return message; @@ -4389,42 +4435,42 @@ export const MethodOptions = { toJSON(message: MethodOptions): unknown { const obj: any = {}; message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotencyLevel !== undefined && - (obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON( - message.idempotencyLevel + message.idempotency_level !== undefined && + (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( + message.idempotency_level )); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => e ? UninterpretedOption.toJSON(e) : undefined ); } else { - obj.uninterpretedOption = []; + obj.uninterpreted_option = []; } return obj; }, fromPartial(object: DeepPartial): MethodOptions { const message = { ...baseMethodOptions } as MethodOptions; - message.uninterpretedOption = []; + message.uninterpreted_option = []; if (object.deprecated !== undefined && object.deprecated !== null) { message.deprecated = object.deprecated; } else { message.deprecated = false; } if ( - object.idempotencyLevel !== undefined && - object.idempotencyLevel !== null + object.idempotency_level !== undefined && + object.idempotency_level !== null ) { - message.idempotencyLevel = object.idempotencyLevel; + message.idempotency_level = object.idempotency_level; } else { - message.idempotencyLevel = 0; + message.idempotency_level = 0; } if ( - object.uninterpretedOption !== undefined && - object.uninterpretedOption !== null + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null ) { - for (const e of object.uninterpretedOption) { - message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); } } return message; @@ -4432,11 +4478,11 @@ export const MethodOptions = { }; const baseUninterpretedOption: object = { - identifierValue: "", - positiveIntValue: 0, - negativeIntValue: 0, - doubleValue: 0, - aggregateValue: "", + identifier_value: "", + positive_int_value: 0, + negative_int_value: 0, + double_value: 0, + aggregate_value: "", }; export const UninterpretedOption = { @@ -4450,23 +4496,23 @@ export const UninterpretedOption = { writer.uint32(18).fork() ).ldelim(); } - if (message.identifierValue !== "") { - writer.uint32(26).string(message.identifierValue); + if (message.identifier_value !== "") { + writer.uint32(26).string(message.identifier_value); } - if (message.positiveIntValue !== 0) { - writer.uint32(32).uint64(message.positiveIntValue); + if (message.positive_int_value !== 0) { + writer.uint32(32).uint64(message.positive_int_value); } - if (message.negativeIntValue !== 0) { - writer.uint32(40).int64(message.negativeIntValue); + if (message.negative_int_value !== 0) { + writer.uint32(40).int64(message.negative_int_value); } - if (message.doubleValue !== 0) { - writer.uint32(49).double(message.doubleValue); + if (message.double_value !== 0) { + writer.uint32(49).double(message.double_value); } - if (message.stringValue.length !== 0) { - writer.uint32(58).bytes(message.stringValue); + if (message.string_value.length !== 0) { + writer.uint32(58).bytes(message.string_value); } - if (message.aggregateValue !== "") { - writer.uint32(66).string(message.aggregateValue); + if (message.aggregate_value !== "") { + writer.uint32(66).string(message.aggregate_value); } return writer; }, @@ -4485,22 +4531,22 @@ export const UninterpretedOption = { ); break; case 3: - message.identifierValue = reader.string(); + message.identifier_value = reader.string(); break; case 4: - message.positiveIntValue = longToNumber(reader.uint64() as Long); + message.positive_int_value = longToNumber(reader.uint64() as Long); break; case 5: - message.negativeIntValue = longToNumber(reader.int64() as Long); + message.negative_int_value = longToNumber(reader.int64() as Long); break; case 6: - message.doubleValue = reader.double(); + message.double_value = reader.double(); break; case 7: - message.stringValue = reader.bytes(); + message.string_value = reader.bytes(); break; case 8: - message.aggregateValue = reader.string(); + message.aggregate_value = reader.string(); break; default: reader.skipType(tag & 7); @@ -4519,41 +4565,44 @@ export const UninterpretedOption = { } } if ( - object.identifierValue !== undefined && - object.identifierValue !== null + object.identifier_value !== undefined && + object.identifier_value !== null ) { - message.identifierValue = String(object.identifierValue); + message.identifier_value = String(object.identifier_value); } else { - message.identifierValue = ""; + message.identifier_value = ""; } if ( - object.positiveIntValue !== undefined && - object.positiveIntValue !== null + object.positive_int_value !== undefined && + object.positive_int_value !== null ) { - message.positiveIntValue = Number(object.positiveIntValue); + message.positive_int_value = Number(object.positive_int_value); } else { - message.positiveIntValue = 0; + message.positive_int_value = 0; } if ( - object.negativeIntValue !== undefined && - object.negativeIntValue !== null + object.negative_int_value !== undefined && + object.negative_int_value !== null ) { - message.negativeIntValue = Number(object.negativeIntValue); + message.negative_int_value = Number(object.negative_int_value); } else { - message.negativeIntValue = 0; + message.negative_int_value = 0; } - if (object.doubleValue !== undefined && object.doubleValue !== null) { - message.doubleValue = Number(object.doubleValue); + if (object.double_value !== undefined && object.double_value !== null) { + message.double_value = Number(object.double_value); } else { - message.doubleValue = 0; + message.double_value = 0; } - if (object.stringValue !== undefined && object.stringValue !== null) { - message.stringValue = bytesFromBase64(object.stringValue); + if (object.string_value !== undefined && object.string_value !== null) { + message.string_value = bytesFromBase64(object.string_value); } - if (object.aggregateValue !== undefined && object.aggregateValue !== null) { - message.aggregateValue = String(object.aggregateValue); + if ( + object.aggregate_value !== undefined && + object.aggregate_value !== null + ) { + message.aggregate_value = String(object.aggregate_value); } else { - message.aggregateValue = ""; + message.aggregate_value = ""; } return message; }, @@ -4567,22 +4616,22 @@ export const UninterpretedOption = { } else { obj.name = []; } - message.identifierValue !== undefined && - (obj.identifierValue = message.identifierValue); - message.positiveIntValue !== undefined && - (obj.positiveIntValue = message.positiveIntValue); - message.negativeIntValue !== undefined && - (obj.negativeIntValue = message.negativeIntValue); - message.doubleValue !== undefined && - (obj.doubleValue = message.doubleValue); - message.stringValue !== undefined && - (obj.stringValue = base64FromBytes( - message.stringValue !== undefined - ? message.stringValue + message.identifier_value !== undefined && + (obj.identifier_value = message.identifier_value); + message.positive_int_value !== undefined && + (obj.positive_int_value = message.positive_int_value); + message.negative_int_value !== undefined && + (obj.negative_int_value = message.negative_int_value); + message.double_value !== undefined && + (obj.double_value = message.double_value); + message.string_value !== undefined && + (obj.string_value = base64FromBytes( + message.string_value !== undefined + ? message.string_value : new Uint8Array() )); - message.aggregateValue !== undefined && - (obj.aggregateValue = message.aggregateValue); + message.aggregate_value !== undefined && + (obj.aggregate_value = message.aggregate_value); return obj; }, @@ -4595,51 +4644,54 @@ export const UninterpretedOption = { } } if ( - object.identifierValue !== undefined && - object.identifierValue !== null + object.identifier_value !== undefined && + object.identifier_value !== null ) { - message.identifierValue = object.identifierValue; + message.identifier_value = object.identifier_value; } else { - message.identifierValue = ""; + message.identifier_value = ""; } if ( - object.positiveIntValue !== undefined && - object.positiveIntValue !== null + object.positive_int_value !== undefined && + object.positive_int_value !== null ) { - message.positiveIntValue = object.positiveIntValue; + message.positive_int_value = object.positive_int_value; } else { - message.positiveIntValue = 0; + message.positive_int_value = 0; } if ( - object.negativeIntValue !== undefined && - object.negativeIntValue !== null + object.negative_int_value !== undefined && + object.negative_int_value !== null ) { - message.negativeIntValue = object.negativeIntValue; + message.negative_int_value = object.negative_int_value; } else { - message.negativeIntValue = 0; + message.negative_int_value = 0; } - if (object.doubleValue !== undefined && object.doubleValue !== null) { - message.doubleValue = object.doubleValue; + if (object.double_value !== undefined && object.double_value !== null) { + message.double_value = object.double_value; } else { - message.doubleValue = 0; + message.double_value = 0; } - if (object.stringValue !== undefined && object.stringValue !== null) { - message.stringValue = object.stringValue; + if (object.string_value !== undefined && object.string_value !== null) { + message.string_value = object.string_value; } else { - message.stringValue = new Uint8Array(); + message.string_value = new Uint8Array(); } - if (object.aggregateValue !== undefined && object.aggregateValue !== null) { - message.aggregateValue = object.aggregateValue; + if ( + object.aggregate_value !== undefined && + object.aggregate_value !== null + ) { + message.aggregate_value = object.aggregate_value; } else { - message.aggregateValue = ""; + message.aggregate_value = ""; } return message; }, }; const baseUninterpretedOption_NamePart: object = { - namePart: "", - isExtension: false, + name_part: "", + is_extension: false, }; export const UninterpretedOption_NamePart = { @@ -4647,11 +4699,11 @@ export const UninterpretedOption_NamePart = { message: UninterpretedOption_NamePart, writer: Writer = Writer.create() ): Writer { - if (message.namePart !== "") { - writer.uint32(10).string(message.namePart); + if (message.name_part !== "") { + writer.uint32(10).string(message.name_part); } - if (message.isExtension === true) { - writer.uint32(16).bool(message.isExtension); + if (message.is_extension === true) { + writer.uint32(16).bool(message.is_extension); } return writer; }, @@ -4669,10 +4721,10 @@ export const UninterpretedOption_NamePart = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.namePart = reader.string(); + message.name_part = reader.string(); break; case 2: - message.isExtension = reader.bool(); + message.is_extension = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4686,24 +4738,24 @@ export const UninterpretedOption_NamePart = { const message = { ...baseUninterpretedOption_NamePart, } as UninterpretedOption_NamePart; - if (object.namePart !== undefined && object.namePart !== null) { - message.namePart = String(object.namePart); + if (object.name_part !== undefined && object.name_part !== null) { + message.name_part = String(object.name_part); } else { - message.namePart = ""; + message.name_part = ""; } - if (object.isExtension !== undefined && object.isExtension !== null) { - message.isExtension = Boolean(object.isExtension); + if (object.is_extension !== undefined && object.is_extension !== null) { + message.is_extension = Boolean(object.is_extension); } else { - message.isExtension = false; + message.is_extension = false; } return message; }, toJSON(message: UninterpretedOption_NamePart): unknown { const obj: any = {}; - message.namePart !== undefined && (obj.namePart = message.namePart); - message.isExtension !== undefined && - (obj.isExtension = message.isExtension); + message.name_part !== undefined && (obj.name_part = message.name_part); + message.is_extension !== undefined && + (obj.is_extension = message.is_extension); return obj; }, @@ -4713,15 +4765,15 @@ export const UninterpretedOption_NamePart = { const message = { ...baseUninterpretedOption_NamePart, } as UninterpretedOption_NamePart; - if (object.namePart !== undefined && object.namePart !== null) { - message.namePart = object.namePart; + if (object.name_part !== undefined && object.name_part !== null) { + message.name_part = object.name_part; } else { - message.namePart = ""; + message.name_part = ""; } - if (object.isExtension !== undefined && object.isExtension !== null) { - message.isExtension = object.isExtension; + if (object.is_extension !== undefined && object.is_extension !== null) { + message.is_extension = object.is_extension; } else { - message.isExtension = false; + message.is_extension = false; } return message; }, @@ -4796,9 +4848,9 @@ export const SourceCodeInfo = { const baseSourceCodeInfo_Location: object = { path: 0, span: 0, - leadingComments: "", - trailingComments: "", - leadingDetachedComments: "", + leading_comments: "", + trailing_comments: "", + leading_detached_comments: "", }; export const SourceCodeInfo_Location = { @@ -4816,13 +4868,13 @@ export const SourceCodeInfo_Location = { writer.int32(v); } writer.ldelim(); - if (message.leadingComments !== "") { - writer.uint32(26).string(message.leadingComments); + if (message.leading_comments !== "") { + writer.uint32(26).string(message.leading_comments); } - if (message.trailingComments !== "") { - writer.uint32(34).string(message.trailingComments); + if (message.trailing_comments !== "") { + writer.uint32(34).string(message.trailing_comments); } - for (const v of message.leadingDetachedComments) { + for (const v of message.leading_detached_comments) { writer.uint32(50).string(v!); } return writer; @@ -4836,7 +4888,7 @@ export const SourceCodeInfo_Location = { } as SourceCodeInfo_Location; message.path = []; message.span = []; - message.leadingDetachedComments = []; + message.leading_detached_comments = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4861,13 +4913,13 @@ export const SourceCodeInfo_Location = { } break; case 3: - message.leadingComments = reader.string(); + message.leading_comments = reader.string(); break; case 4: - message.trailingComments = reader.string(); + message.trailing_comments = reader.string(); break; case 6: - message.leadingDetachedComments.push(reader.string()); + message.leading_detached_comments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4883,7 +4935,7 @@ export const SourceCodeInfo_Location = { } as SourceCodeInfo_Location; message.path = []; message.span = []; - message.leadingDetachedComments = []; + message.leading_detached_comments = []; if (object.path !== undefined && object.path !== null) { for (const e of object.path) { message.path.push(Number(e)); @@ -4895,27 +4947,27 @@ export const SourceCodeInfo_Location = { } } if ( - object.leadingComments !== undefined && - object.leadingComments !== null + object.leading_comments !== undefined && + object.leading_comments !== null ) { - message.leadingComments = String(object.leadingComments); + message.leading_comments = String(object.leading_comments); } else { - message.leadingComments = ""; + message.leading_comments = ""; } if ( - object.trailingComments !== undefined && - object.trailingComments !== null + object.trailing_comments !== undefined && + object.trailing_comments !== null ) { - message.trailingComments = String(object.trailingComments); + message.trailing_comments = String(object.trailing_comments); } else { - message.trailingComments = ""; + message.trailing_comments = ""; } if ( - object.leadingDetachedComments !== undefined && - object.leadingDetachedComments !== null + object.leading_detached_comments !== undefined && + object.leading_detached_comments !== null ) { - for (const e of object.leadingDetachedComments) { - message.leadingDetachedComments.push(String(e)); + for (const e of object.leading_detached_comments) { + message.leading_detached_comments.push(String(e)); } } return message; @@ -4933,16 +4985,16 @@ export const SourceCodeInfo_Location = { } else { obj.span = []; } - message.leadingComments !== undefined && - (obj.leadingComments = message.leadingComments); - message.trailingComments !== undefined && - (obj.trailingComments = message.trailingComments); - if (message.leadingDetachedComments) { - obj.leadingDetachedComments = message.leadingDetachedComments.map( + message.leading_comments !== undefined && + (obj.leading_comments = message.leading_comments); + message.trailing_comments !== undefined && + (obj.trailing_comments = message.trailing_comments); + if (message.leading_detached_comments) { + obj.leading_detached_comments = message.leading_detached_comments.map( (e) => e ); } else { - obj.leadingDetachedComments = []; + obj.leading_detached_comments = []; } return obj; }, @@ -4955,7 +5007,7 @@ export const SourceCodeInfo_Location = { } as SourceCodeInfo_Location; message.path = []; message.span = []; - message.leadingDetachedComments = []; + message.leading_detached_comments = []; if (object.path !== undefined && object.path !== null) { for (const e of object.path) { message.path.push(e); @@ -4967,27 +5019,27 @@ export const SourceCodeInfo_Location = { } } if ( - object.leadingComments !== undefined && - object.leadingComments !== null + object.leading_comments !== undefined && + object.leading_comments !== null ) { - message.leadingComments = object.leadingComments; + message.leading_comments = object.leading_comments; } else { - message.leadingComments = ""; + message.leading_comments = ""; } if ( - object.trailingComments !== undefined && - object.trailingComments !== null + object.trailing_comments !== undefined && + object.trailing_comments !== null ) { - message.trailingComments = object.trailingComments; + message.trailing_comments = object.trailing_comments; } else { - message.trailingComments = ""; + message.trailing_comments = ""; } if ( - object.leadingDetachedComments !== undefined && - object.leadingDetachedComments !== null + object.leading_detached_comments !== undefined && + object.leading_detached_comments !== null ) { - for (const e of object.leadingDetachedComments) { - message.leadingDetachedComments.push(e); + for (const e of object.leading_detached_comments) { + message.leading_detached_comments.push(e); } } return message; @@ -5065,7 +5117,7 @@ export const GeneratedCodeInfo = { const baseGeneratedCodeInfo_Annotation: object = { path: 0, - sourceFile: "", + source_file: "", begin: 0, end: 0, }; @@ -5080,8 +5132,8 @@ export const GeneratedCodeInfo_Annotation = { writer.int32(v); } writer.ldelim(); - if (message.sourceFile !== "") { - writer.uint32(18).string(message.sourceFile); + if (message.source_file !== "") { + writer.uint32(18).string(message.source_file); } if (message.begin !== 0) { writer.uint32(24).int32(message.begin); @@ -5116,7 +5168,7 @@ export const GeneratedCodeInfo_Annotation = { } break; case 2: - message.sourceFile = reader.string(); + message.source_file = reader.string(); break; case 3: message.begin = reader.int32(); @@ -5142,10 +5194,10 @@ export const GeneratedCodeInfo_Annotation = { message.path.push(Number(e)); } } - if (object.sourceFile !== undefined && object.sourceFile !== null) { - message.sourceFile = String(object.sourceFile); + if (object.source_file !== undefined && object.source_file !== null) { + message.source_file = String(object.source_file); } else { - message.sourceFile = ""; + message.source_file = ""; } if (object.begin !== undefined && object.begin !== null) { message.begin = Number(object.begin); @@ -5167,7 +5219,8 @@ export const GeneratedCodeInfo_Annotation = { } else { obj.path = []; } - message.sourceFile !== undefined && (obj.sourceFile = message.sourceFile); + message.source_file !== undefined && + (obj.source_file = message.source_file); message.begin !== undefined && (obj.begin = message.begin); message.end !== undefined && (obj.end = message.end); return obj; @@ -5185,10 +5238,10 @@ export const GeneratedCodeInfo_Annotation = { message.path.push(e); } } - if (object.sourceFile !== undefined && object.sourceFile !== null) { - message.sourceFile = object.sourceFile; + if (object.source_file !== undefined && object.source_file !== null) { + message.source_file = object.source_file; } else { - message.sourceFile = ""; + message.source_file = ""; } if (object.begin !== undefined && object.begin !== null) { message.begin = object.begin; From fdd1f0200a0befcaf4234e5eacbae913f8e86738 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Mon, 7 Nov 2022 17:04:24 +0200 Subject: [PATCH 02/54] wip --- app/app.go | 77 +- app/upgrades/v6/upgrades.go | 3 + docs/static/openapi.yml | 64 + go.mod | 2 +- proto/cointrunk/genesis.proto | 14 + proto/cointrunk/params.proto | 14 + proto/cointrunk/query.proto | 30 + proto/cointrunk/tx.proto | 13 + testutil/keeper/cointrunk.go | 54 + .../bze/bzealphateam.bze.cointrunk/index.ts | 141 + .../module/index.ts | 57 + .../bzealphateam.bze.cointrunk/module/rest.ts | 251 + .../module/types/cointrunk/genesis.ts | 78 + .../module/types/cointrunk/params.ts | 130 + .../module/types/cointrunk/query.ts | 152 + .../module/types/cointrunk/tx.ts | 20 + .../cosmos/base/query/v1beta1/pagination.ts | 328 + .../module/types/gogoproto/gogo.ts | 2 + .../module/types/google/api/annotations.ts | 2 + .../module/types/google/api/http.ts | 706 +++ .../types/google/protobuf/descriptor.ts | 5314 +++++++++++++++++ .../bzealphateam.bze.cointrunk/package.json | 18 + .../bze/bzealphateam.bze.cointrunk/vuex-root | 1 + vue/src/store/generated/index.ts | 2 + x/cointrunk/client/cli/query.go | 32 + x/cointrunk/client/cli/query_params.go | 34 + x/cointrunk/client/cli/tx.go | 36 + x/cointrunk/genesis.go | 25 + x/cointrunk/genesis_test.go | 29 + x/cointrunk/handler.go | 26 + x/cointrunk/keeper/grpc_query.go | 7 + x/cointrunk/keeper/grpc_query_params.go | 19 + x/cointrunk/keeper/grpc_query_params_test.go | 21 + x/cointrunk/keeper/keeper.go | 53 + x/cointrunk/keeper/msg_server.go | 17 + x/cointrunk/keeper/msg_server_test.go | 16 + x/cointrunk/keeper/params.go | 32 + x/cointrunk/keeper/params_test.go | 20 + x/cointrunk/module.go | 177 + x/cointrunk/module_simulation.go | 71 + x/cointrunk/simulation/simap.go | 15 + x/cointrunk/types/codec.go | 23 + x/cointrunk/types/errors.go | 13 + x/cointrunk/types/expected_keepers.go | 28 + x/cointrunk/types/genesis.go | 24 + x/cointrunk/types/genesis.pb.go | 321 + x/cointrunk/types/genesis_test.go | 40 + x/cointrunk/types/keys.go | 26 + x/cointrunk/types/params.go | 97 + x/cointrunk/types/params.pb.go | 356 ++ x/cointrunk/types/query.pb.go | 538 ++ x/cointrunk/types/query.pb.gw.go | 153 + x/cointrunk/types/tx.pb.go | 81 + x/cointrunk/types/types.go | 1 + 54 files changed, 9792 insertions(+), 12 deletions(-) create mode 100644 app/upgrades/v6/upgrades.go create mode 100644 proto/cointrunk/genesis.proto create mode 100644 proto/cointrunk/params.proto create mode 100644 proto/cointrunk/query.proto create mode 100644 proto/cointrunk/tx.proto create mode 100644 testutil/keeper/cointrunk.go create mode 100755 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/index.ts create mode 100755 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/index.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/rest.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/genesis.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/params.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/query.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/tx.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cosmos/base/query/v1beta1/pagination.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/gogoproto/gogo.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/google/api/annotations.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/google/api/http.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/google/protobuf/descriptor.ts create mode 100755 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/package.json create mode 100755 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/vuex-root create mode 100644 x/cointrunk/client/cli/query.go create mode 100644 x/cointrunk/client/cli/query_params.go create mode 100644 x/cointrunk/client/cli/tx.go create mode 100644 x/cointrunk/genesis.go create mode 100644 x/cointrunk/genesis_test.go create mode 100644 x/cointrunk/handler.go create mode 100644 x/cointrunk/keeper/grpc_query.go create mode 100644 x/cointrunk/keeper/grpc_query_params.go create mode 100644 x/cointrunk/keeper/grpc_query_params_test.go create mode 100644 x/cointrunk/keeper/keeper.go create mode 100644 x/cointrunk/keeper/msg_server.go create mode 100644 x/cointrunk/keeper/msg_server_test.go create mode 100644 x/cointrunk/keeper/params.go create mode 100644 x/cointrunk/keeper/params_test.go create mode 100644 x/cointrunk/module.go create mode 100644 x/cointrunk/module_simulation.go create mode 100644 x/cointrunk/simulation/simap.go create mode 100644 x/cointrunk/types/codec.go create mode 100644 x/cointrunk/types/errors.go create mode 100644 x/cointrunk/types/expected_keepers.go create mode 100644 x/cointrunk/types/genesis.go create mode 100644 x/cointrunk/types/genesis.pb.go create mode 100644 x/cointrunk/types/genesis_test.go create mode 100644 x/cointrunk/types/keys.go create mode 100644 x/cointrunk/types/params.go create mode 100644 x/cointrunk/types/params.pb.go create mode 100644 x/cointrunk/types/query.pb.go create mode 100644 x/cointrunk/types/query.pb.gw.go create mode 100644 x/cointrunk/types/tx.pb.go create mode 100644 x/cointrunk/types/types.go diff --git a/app/app.go b/app/app.go index ab5b5b42..d2f0ab4b 100644 --- a/app/app.go +++ b/app/app.go @@ -1,6 +1,7 @@ package app import ( + storetypes "github.com/cosmos/cosmos-sdk/store/types" ibcclientclient "github.com/cosmos/ibc-go/v2/modules/core/02-client/client" "io" "net/http" @@ -92,6 +93,10 @@ import ( scavengemodule "github.com/bze-alphateam/bze/x/scavenge" scavengemodulekeeper "github.com/bze-alphateam/bze/x/scavenge/keeper" scavengemoduletypes "github.com/bze-alphateam/bze/x/scavenge/types" + + cointrunkmodule "github.com/bze-alphateam/bze/x/cointrunk" + cointrunkmodulekeeper "github.com/bze-alphateam/bze/x/cointrunk/keeper" + cointrunkmoduletypes "github.com/bze-alphateam/bze/x/cointrunk/types" // this line is used by starport scaffolding # stargate/app/moduleImport ) @@ -145,19 +150,21 @@ var ( transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, scavengemodule.AppModuleBasic{}, + cointrunkmodule.AppModuleBasic{}, // this line is used by starport scaffolding # stargate/app/moduleBasic ) // module account permissions maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, - ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - scavengemoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking}, + authtypes.FeeCollectorName: nil, + distrtypes.ModuleName: nil, + minttypes.ModuleName: {authtypes.Minter}, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + govtypes.ModuleName: {authtypes.Burner}, + ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + scavengemoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking}, + cointrunkmoduletypes.ModuleName: {authtypes.Burner}, // this line is used by starport scaffolding # stargate/app/maccPerms } ) @@ -214,7 +221,8 @@ type App struct { ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedTransferKeeper capabilitykeeper.ScopedKeeper - ScavengeKeeper scavengemodulekeeper.Keeper + ScavengeKeeper scavengemodulekeeper.Keeper + CointrunkKeeper cointrunkmodulekeeper.Keeper // this line is used by starport scaffolding # stargate/app/keeperDeclaration // the module manager @@ -248,7 +256,7 @@ func New( minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, - scavengemoduletypes.StoreKey, + scavengemoduletypes.StoreKey, cointrunkmoduletypes.StoreKey, // this line is used by starport scaffolding # stargate/app/storeKey ) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) @@ -351,11 +359,20 @@ func New( appCodec, keys[scavengemoduletypes.StoreKey], keys[scavengemoduletypes.MemStoreKey], + app.BankKeeper, + ) + app.CointrunkKeeper = *cointrunkmodulekeeper.NewKeeper( + appCodec, + keys[cointrunkmoduletypes.StoreKey], + keys[cointrunkmoduletypes.MemStoreKey], + app.GetSubspace(cointrunkmoduletypes.ModuleName), app.BankKeeper, + app.GovKeeper, ) - scavengeModule := scavengemodule.NewAppModule(appCodec, app.ScavengeKeeper) + scavengeModule := scavengemodule.NewAppModule(appCodec, app.ScavengeKeeper) + cointrunkModule := cointrunkmodule.NewAppModule(appCodec, app.CointrunkKeeper, app.AccountKeeper, app.BankKeeper) // this line is used by starport scaffolding # stargate/app/keeperDefinition // Create static IBC router, add transfer route, then set and seal it @@ -395,6 +412,7 @@ func New( params.NewAppModule(app.ParamsKeeper), transferModule, scavengeModule, + cointrunkModule, // this line is used by starport scaffolding # stargate/app/appModule ) @@ -421,6 +439,7 @@ func New( scavengemoduletypes.ModuleName, vestingtypes.ModuleName, ibctransfertypes.ModuleName, + cointrunkmoduletypes.ModuleName, ) app.mm.SetOrderEndBlockers( @@ -442,6 +461,7 @@ func New( scavengemoduletypes.ModuleName, vestingtypes.ModuleName, ibctransfertypes.ModuleName, + cointrunkmoduletypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -468,6 +488,7 @@ func New( upgradetypes.ModuleName, vestingtypes.ModuleName, paramstypes.ModuleName, + cointrunkmoduletypes.ModuleName, // this line is used by starport scaffolding # stargate/app/initGenesis ) @@ -499,6 +520,7 @@ func New( app.SetAnteHandler(anteHandler) app.SetEndBlocker(app.EndBlocker) + app.setupUpgradeHandlers() if loadLatest { if err := app.LoadLatestVersion(); err != nil { @@ -513,6 +535,38 @@ func New( return app } +func (app *App) setupUpgradeHandlers() { + // TODO: prepare the upgrade handler for v6 + // When a planned update height is reached, the old binary will panic + // writing on disk the height and name of the update that triggered it + // This will read that value, and execute the preparations for the upgrade. + //upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() + //if err != nil { + // panic(fmt.Errorf("failed to read upgrade info from disk: %w", err)) + //} + // + //if app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + // return + //} + + var storeUpgrades *storetypes.StoreUpgrades + + //switch true { + //case true: //TODO: add version name + // // add missing cointrunk module + // storeUpgrades = &storetypes.StoreUpgrades{ + // Added: []string{cointrunkmoduletypes.ModuleName}, + // } + //} + storeUpgrades = &storetypes.StoreUpgrades{ + Added: []string{cointrunkmoduletypes.ModuleName}, + } + //if storeUpgrades != nil { + // configure store loader that checks if version == upgradeHeight and applies store upgrades + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(130, storeUpgrades)) + //} +} + // Name returns the name of the App func (app *App) Name() string { return app.BaseApp.Name() } @@ -656,6 +710,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(ibctransfertypes.ModuleName) paramsKeeper.Subspace(ibchost.ModuleName) paramsKeeper.Subspace(scavengemoduletypes.ModuleName) + paramsKeeper.Subspace(cointrunkmoduletypes.ModuleName) // this line is used by starport scaffolding # stargate/app/paramSubspace return paramsKeeper diff --git a/app/upgrades/v6/upgrades.go b/app/upgrades/v6/upgrades.go new file mode 100644 index 00000000..5ead4b28 --- /dev/null +++ b/app/upgrades/v6/upgrades.go @@ -0,0 +1,3 @@ +package v6 + +const UpgradeName = "v6.0.0" diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 4d199614..77175191 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -354,6 +354,48 @@ paths: type: string tags: - Query + /bzealphateam/bze/cointrunk/params: + get: + summary: Parameters queries the parameters of the module. + operationId: BzealphateamBzeCointrunkParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + anonArticleLimit: + type: string + format: uint64 + anonArticleCost: + 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 /cosmos/auth/v1beta1/accounts: get: summary: Accounts returns all the existing accounts @@ -30547,6 +30589,28 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + bzealphateam.bze.cointrunk.Params: + type: object + properties: + anonArticleLimit: + type: string + format: uint64 + anonArticleCost: + type: string + description: Params defines the parameters for the module. + bzealphateam.bze.cointrunk.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + anonArticleLimit: + type: string + format: uint64 + anonArticleCost: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. cosmos.auth.v1beta1.Params: type: object properties: diff --git a/go.mod b/go.mod index 37df31ba..6c61b551 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ require ( github.com/tendermint/tm-db v0.6.6 google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c google.golang.org/grpc v1.50.1 + gopkg.in/yaml.v2 v2.4.0 ) require ( @@ -119,7 +120,6 @@ require ( golang.org/x/text v0.4.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect ) diff --git a/proto/cointrunk/genesis.proto b/proto/cointrunk/genesis.proto new file mode 100644 index 00000000..622246a2 --- /dev/null +++ b/proto/cointrunk/genesis.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package bzealphateam.bze.cointrunk; + +import "gogoproto/gogo.proto"; +import "cointrunk/params.proto"; +// this line is used by starport scaffolding # genesis/proto/import + +option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; + +// GenesisState defines the cointrunk module's genesis state. +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + // this line is used by starport scaffolding # genesis/proto/state +} diff --git a/proto/cointrunk/params.proto b/proto/cointrunk/params.proto new file mode 100644 index 00000000..90f264d3 --- /dev/null +++ b/proto/cointrunk/params.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package bzealphateam.bze.cointrunk; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; + +// Params defines the parameters for the module. +message Params { + option (gogoproto.goproto_stringer) = false; + + uint64 anonArticleLimit = 1 [(gogoproto.moretags) = "yaml:\"anon_article_limit\""]; + string anonArticleCost = 2 [(gogoproto.moretags) = "yaml:\"anon_article_cost\""]; +} \ No newline at end of file diff --git a/proto/cointrunk/query.proto b/proto/cointrunk/query.proto new file mode 100644 index 00000000..83e12447 --- /dev/null +++ b/proto/cointrunk/query.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package bzealphateam.bze.cointrunk; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cointrunk/params.proto"; +// this line is used by starport scaffolding # 1 + +option go_package = "github.com/bze-alphateam/bze/x/cointrunk/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 = "/bzealphateam/bze/cointrunk/params"; + } + // this line is used by starport scaffolding # 2 +} + +// 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]; +} + +// this line is used by starport scaffolding # 3 diff --git a/proto/cointrunk/tx.proto b/proto/cointrunk/tx.proto new file mode 100644 index 00000000..7ddbc529 --- /dev/null +++ b/proto/cointrunk/tx.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package bzealphateam.bze.cointrunk; + +// this line is used by starport scaffolding # proto/tx/import + +option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; + +// Msg defines the Msg service. +service Msg { + // this line is used by starport scaffolding # proto/tx/rpc +} + +// this line is used by starport scaffolding # proto/tx/message \ No newline at end of file diff --git a/testutil/keeper/cointrunk.go b/testutil/keeper/cointrunk.go new file mode 100644 index 00000000..306fc4a8 --- /dev/null +++ b/testutil/keeper/cointrunk.go @@ -0,0 +1,54 @@ +package keeper + +import ( + "testing" + + "github.com/bze-alphateam/bze/x/cointrunk/keeper" + "github.com/bze-alphateam/bze/x/cointrunk/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" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmdb "github.com/tendermint/tm-db" +) + +func CointrunkKeeper(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, sdk.StoreTypeIAVL, db) + stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) + require.NoError(t, stateStore.LoadLatestVersion()) + + registry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(registry) + + paramsSubspace := typesparams.NewSubspace(cdc, + types.Amino, + storeKey, + memStoreKey, + "CointrunkParams", + ) + k := keeper.NewKeeper( + cdc, + storeKey, + memStoreKey, + paramsSubspace, + nil, + nil, + ) + + ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) + + // Initialize params + k.SetParams(ctx, types.DefaultParams()) + + return k, ctx +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/index.ts new file mode 100755 index 00000000..18625c2d --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/index.ts @@ -0,0 +1,141 @@ +import { txClient, queryClient, MissingWalletError , registry} from './module' + +import { Params } from "./module/types/cointrunk/params" + + +export { Params }; + +async function initTxClient(vuexGetters) { + return await txClient(vuexGetters['common/wallet/signer'], { + addr: vuexGetters['common/env/apiTendermint'] + }) +} + +async function initQueryClient(vuexGetters) { + return await queryClient({ + addr: vuexGetters['common/env/apiCosmos'] + }) +} + +function mergeResults(value, next_values) { + for (let prop of Object.keys(next_values)) { + if (Array.isArray(next_values[prop])) { + value[prop]=[...value[prop], ...next_values[prop]] + }else{ + value[prop]=next_values[prop] + } + } + return value +} + +function getStructure(template) { + let structure = { fields: [] } + for (const [key, value] of Object.entries(template)) { + let field: any = {} + field.name = key + field.type = typeof value + structure.fields.push(field) + } + return structure +} + +const getDefaultState = () => { + return { + Params: {}, + + _Structure: { + Params: getStructure(Params.fromPartial({})), + + }, + _Registry: registry, + _Subscriptions: new Set(), + } +} + +// initial state +const state = getDefaultState() + +export default { + namespaced: true, + state, + mutations: { + RESET_STATE(state) { + Object.assign(state, getDefaultState()) + }, + QUERY(state, { query, key, value }) { + state[query][JSON.stringify(key)] = value + }, + SUBSCRIBE(state, subscription) { + state._Subscriptions.add(JSON.stringify(subscription)) + }, + UNSUBSCRIBE(state, subscription) { + state._Subscriptions.delete(JSON.stringify(subscription)) + } + }, + getters: { + getParams: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.Params[JSON.stringify(params)] ?? {} + }, + + getTypeStructure: (state) => (type) => { + return state._Structure[type].fields + }, + getRegistry: (state) => { + return state._Registry + } + }, + actions: { + init({ dispatch, rootGetters }) { + console.log('Vuex module: bzealphateam.bze.cointrunk initialized!') + if (rootGetters['common/env/client']) { + rootGetters['common/env/client'].on('newblock', () => { + dispatch('StoreUpdate') + }) + } + }, + resetState({ commit }) { + commit('RESET_STATE') + }, + unsubscribe({ commit }, subscription) { + commit('UNSUBSCRIBE', subscription) + }, + async StoreUpdate({ state, dispatch }) { + state._Subscriptions.forEach(async (subscription) => { + try { + const sub=JSON.parse(subscription) + await dispatch(sub.action, sub.payload) + }catch(e) { + throw new Error('Subscriptions: ' + e.message) + } + }) + }, + + + + + + + async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryParams()).data + + + commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) + return getters['getParams']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + + + + } +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/index.ts new file mode 100755 index 00000000..67d4b093 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/index.ts @@ -0,0 +1,57 @@ +// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient } from "@cosmjs/stargate"; +import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; +import { Api } from "./rest"; + + +const types = [ + +]; +export const MissingWalletError = new Error("wallet is required"); + +export const registry = new Registry(types); + +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string +} + +interface SignAndBroadcastOptions { + fee: StdFee, + memo?: string +} + +const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { + if (!wallet) throw MissingWalletError; + let client; + if (addr) { + client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); + }else{ + client = await SigningStargateClient.offline( wallet, { registry }); + } + const { address } = (await wallet.getAccounts())[0]; + + return { + signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + + }; +}; + +interface QueryClientOptions { + addr: string +} + +const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseUrl: addr }); +}; + +export { + txClient, + queryClient, +}; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/rest.ts new file mode 100644 index 00000000..a004970f --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/rest.ts @@ -0,0 +1,251 @@ +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** + * Params defines the parameters for the module. + */ +export interface CointrunkParams { + /** @format uint64 */ + anonArticleLimit?: string; + anonArticleCost?: string; +} + +/** + * QueryParamsResponse is response type for the Query/Params RPC method. + */ +export interface CointrunkQueryParamsResponse { + /** params holds all the parameters of this module. */ + params?: CointrunkParams; +} + +export interface ProtobufAny { + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: keyof Omit; + /** request body */ + body?: unknown; + /** base url */ + baseUrl?: string; + /** request cancellation token */ + cancelToken?: CancelToken; +} + +export type RequestParams = Omit; + +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: (securityData: SecurityDataType) => RequestParams | void; +} + +export interface HttpResponse extends Response { + data: D; + error: E; +} + +type CancelToken = Symbol | string | number; + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public baseUrl: string = ""; + private securityData: SecurityDataType = null as any; + private securityWorker: null | ApiConfig["securityWorker"] = null; + private abortControllers = new Map(); + + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; + + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } + + public setSecurityData = (data: SecurityDataType) => { + this.securityData = data; + }; + + private addQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + + return ( + encodeURIComponent(key) + + "=" + + encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) + ); + } + + protected toQueryString(rawQuery?: QueryParamsType): string { + const query = rawQuery || {}; + const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + return keys + .map((key) => + typeof query[key] === "object" && !Array.isArray(query[key]) + ? this.toQueryString(query[key] as QueryParamsType) + : this.addQueryParam(query, key), + ) + .join("&"); + } + + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? `?${queryString}` : ""; + } + + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, + [ContentType.FormData]: (input: any) => + Object.keys(input || {}).reduce((data, key) => { + data.append(key, input[key]); + return data; + }, new FormData()), + [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), + }; + + private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + if (this.abortControllers.has(cancelToken)) { + const abortController = this.abortControllers.get(cancelToken); + if (abortController) { + return abortController.signal; + } + return void 0; + } + + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; + + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); + + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; + + public request = ({ + body, + secure, + path, + type, + query, + format = "json", + baseUrl, + cancelToken, + ...params + }: FullRequestParams): Promise> => { + const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const queryString = query && this.toQueryString(query); + const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + + return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), + }).then(async (response) => { + const r = response as HttpResponse; + r.data = (null as unknown) as T; + r.error = (null as unknown) as E; + + const data = await response[format]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); + + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } + + if (!response.ok) throw data; + return data; + }); + }; +} + +/** + * @title cointrunk/genesis.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryParams + * @summary Parameters queries the parameters of the module. + * @request GET:/bzealphateam/bze/cointrunk/params + */ + queryParams = (params: RequestParams = {}) => + this.request({ + path: `/bzealphateam/bze/cointrunk/params`, + method: "GET", + format: "json", + ...params, + }); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/genesis.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/genesis.ts new file mode 100644 index 00000000..9a4ce358 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/genesis.ts @@ -0,0 +1,78 @@ +/* eslint-disable */ +import { Params } from "../cointrunk/params"; +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bzealphateam.bze.cointrunk"; + +/** GenesisState defines the cointrunk module's genesis state. */ +export interface GenesisState { + /** this line is used by starport scaffolding # genesis/proto/state */ + params: Params | undefined; +} + +const baseGenesisState: object = {}; + +export const GenesisState = { + encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/params.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/params.ts new file mode 100644 index 00000000..6807c182 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/params.ts @@ -0,0 +1,130 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bzealphateam.bze.cointrunk"; + +/** Params defines the parameters for the module. */ +export interface Params { + anonArticleLimit: number; + anonArticleCost: string; +} + +const baseParams: object = { anonArticleLimit: 0, anonArticleCost: "" }; + +export const Params = { + encode(message: Params, writer: Writer = Writer.create()): Writer { + if (message.anonArticleLimit !== 0) { + writer.uint32(8).uint64(message.anonArticleLimit); + } + if (message.anonArticleCost !== "") { + writer.uint32(18).string(message.anonArticleCost); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Params { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.anonArticleLimit = longToNumber(reader.uint64() as Long); + break; + case 2: + message.anonArticleCost = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + if ( + object.anonArticleLimit !== undefined && + object.anonArticleLimit !== null + ) { + message.anonArticleLimit = Number(object.anonArticleLimit); + } else { + message.anonArticleLimit = 0; + } + if ( + object.anonArticleCost !== undefined && + object.anonArticleCost !== null + ) { + message.anonArticleCost = String(object.anonArticleCost); + } else { + message.anonArticleCost = ""; + } + return message; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.anonArticleLimit !== undefined && + (obj.anonArticleLimit = message.anonArticleLimit); + message.anonArticleCost !== undefined && + (obj.anonArticleCost = message.anonArticleCost); + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + if ( + object.anonArticleLimit !== undefined && + object.anonArticleLimit !== null + ) { + message.anonArticleLimit = object.anonArticleLimit; + } else { + message.anonArticleLimit = 0; + } + if ( + object.anonArticleCost !== undefined && + object.anonArticleCost !== null + ) { + message.anonArticleCost = object.anonArticleCost; + } else { + message.anonArticleCost = ""; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/query.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/query.ts new file mode 100644 index 00000000..610795ed --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/query.ts @@ -0,0 +1,152 @@ +/* eslint-disable */ +import { Reader, Writer } from "protobufjs/minimal"; +import { Params } from "../cointrunk/params"; + +export const protobufPackage = "bzealphateam.bze.cointrunk"; + +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} + +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params | undefined; +} + +const baseQueryParamsRequest: object = {}; + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, +}; + +const baseQueryParamsResponse: object = {}; + +export const QueryParamsResponse = { + encode( + message: QueryParamsResponse, + writer: Writer = Writer.create() + ): Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** Parameters queries the parameters of the module. */ + Params(request: QueryParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request( + "bzealphateam.bze.cointrunk.Query", + "Params", + data + ); + return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/tx.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/tx.ts new file mode 100644 index 00000000..4a173b3b --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/tx.ts @@ -0,0 +1,20 @@ +/* eslint-disable */ +export const protobufPackage = "bzealphateam.bze.cointrunk"; + +/** Msg defines the Msg service. */ +export interface Msg {} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 00000000..9c87ac0c --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,328 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.query.v1beta1"; + +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequest { + /** + * 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. + */ + key: Uint8Array; + /** + * 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. + */ + offset: number; + /** + * 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. + */ + limit: number; + /** + * 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. + */ + count_total: boolean; + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse: boolean; +} + +/** + * 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; + * } + */ +export interface PageResponse { + /** + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently + */ + next_key: Uint8Array; + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + */ + total: number; +} + +const basePageRequest: object = { + offset: 0, + limit: 0, + count_total: false, + reverse: false, +}; + +export const PageRequest = { + encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.offset !== 0) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== 0) { + writer.uint32(24).uint64(message.limit); + } + if (message.count_total === true) { + writer.uint32(32).bool(message.count_total); + } + if (message.reverse === true) { + writer.uint32(40).bool(message.reverse); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PageRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePageRequest } as PageRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.offset = longToNumber(reader.uint64() as Long); + break; + case 3: + message.limit = longToNumber(reader.uint64() as Long); + break; + case 4: + message.count_total = reader.bool(); + break; + case 5: + message.reverse = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PageRequest { + const message = { ...basePageRequest } as PageRequest; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = Number(object.offset); + } else { + message.offset = 0; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = Number(object.limit); + } else { + message.limit = 0; + } + if (object.count_total !== undefined && object.count_total !== null) { + message.count_total = Boolean(object.count_total); + } else { + message.count_total = false; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = Boolean(object.reverse); + } else { + message.reverse = false; + } + return message; + }, + + toJSON(message: PageRequest): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array() + )); + message.offset !== undefined && (obj.offset = message.offset); + message.limit !== undefined && (obj.limit = message.limit); + message.count_total !== undefined && + (obj.count_total = message.count_total); + message.reverse !== undefined && (obj.reverse = message.reverse); + return obj; + }, + + fromPartial(object: DeepPartial): PageRequest { + const message = { ...basePageRequest } as PageRequest; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = object.offset; + } else { + message.offset = 0; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = object.limit; + } else { + message.limit = 0; + } + if (object.count_total !== undefined && object.count_total !== null) { + message.count_total = object.count_total; + } else { + message.count_total = false; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = object.reverse; + } else { + message.reverse = false; + } + return message; + }, +}; + +const basePageResponse: object = { total: 0 }; + +export const PageResponse = { + encode(message: PageResponse, writer: Writer = Writer.create()): Writer { + if (message.next_key.length !== 0) { + writer.uint32(10).bytes(message.next_key); + } + if (message.total !== 0) { + writer.uint32(16).uint64(message.total); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PageResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePageResponse } as PageResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.next_key = reader.bytes(); + break; + case 2: + message.total = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PageResponse { + const message = { ...basePageResponse } as PageResponse; + if (object.next_key !== undefined && object.next_key !== null) { + message.next_key = bytesFromBase64(object.next_key); + } + if (object.total !== undefined && object.total !== null) { + message.total = Number(object.total); + } else { + message.total = 0; + } + return message; + }, + + toJSON(message: PageResponse): unknown { + const obj: any = {}; + message.next_key !== undefined && + (obj.next_key = base64FromBytes( + message.next_key !== undefined ? message.next_key : new Uint8Array() + )); + message.total !== undefined && (obj.total = message.total); + return obj; + }, + + fromPartial(object: DeepPartial): PageResponse { + const message = { ...basePageResponse } as PageResponse; + if (object.next_key !== undefined && object.next_key !== null) { + message.next_key = object.next_key; + } else { + message.next_key = new Uint8Array(); + } + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } else { + message.total = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/gogoproto/gogo.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/gogoproto/gogo.ts new file mode 100644 index 00000000..3f41a047 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/gogoproto/gogo.ts @@ -0,0 +1,2 @@ +/* eslint-disable */ +export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/google/api/annotations.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/google/api/annotations.ts new file mode 100644 index 00000000..aace4787 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/google/api/annotations.ts @@ -0,0 +1,2 @@ +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/google/api/http.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/google/api/http.ts new file mode 100644 index 00000000..ccadff68 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/google/api/http.ts @@ -0,0 +1,706 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "google.api"; + +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path parmeters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fully_decode_reserved_expansion: boolean; +} + +/** + * `HttpRule` defines the mapping of an RPC method to one or more HTTP + * REST API methods. The mapping specifies how different portions of the RPC + * request message are mapped to URL path, URL query parameters, and + * HTTP request body. The mapping is typically specified as an + * `google.api.http` annotation on the RPC method, + * see "google/api/annotations.proto" for details. + * + * The mapping consists of a field specifying the path template and + * method kind. The path template can refer to fields in the request + * message, as in the example below which describes a REST GET + * operation on a resource collection of messages: + * + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * SubMessage sub = 2; // `sub.subfield` is url-mapped + * } + * message Message { + * string text = 1; // content of the resource + * } + * + * The same http annotation can alternatively be expressed inside the + * `GRPC API Configuration` YAML file. + * + * http: + * rules: + * - selector: .Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * This definition enables an automatic, bidrectional mapping of HTTP + * JSON to RPC. Example: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` + * + * In general, not only fields but also field paths can be referenced + * from a path pattern. Fields mapped to the path pattern cannot be + * repeated and must have a primitive (non-message) type. + * + * Any fields in the request message which are not bound by the path + * pattern automatically become (optional) HTTP query + * parameters. Assume the following definition of the request message: + * + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * int64 revision = 2; // becomes a parameter + * SubMessage sub = 3; // `sub.subfield` becomes a parameter + * } + * + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` + * + * Note that fields which are mapped to HTTP parameters must have a + * primitive type or a repeated primitive type. Message types are not + * allowed. In the case of a repeated type, the parameter can be + * repeated in the URL, as in `...?param=A¶m=B`. + * + * For HTTP method kinds which allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | RPC + * -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | RPC + * -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice of + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * + * This enables the following two alternative HTTP JSON to RPC + * mappings: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` + * + * # Rules for HTTP mapping + * + * The rules for mapping HTTP path, query parameters, and body fields + * to the request message are as follows: + * + * 1. The `body` field specifies either `*` or a field path, or is + * omitted. If omitted, it indicates there is no HTTP request body. + * 2. Leaf fields (recursive expansion of nested messages in the + * request) can be classified into three types: + * (a) Matched in the URL template. + * (b) Covered by body (if body is `*`, everything except (a) fields; + * else everything under the body field) + * (c) All other fields. + * 3. URL query parameters found in the HTTP request are mapped to (c) fields. + * 4. Any body sent with an HTTP request can contain only (b) fields. + * + * The syntax of the path template is as follows: + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single path segment. The syntax `**` matches zero + * or more path segments, which must be the last part of the path except the + * `Verb`. The syntax `LITERAL` matches literal text in the path. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path, all characters + * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the + * Discovery Document as `{var}`. + * + * If a variable contains one or more path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path, all + * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables + * show up in the Discovery Document as `{+var}`. + * + * NOTE: While the single segment variable matches the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 + * Simple String Expansion, the multi segment variable **does not** match + * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. + * + * NOTE: the field paths in variables and in the `body` must not refer to + * repeated fields or map fields. + */ +export interface HttpRule { + /** + * Selects methods to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + */ + selector: string; + /** Used for listing and getting information about resources. */ + get: string | undefined; + /** Used for updating a resource. */ + put: string | undefined; + /** Used for creating a resource. */ + post: string | undefined; + /** Used for deleting a resource. */ + delete: string | undefined; + /** Used for updating a resource. */ + patch: string | undefined; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom: CustomHttpPattern | undefined; + /** + * The name of the request field whose value is mapped to the HTTP body, or + * `*` for mapping all fields not captured by the path pattern to the HTTP + * body. NOTE: the referred field must not be a repeated field and must be + * present at the top-level of request message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * body of response. Other response fields are ignored. When + * not set, the response message will be used as HTTP body of response. + */ + response_body: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additional_bindings: HttpRule[]; +} + +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPattern { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} + +const baseHttp: object = { fully_decode_reserved_expansion: false }; + +export const Http = { + encode(message: Http, writer: Writer = Writer.create()): Writer { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fully_decode_reserved_expansion === true) { + writer.uint32(16).bool(message.fully_decode_reserved_expansion); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Http { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHttp } as Http; + message.rules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rules.push(HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fully_decode_reserved_expansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromJSON(e)); + } + } + if ( + object.fully_decode_reserved_expansion !== undefined && + object.fully_decode_reserved_expansion !== null + ) { + message.fully_decode_reserved_expansion = Boolean( + object.fully_decode_reserved_expansion + ); + } else { + message.fully_decode_reserved_expansion = false; + } + return message; + }, + + toJSON(message: Http): unknown { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map((e) => + e ? HttpRule.toJSON(e) : undefined + ); + } else { + obj.rules = []; + } + message.fully_decode_reserved_expansion !== undefined && + (obj.fully_decode_reserved_expansion = + message.fully_decode_reserved_expansion); + return obj; + }, + + fromPartial(object: DeepPartial): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromPartial(e)); + } + } + if ( + object.fully_decode_reserved_expansion !== undefined && + object.fully_decode_reserved_expansion !== null + ) { + message.fully_decode_reserved_expansion = + object.fully_decode_reserved_expansion; + } else { + message.fully_decode_reserved_expansion = false; + } + return message; + }, +}; + +const baseHttpRule: object = { selector: "", body: "", response_body: "" }; + +export const HttpRule = { + encode(message: HttpRule, writer: Writer = Writer.create()): Writer { + if (message.selector !== "") { + writer.uint32(10).string(message.selector); + } + if (message.get !== undefined) { + writer.uint32(18).string(message.get); + } + if (message.put !== undefined) { + writer.uint32(26).string(message.put); + } + if (message.post !== undefined) { + writer.uint32(34).string(message.post); + } + if (message.delete !== undefined) { + writer.uint32(42).string(message.delete); + } + if (message.patch !== undefined) { + writer.uint32(50).string(message.patch); + } + if (message.custom !== undefined) { + CustomHttpPattern.encode( + message.custom, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.body !== "") { + writer.uint32(58).string(message.body); + } + if (message.response_body !== "") { + writer.uint32(98).string(message.response_body); + } + for (const v of message.additional_bindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): HttpRule { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message.delete = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.response_body = reader.string(); + break; + case 11: + message.additional_bindings.push( + HttpRule.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = String(object.selector); + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = String(object.get); + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = String(object.put); + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = String(object.post); + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = String(object.delete); + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = String(object.patch); + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromJSON(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = String(object.body); + } else { + message.body = ""; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.response_body = String(object.response_body); + } else { + message.response_body = ""; + } + if ( + object.additional_bindings !== undefined && + object.additional_bindings !== null + ) { + for (const e of object.additional_bindings) { + message.additional_bindings.push(HttpRule.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: HttpRule): unknown { + const obj: any = {}; + message.selector !== undefined && (obj.selector = message.selector); + message.get !== undefined && (obj.get = message.get); + message.put !== undefined && (obj.put = message.put); + message.post !== undefined && (obj.post = message.post); + message.delete !== undefined && (obj.delete = message.delete); + message.patch !== undefined && (obj.patch = message.patch); + message.custom !== undefined && + (obj.custom = message.custom + ? CustomHttpPattern.toJSON(message.custom) + : undefined); + message.body !== undefined && (obj.body = message.body); + message.response_body !== undefined && + (obj.response_body = message.response_body); + if (message.additional_bindings) { + obj.additional_bindings = message.additional_bindings.map((e) => + e ? HttpRule.toJSON(e) : undefined + ); + } else { + obj.additional_bindings = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromPartial(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } else { + message.body = ""; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.response_body = object.response_body; + } else { + message.response_body = ""; + } + if ( + object.additional_bindings !== undefined && + object.additional_bindings !== null + ) { + for (const e of object.additional_bindings) { + message.additional_bindings.push(HttpRule.fromPartial(e)); + } + } + return message; + }, +}; + +const baseCustomHttpPattern: object = { kind: "", path: "" }; + +export const CustomHttpPattern = { + encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + if (message.kind !== "") { + writer.uint32(10).string(message.kind); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = String(object.kind); + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = String(object.path); + } else { + message.path = ""; + } + return message; + }, + + toJSON(message: CustomHttpPattern): unknown { + const obj: any = {}; + message.kind !== undefined && (obj.kind = message.kind); + message.path !== undefined && (obj.path = message.path); + return obj; + }, + + fromPartial(object: DeepPartial): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/google/protobuf/descriptor.ts new file mode 100644 index 00000000..a0167cb2 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/google/protobuf/descriptor.ts @@ -0,0 +1,5314 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} + +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name: string; + /** e.g. "foo", "foo.bar", etc. */ + package: string; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + public_dependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weak_dependency: number[]; + /** All top-level definitions in this file. */ + message_type: DescriptorProto[]; + enum_type: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options: FileOptions | undefined; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + source_code_info: SourceCodeInfo | undefined; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax: string; +} + +/** Describes a message type. */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nested_type: DescriptorProto[]; + enum_type: EnumDescriptorProto[]; + extension_range: DescriptorProto_ExtensionRange[]; + oneof_decl: OneofDescriptorProto[]; + options: MessageOptions | undefined; + reserved_range: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reserved_name: string[]; +} + +export interface DescriptorProto_ExtensionRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; + options: ExtensionRangeOptions | undefined; +} + +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; +} + +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + type_name: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * TODO(kenton): Base-64 encode? + */ + default_value: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneof_index: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + json_name: string; + options: FieldOptions | undefined; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + */ + proto3_optional: boolean; +} + +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_TypeFromJSON( + object: any +): FieldDescriptorProto_Type { + switch (object) { + case 1: + case "TYPE_DOUBLE": + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case "TYPE_FLOAT": + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case "TYPE_INT64": + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case "TYPE_UINT64": + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case "TYPE_INT32": + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case "TYPE_FIXED64": + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case "TYPE_FIXED32": + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case "TYPE_BOOL": + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case "TYPE_STRING": + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case "TYPE_GROUP": + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case "TYPE_MESSAGE": + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case "TYPE_BYTES": + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case "TYPE_UINT32": + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case "TYPE_ENUM": + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case "TYPE_SFIXED32": + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case "TYPE_SFIXED64": + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case "TYPE_SINT32": + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case "TYPE_SINT64": + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_TypeToJSON( + object: FieldDescriptorProto_Type +): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return "TYPE_DOUBLE"; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return "TYPE_FLOAT"; + case FieldDescriptorProto_Type.TYPE_INT64: + return "TYPE_INT64"; + case FieldDescriptorProto_Type.TYPE_UINT64: + return "TYPE_UINT64"; + case FieldDescriptorProto_Type.TYPE_INT32: + return "TYPE_INT32"; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return "TYPE_FIXED64"; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return "TYPE_FIXED32"; + case FieldDescriptorProto_Type.TYPE_BOOL: + return "TYPE_BOOL"; + case FieldDescriptorProto_Type.TYPE_STRING: + return "TYPE_STRING"; + case FieldDescriptorProto_Type.TYPE_GROUP: + return "TYPE_GROUP"; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return "TYPE_MESSAGE"; + case FieldDescriptorProto_Type.TYPE_BYTES: + return "TYPE_BYTES"; + case FieldDescriptorProto_Type.TYPE_UINT32: + return "TYPE_UINT32"; + case FieldDescriptorProto_Type.TYPE_ENUM: + return "TYPE_ENUM"; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return "TYPE_SFIXED32"; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return "TYPE_SFIXED64"; + case FieldDescriptorProto_Type.TYPE_SINT32: + return "TYPE_SINT32"; + case FieldDescriptorProto_Type.TYPE_SINT64: + return "TYPE_SINT64"; + default: + return "UNKNOWN"; + } +} + +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_LabelFromJSON( + object: any +): FieldDescriptorProto_Label { + switch (object) { + case 1: + case "LABEL_OPTIONAL": + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_LabelToJSON( + object: FieldDescriptorProto_Label +): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return "LABEL_OPTIONAL"; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + default: + return "UNKNOWN"; + } +} + +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name: string; + options: OneofOptions | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: EnumOptions | undefined; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reserved_range: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reserved_name: string[]; +} + +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} + +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options: EnumValueOptions | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + input_type: string; + output_type: string; + options: MethodOptions | undefined; + /** Identifies if client streams multiple client messages */ + client_streaming: boolean; + /** Identifies if server streams multiple server messages */ + server_streaming: boolean; +} + +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + java_package: string; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + */ + java_outer_classname: string; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + java_multiple_files: boolean; + /** + * This option does nothing. + * + * @deprecated + */ + java_generate_equals_and_hash: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + java_string_check_utf8: boolean; + optimize_for: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + go_package: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + cc_generic_services: boolean; + java_generic_services: boolean; + py_generic_services: boolean; + php_generic_services: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + cc_enable_arenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objc_class_prefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharp_namespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swift_prefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + php_class_prefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + php_namespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + php_metadata_namespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + ruby_package: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpreted_option: UninterpretedOption[]; +} + +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, */ + SPEED = 1, + /** CODE_SIZE - etc. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} + +export function fileOptions_OptimizeModeFromJSON( + object: any +): FileOptions_OptimizeMode { + switch (object) { + case 1: + case "SPEED": + return FileOptions_OptimizeMode.SPEED; + case 2: + case "CODE_SIZE": + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case "LITE_RUNTIME": + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} + +export function fileOptions_OptimizeModeToJSON( + object: FileOptions_OptimizeMode +): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return "SPEED"; + case FileOptions_OptimizeMode.CODE_SIZE: + return "CODE_SIZE"; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return "LITE_RUNTIME"; + default: + return "UNKNOWN"; + } +} + +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + message_set_wire_format: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + no_standard_descriptor_accessor: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + map_entry: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + */ + lazy: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated: boolean; + /** For Google-internal migration only. Do not use. */ + weak: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case "STRING": + return FieldOptions_CType.STRING; + case 1: + case "CORD": + return FieldOptions_CType.CORD; + case 2: + case "STRING_PIECE": + return FieldOptions_CType.STRING_PIECE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} + +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return "STRING"; + case FieldOptions_CType.CORD: + return "CORD"; + case FieldOptions_CType.STRING_PIECE: + return "STRING_PIECE"; + default: + return "UNKNOWN"; + } +} + +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case "JS_NORMAL": + return FieldOptions_JSType.JS_NORMAL; + case 1: + case "JS_STRING": + return FieldOptions_JSType.JS_STRING; + case 2: + case "JS_NUMBER": + return FieldOptions_JSType.JS_NUMBER; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} + +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return "JS_NORMAL"; + case FieldOptions_JSType.JS_STRING: + return "JS_STRING"; + case FieldOptions_JSType.JS_NUMBER: + return "JS_NUMBER"; + default: + return "UNKNOWN"; + } +} + +export interface OneofOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allow_alias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface ServiceOptions { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated: boolean; + idempotency_level: MethodOptions_IdempotencyLevel; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} + +export function methodOptions_IdempotencyLevelFromJSON( + object: any +): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case "IDEMPOTENCY_UNKNOWN": + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case "NO_SIDE_EFFECTS": + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case "IDEMPOTENT": + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case "UNRECOGNIZED": + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} + +export function methodOptions_IdempotencyLevelToJSON( + object: MethodOptions_IdempotencyLevel +): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return "IDEMPOTENCY_UNKNOWN"; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return "NO_SIDE_EFFECTS"; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return "IDEMPOTENT"; + default: + return "UNKNOWN"; + } +} + +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifier_value: string; + positive_int_value: number; + negative_int_value: number; + double_value: number; + string_value: Uint8Array; + aggregate_value: string; +} + +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePart { + name_part: string; + is_extension: boolean; +} + +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} + +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition. For + * example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. * / + * /* Block comment attached to + * * grault. * / + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leading_comments: string; + trailing_comments: string; + leading_detached_comments: string[]; +} + +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} + +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + source_file: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end: number; +} + +const baseFileDescriptorSet: object = {}; + +export const FileDescriptorSet = { + encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.file.push( + FileDescriptorProto.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FileDescriptorSet): unknown { + const obj: any = {}; + if (message.file) { + obj.file = message.file.map((e) => + e ? FileDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.file = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFileDescriptorProto: object = { + name: "", + package: "", + dependency: "", + public_dependency: 0, + weak_dependency: 0, + syntax: "", +}; + +export const FileDescriptorProto = { + encode( + message: FileDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.package !== "") { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.public_dependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weak_dependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.message_type) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enum_type) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.source_code_info !== undefined) { + SourceCodeInfo.encode( + message.source_code_info, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.syntax !== "") { + writer.uint32(98).string(message.syntax); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.package = reader.string(); + break; + case 3: + message.dependency.push(reader.string()); + break; + case 10: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.public_dependency.push(reader.int32()); + } + } else { + message.public_dependency.push(reader.int32()); + } + break; + case 11: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weak_dependency.push(reader.int32()); + } + } else { + message.weak_dependency.push(reader.int32()); + } + break; + case 4: + message.message_type.push( + DescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 5: + message.enum_type.push( + EnumDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 6: + message.service.push( + ServiceDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 7: + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 8: + message.options = FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.source_code_info = SourceCodeInfo.decode( + reader, + reader.uint32() + ); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = String(object.package); + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(String(e)); + } + } + if ( + object.public_dependency !== undefined && + object.public_dependency !== null + ) { + for (const e of object.public_dependency) { + message.public_dependency.push(Number(e)); + } + } + if ( + object.weak_dependency !== undefined && + object.weak_dependency !== null + ) { + for (const e of object.weak_dependency) { + message.weak_dependency.push(Number(e)); + } + } + if (object.message_type !== undefined && object.message_type !== null) { + for (const e of object.message_type) { + message.message_type.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromJSON(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.source_code_info !== undefined && + object.source_code_info !== null + ) { + message.source_code_info = SourceCodeInfo.fromJSON( + object.source_code_info + ); + } else { + message.source_code_info = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = String(object.syntax); + } else { + message.syntax = ""; + } + return message; + }, + + toJSON(message: FileDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.package !== undefined && (obj.package = message.package); + if (message.dependency) { + obj.dependency = message.dependency.map((e) => e); + } else { + obj.dependency = []; + } + if (message.public_dependency) { + obj.public_dependency = message.public_dependency.map((e) => e); + } else { + obj.public_dependency = []; + } + if (message.weak_dependency) { + obj.weak_dependency = message.weak_dependency.map((e) => e); + } else { + obj.weak_dependency = []; + } + if (message.message_type) { + obj.message_type = message.message_type.map((e) => + e ? DescriptorProto.toJSON(e) : undefined + ); + } else { + obj.message_type = []; + } + if (message.enum_type) { + obj.enum_type = message.enum_type.map((e) => + e ? EnumDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.enum_type = []; + } + if (message.service) { + obj.service = message.service.map((e) => + e ? ServiceDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.service = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.extension = []; + } + message.options !== undefined && + (obj.options = message.options + ? FileOptions.toJSON(message.options) + : undefined); + message.source_code_info !== undefined && + (obj.source_code_info = message.source_code_info + ? SourceCodeInfo.toJSON(message.source_code_info) + : undefined); + message.syntax !== undefined && (obj.syntax = message.syntax); + return obj; + }, + + fromPartial(object: DeepPartial): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(e); + } + } + if ( + object.public_dependency !== undefined && + object.public_dependency !== null + ) { + for (const e of object.public_dependency) { + message.public_dependency.push(e); + } + } + if ( + object.weak_dependency !== undefined && + object.weak_dependency !== null + ) { + for (const e of object.weak_dependency) { + message.weak_dependency.push(e); + } + } + if (object.message_type !== undefined && object.message_type !== null) { + for (const e of object.message_type) { + message.message_type.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromPartial(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.source_code_info !== undefined && + object.source_code_info !== null + ) { + message.source_code_info = SourceCodeInfo.fromPartial( + object.source_code_info + ); + } else { + message.source_code_info = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } else { + message.syntax = ""; + } + return message; + }, +}; + +const baseDescriptorProto: object = { name: "", reserved_name: "" }; + +export const DescriptorProto = { + encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nested_type) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enum_type) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extension_range) { + DescriptorProto_ExtensionRange.encode( + v!, + writer.uint32(42).fork() + ).ldelim(); + } + for (const v of message.oneof_decl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reserved_range) { + DescriptorProto_ReservedRange.encode( + v!, + writer.uint32(74).fork() + ).ldelim(); + } + for (const v of message.reserved_name) { + writer.uint32(82).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.field.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 6: + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.nested_type.push( + DescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 4: + message.enum_type.push( + EnumDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 5: + message.extension_range.push( + DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) + ); + break; + case 8: + message.oneof_decl.push( + OneofDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 7: + message.options = MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + message.reserved_range.push( + DescriptorProto_ReservedRange.decode(reader, reader.uint32()) + ); + break; + case 10: + message.reserved_name.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.nested_type !== undefined && object.nested_type !== null) { + for (const e of object.nested_type) { + message.nested_type.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromJSON(e)); + } + } + if ( + object.extension_range !== undefined && + object.extension_range !== null + ) { + for (const e of object.extension_range) { + message.extension_range.push( + DescriptorProto_ExtensionRange.fromJSON(e) + ); + } + } + if (object.oneof_decl !== undefined && object.oneof_decl !== null) { + for (const e of object.oneof_decl) { + message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(String(e)); + } + } + return message; + }, + + toJSON(message: DescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.field) { + obj.field = message.field.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.field = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.extension = []; + } + if (message.nested_type) { + obj.nested_type = message.nested_type.map((e) => + e ? DescriptorProto.toJSON(e) : undefined + ); + } else { + obj.nested_type = []; + } + if (message.enum_type) { + obj.enum_type = message.enum_type.map((e) => + e ? EnumDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.enum_type = []; + } + if (message.extension_range) { + obj.extension_range = message.extension_range.map((e) => + e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined + ); + } else { + obj.extension_range = []; + } + if (message.oneof_decl) { + obj.oneof_decl = message.oneof_decl.map((e) => + e ? OneofDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.oneof_decl = []; + } + message.options !== undefined && + (obj.options = message.options + ? MessageOptions.toJSON(message.options) + : undefined); + if (message.reserved_range) { + obj.reserved_range = message.reserved_range.map((e) => + e ? DescriptorProto_ReservedRange.toJSON(e) : undefined + ); + } else { + obj.reserved_range = []; + } + if (message.reserved_name) { + obj.reserved_name = message.reserved_name.map((e) => e); + } else { + obj.reserved_name = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.nested_type !== undefined && object.nested_type !== null) { + for (const e of object.nested_type) { + message.nested_type.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromPartial(e)); + } + } + if ( + object.extension_range !== undefined && + object.extension_range !== null + ) { + for (const e of object.extension_range) { + message.extension_range.push( + DescriptorProto_ExtensionRange.fromPartial(e) + ); + } + } + if (object.oneof_decl !== undefined && object.oneof_decl !== null) { + for (const e of object.oneof_decl) { + message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + DescriptorProto_ReservedRange.fromPartial(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(e); + } + } + return message; + }, +}; + +const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; + +export const DescriptorProto_ExtensionRange = { + encode( + message: DescriptorProto_ExtensionRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode( + message.options, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): DescriptorProto_ExtensionRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = ExtensionRangeOptions.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ExtensionRange { + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: DescriptorProto_ExtensionRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + message.options !== undefined && + (obj.options = message.options + ? ExtensionRangeOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): DescriptorProto_ExtensionRange { + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; + +export const DescriptorProto_ReservedRange = { + encode( + message: DescriptorProto_ReservedRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): DescriptorProto_ReservedRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ReservedRange { + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: DescriptorProto_ReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): DescriptorProto_ReservedRange { + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +const baseExtensionRangeOptions: object = {}; + +export const ExtensionRangeOptions = { + encode( + message: ExtensionRangeOptions, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ExtensionRangeOptions): unknown { + const obj: any = {}; + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial( + object: DeepPartial + ): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFieldDescriptorProto: object = { + name: "", + number: 0, + label: 1, + type: 1, + type_name: "", + extendee: "", + default_value: "", + oneof_index: 0, + json_name: "", + proto3_optional: false, +}; + +export const FieldDescriptorProto = { + encode( + message: FieldDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.type_name !== "") { + writer.uint32(50).string(message.type_name); + } + if (message.extendee !== "") { + writer.uint32(18).string(message.extendee); + } + if (message.default_value !== "") { + writer.uint32(58).string(message.default_value); + } + if (message.oneof_index !== 0) { + writer.uint32(72).int32(message.oneof_index); + } + if (message.json_name !== "") { + writer.uint32(82).string(message.json_name); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.proto3_optional === true) { + writer.uint32(136).bool(message.proto3_optional); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32() as any; + break; + case 5: + message.type = reader.int32() as any; + break; + case 6: + message.type_name = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.default_value = reader.string(); + break; + case 9: + message.oneof_index = reader.int32(); + break; + case 10: + message.json_name = reader.string(); + break; + case 8: + message.options = FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3_optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = fieldDescriptorProto_LabelFromJSON(object.label); + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = fieldDescriptorProto_TypeFromJSON(object.type); + } else { + message.type = 1; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.type_name = String(object.type_name); + } else { + message.type_name = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = String(object.extendee); + } else { + message.extendee = ""; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.default_value = String(object.default_value); + } else { + message.default_value = ""; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneof_index = Number(object.oneof_index); + } else { + message.oneof_index = 0; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.json_name = String(object.json_name); + } else { + message.json_name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.proto3_optional !== undefined && + object.proto3_optional !== null + ) { + message.proto3_optional = Boolean(object.proto3_optional); + } else { + message.proto3_optional = false; + } + return message; + }, + + toJSON(message: FieldDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.label !== undefined && + (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); + message.type !== undefined && + (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); + message.type_name !== undefined && (obj.type_name = message.type_name); + message.extendee !== undefined && (obj.extendee = message.extendee); + message.default_value !== undefined && + (obj.default_value = message.default_value); + message.oneof_index !== undefined && + (obj.oneof_index = message.oneof_index); + message.json_name !== undefined && (obj.json_name = message.json_name); + message.options !== undefined && + (obj.options = message.options + ? FieldOptions.toJSON(message.options) + : undefined); + message.proto3_optional !== undefined && + (obj.proto3_optional = message.proto3_optional); + return obj; + }, + + fromPartial(object: DeepPartial): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 1; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.type_name = object.type_name; + } else { + message.type_name = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } else { + message.extendee = ""; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.default_value = object.default_value; + } else { + message.default_value = ""; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneof_index = object.oneof_index; + } else { + message.oneof_index = 0; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.json_name = object.json_name; + } else { + message.json_name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.proto3_optional !== undefined && + object.proto3_optional !== null + ) { + message.proto3_optional = object.proto3_optional; + } else { + message.proto3_optional = false; + } + return message; + }, +}; + +const baseOneofDescriptorProto: object = { name: "" }; + +export const OneofDescriptorProto = { + encode( + message: OneofDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: OneofDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.options !== undefined && + (obj.options = message.options + ? OneofOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; + +export const EnumDescriptorProto = { + encode( + message: EnumDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reserved_range) { + EnumDescriptorProto_EnumReservedRange.encode( + v!, + writer.uint32(34).fork() + ).ldelim(); + } + for (const v of message.reserved_name) { + writer.uint32(42).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value.push( + EnumValueDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.options = EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.decode( + reader, + reader.uint32() + ) + ); + break; + case 5: + message.reserved_name.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.fromJSON(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(String(e)); + } + } + return message; + }, + + toJSON(message: EnumDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.value) { + obj.value = message.value.map((e) => + e ? EnumValueDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.value = []; + } + message.options !== undefined && + (obj.options = message.options + ? EnumOptions.toJSON(message.options) + : undefined); + if (message.reserved_range) { + obj.reserved_range = message.reserved_range.map((e) => + e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined + ); + } else { + obj.reserved_range = []; + } + if (message.reserved_name) { + obj.reserved_name = message.reserved_name.map((e) => e); + } else { + obj.reserved_name = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.fromPartial(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(e); + } + } + return message; + }, +}; + +const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; + +export const EnumDescriptorProto_EnumReservedRange = { + encode( + message: EnumDescriptorProto_EnumReservedRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): EnumDescriptorProto_EnumReservedRange { + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; + +export const EnumValueDescriptorProto = { + encode( + message: EnumValueDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode( + message.options, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): EnumValueDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumValueDescriptorProto { + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: EnumValueDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.options !== undefined && + (obj.options = message.options + ? EnumValueOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): EnumValueDescriptorProto { + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseServiceDescriptorProto: object = { name: "" }; + +export const ServiceDescriptorProto = { + encode( + message: ServiceDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.method.push( + MethodDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.options = ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: ServiceDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.method) { + obj.method = message.method.map((e) => + e ? MethodDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.method = []; + } + message.options !== undefined && + (obj.options = message.options + ? ServiceOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseMethodDescriptorProto: object = { + name: "", + input_type: "", + output_type: "", + client_streaming: false, + server_streaming: false, +}; + +export const MethodDescriptorProto = { + encode( + message: MethodDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.input_type !== "") { + writer.uint32(18).string(message.input_type); + } + if (message.output_type !== "") { + writer.uint32(26).string(message.output_type); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + if (message.client_streaming === true) { + writer.uint32(40).bool(message.client_streaming); + } + if (message.server_streaming === true) { + writer.uint32(48).bool(message.server_streaming); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.input_type = reader.string(); + break; + case 3: + message.output_type = reader.string(); + break; + case 4: + message.options = MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.client_streaming = reader.bool(); + break; + case 6: + message.server_streaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.input_type = String(object.input_type); + } else { + message.input_type = ""; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.output_type = String(object.output_type); + } else { + message.output_type = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.client_streaming !== undefined && + object.client_streaming !== null + ) { + message.client_streaming = Boolean(object.client_streaming); + } else { + message.client_streaming = false; + } + if ( + object.server_streaming !== undefined && + object.server_streaming !== null + ) { + message.server_streaming = Boolean(object.server_streaming); + } else { + message.server_streaming = false; + } + return message; + }, + + toJSON(message: MethodDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.input_type !== undefined && (obj.input_type = message.input_type); + message.output_type !== undefined && + (obj.output_type = message.output_type); + message.options !== undefined && + (obj.options = message.options + ? MethodOptions.toJSON(message.options) + : undefined); + message.client_streaming !== undefined && + (obj.client_streaming = message.client_streaming); + message.server_streaming !== undefined && + (obj.server_streaming = message.server_streaming); + return obj; + }, + + fromPartial( + object: DeepPartial + ): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.input_type = object.input_type; + } else { + message.input_type = ""; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.output_type = object.output_type; + } else { + message.output_type = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.client_streaming !== undefined && + object.client_streaming !== null + ) { + message.client_streaming = object.client_streaming; + } else { + message.client_streaming = false; + } + if ( + object.server_streaming !== undefined && + object.server_streaming !== null + ) { + message.server_streaming = object.server_streaming; + } else { + message.server_streaming = false; + } + return message; + }, +}; + +const baseFileOptions: object = { + java_package: "", + java_outer_classname: "", + java_multiple_files: false, + java_generate_equals_and_hash: false, + java_string_check_utf8: false, + optimize_for: 1, + go_package: "", + cc_generic_services: false, + java_generic_services: false, + py_generic_services: false, + php_generic_services: false, + deprecated: false, + cc_enable_arenas: false, + objc_class_prefix: "", + csharp_namespace: "", + swift_prefix: "", + php_class_prefix: "", + php_namespace: "", + php_metadata_namespace: "", + ruby_package: "", +}; + +export const FileOptions = { + encode(message: FileOptions, writer: Writer = Writer.create()): Writer { + if (message.java_package !== "") { + writer.uint32(10).string(message.java_package); + } + if (message.java_outer_classname !== "") { + writer.uint32(66).string(message.java_outer_classname); + } + if (message.java_multiple_files === true) { + writer.uint32(80).bool(message.java_multiple_files); + } + if (message.java_generate_equals_and_hash === true) { + writer.uint32(160).bool(message.java_generate_equals_and_hash); + } + if (message.java_string_check_utf8 === true) { + writer.uint32(216).bool(message.java_string_check_utf8); + } + if (message.optimize_for !== 1) { + writer.uint32(72).int32(message.optimize_for); + } + if (message.go_package !== "") { + writer.uint32(90).string(message.go_package); + } + if (message.cc_generic_services === true) { + writer.uint32(128).bool(message.cc_generic_services); + } + if (message.java_generic_services === true) { + writer.uint32(136).bool(message.java_generic_services); + } + if (message.py_generic_services === true) { + writer.uint32(144).bool(message.py_generic_services); + } + if (message.php_generic_services === true) { + writer.uint32(336).bool(message.php_generic_services); + } + if (message.deprecated === true) { + writer.uint32(184).bool(message.deprecated); + } + if (message.cc_enable_arenas === true) { + writer.uint32(248).bool(message.cc_enable_arenas); + } + if (message.objc_class_prefix !== "") { + writer.uint32(290).string(message.objc_class_prefix); + } + if (message.csharp_namespace !== "") { + writer.uint32(298).string(message.csharp_namespace); + } + if (message.swift_prefix !== "") { + writer.uint32(314).string(message.swift_prefix); + } + if (message.php_class_prefix !== "") { + writer.uint32(322).string(message.php_class_prefix); + } + if (message.php_namespace !== "") { + writer.uint32(330).string(message.php_namespace); + } + if (message.php_metadata_namespace !== "") { + writer.uint32(354).string(message.php_metadata_namespace); + } + if (message.ruby_package !== "") { + writer.uint32(362).string(message.ruby_package); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.java_package = reader.string(); + break; + case 8: + message.java_outer_classname = reader.string(); + break; + case 10: + message.java_multiple_files = reader.bool(); + break; + case 20: + message.java_generate_equals_and_hash = reader.bool(); + break; + case 27: + message.java_string_check_utf8 = reader.bool(); + break; + case 9: + message.optimize_for = reader.int32() as any; + break; + case 11: + message.go_package = reader.string(); + break; + case 16: + message.cc_generic_services = reader.bool(); + break; + case 17: + message.java_generic_services = reader.bool(); + break; + case 18: + message.py_generic_services = reader.bool(); + break; + case 42: + message.php_generic_services = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.cc_enable_arenas = reader.bool(); + break; + case 36: + message.objc_class_prefix = reader.string(); + break; + case 37: + message.csharp_namespace = reader.string(); + break; + case 39: + message.swift_prefix = reader.string(); + break; + case 40: + message.php_class_prefix = reader.string(); + break; + case 41: + message.php_namespace = reader.string(); + break; + case 44: + message.php_metadata_namespace = reader.string(); + break; + case 45: + message.ruby_package = reader.string(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + if (object.java_package !== undefined && object.java_package !== null) { + message.java_package = String(object.java_package); + } else { + message.java_package = ""; + } + if ( + object.java_outer_classname !== undefined && + object.java_outer_classname !== null + ) { + message.java_outer_classname = String(object.java_outer_classname); + } else { + message.java_outer_classname = ""; + } + if ( + object.java_multiple_files !== undefined && + object.java_multiple_files !== null + ) { + message.java_multiple_files = Boolean(object.java_multiple_files); + } else { + message.java_multiple_files = false; + } + if ( + object.java_generate_equals_and_hash !== undefined && + object.java_generate_equals_and_hash !== null + ) { + message.java_generate_equals_and_hash = Boolean( + object.java_generate_equals_and_hash + ); + } else { + message.java_generate_equals_and_hash = false; + } + if ( + object.java_string_check_utf8 !== undefined && + object.java_string_check_utf8 !== null + ) { + message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); + } else { + message.java_string_check_utf8 = false; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimize_for = fileOptions_OptimizeModeFromJSON( + object.optimize_for + ); + } else { + message.optimize_for = 1; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.go_package = String(object.go_package); + } else { + message.go_package = ""; + } + if ( + object.cc_generic_services !== undefined && + object.cc_generic_services !== null + ) { + message.cc_generic_services = Boolean(object.cc_generic_services); + } else { + message.cc_generic_services = false; + } + if ( + object.java_generic_services !== undefined && + object.java_generic_services !== null + ) { + message.java_generic_services = Boolean(object.java_generic_services); + } else { + message.java_generic_services = false; + } + if ( + object.py_generic_services !== undefined && + object.py_generic_services !== null + ) { + message.py_generic_services = Boolean(object.py_generic_services); + } else { + message.py_generic_services = false; + } + if ( + object.php_generic_services !== undefined && + object.php_generic_services !== null + ) { + message.php_generic_services = Boolean(object.php_generic_services); + } else { + message.php_generic_services = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.cc_enable_arenas !== undefined && + object.cc_enable_arenas !== null + ) { + message.cc_enable_arenas = Boolean(object.cc_enable_arenas); + } else { + message.cc_enable_arenas = false; + } + if ( + object.objc_class_prefix !== undefined && + object.objc_class_prefix !== null + ) { + message.objc_class_prefix = String(object.objc_class_prefix); + } else { + message.objc_class_prefix = ""; + } + if ( + object.csharp_namespace !== undefined && + object.csharp_namespace !== null + ) { + message.csharp_namespace = String(object.csharp_namespace); + } else { + message.csharp_namespace = ""; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swift_prefix = String(object.swift_prefix); + } else { + message.swift_prefix = ""; + } + if ( + object.php_class_prefix !== undefined && + object.php_class_prefix !== null + ) { + message.php_class_prefix = String(object.php_class_prefix); + } else { + message.php_class_prefix = ""; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.php_namespace = String(object.php_namespace); + } else { + message.php_namespace = ""; + } + if ( + object.php_metadata_namespace !== undefined && + object.php_metadata_namespace !== null + ) { + message.php_metadata_namespace = String(object.php_metadata_namespace); + } else { + message.php_metadata_namespace = ""; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.ruby_package = String(object.ruby_package); + } else { + message.ruby_package = ""; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FileOptions): unknown { + const obj: any = {}; + message.java_package !== undefined && + (obj.java_package = message.java_package); + message.java_outer_classname !== undefined && + (obj.java_outer_classname = message.java_outer_classname); + message.java_multiple_files !== undefined && + (obj.java_multiple_files = message.java_multiple_files); + message.java_generate_equals_and_hash !== undefined && + (obj.java_generate_equals_and_hash = + message.java_generate_equals_and_hash); + message.java_string_check_utf8 !== undefined && + (obj.java_string_check_utf8 = message.java_string_check_utf8); + message.optimize_for !== undefined && + (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); + message.go_package !== undefined && (obj.go_package = message.go_package); + message.cc_generic_services !== undefined && + (obj.cc_generic_services = message.cc_generic_services); + message.java_generic_services !== undefined && + (obj.java_generic_services = message.java_generic_services); + message.py_generic_services !== undefined && + (obj.py_generic_services = message.py_generic_services); + message.php_generic_services !== undefined && + (obj.php_generic_services = message.php_generic_services); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.cc_enable_arenas !== undefined && + (obj.cc_enable_arenas = message.cc_enable_arenas); + message.objc_class_prefix !== undefined && + (obj.objc_class_prefix = message.objc_class_prefix); + message.csharp_namespace !== undefined && + (obj.csharp_namespace = message.csharp_namespace); + message.swift_prefix !== undefined && + (obj.swift_prefix = message.swift_prefix); + message.php_class_prefix !== undefined && + (obj.php_class_prefix = message.php_class_prefix); + message.php_namespace !== undefined && + (obj.php_namespace = message.php_namespace); + message.php_metadata_namespace !== undefined && + (obj.php_metadata_namespace = message.php_metadata_namespace); + message.ruby_package !== undefined && + (obj.ruby_package = message.ruby_package); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + if (object.java_package !== undefined && object.java_package !== null) { + message.java_package = object.java_package; + } else { + message.java_package = ""; + } + if ( + object.java_outer_classname !== undefined && + object.java_outer_classname !== null + ) { + message.java_outer_classname = object.java_outer_classname; + } else { + message.java_outer_classname = ""; + } + if ( + object.java_multiple_files !== undefined && + object.java_multiple_files !== null + ) { + message.java_multiple_files = object.java_multiple_files; + } else { + message.java_multiple_files = false; + } + if ( + object.java_generate_equals_and_hash !== undefined && + object.java_generate_equals_and_hash !== null + ) { + message.java_generate_equals_and_hash = + object.java_generate_equals_and_hash; + } else { + message.java_generate_equals_and_hash = false; + } + if ( + object.java_string_check_utf8 !== undefined && + object.java_string_check_utf8 !== null + ) { + message.java_string_check_utf8 = object.java_string_check_utf8; + } else { + message.java_string_check_utf8 = false; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimize_for = object.optimize_for; + } else { + message.optimize_for = 1; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.go_package = object.go_package; + } else { + message.go_package = ""; + } + if ( + object.cc_generic_services !== undefined && + object.cc_generic_services !== null + ) { + message.cc_generic_services = object.cc_generic_services; + } else { + message.cc_generic_services = false; + } + if ( + object.java_generic_services !== undefined && + object.java_generic_services !== null + ) { + message.java_generic_services = object.java_generic_services; + } else { + message.java_generic_services = false; + } + if ( + object.py_generic_services !== undefined && + object.py_generic_services !== null + ) { + message.py_generic_services = object.py_generic_services; + } else { + message.py_generic_services = false; + } + if ( + object.php_generic_services !== undefined && + object.php_generic_services !== null + ) { + message.php_generic_services = object.php_generic_services; + } else { + message.php_generic_services = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.cc_enable_arenas !== undefined && + object.cc_enable_arenas !== null + ) { + message.cc_enable_arenas = object.cc_enable_arenas; + } else { + message.cc_enable_arenas = false; + } + if ( + object.objc_class_prefix !== undefined && + object.objc_class_prefix !== null + ) { + message.objc_class_prefix = object.objc_class_prefix; + } else { + message.objc_class_prefix = ""; + } + if ( + object.csharp_namespace !== undefined && + object.csharp_namespace !== null + ) { + message.csharp_namespace = object.csharp_namespace; + } else { + message.csharp_namespace = ""; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swift_prefix = object.swift_prefix; + } else { + message.swift_prefix = ""; + } + if ( + object.php_class_prefix !== undefined && + object.php_class_prefix !== null + ) { + message.php_class_prefix = object.php_class_prefix; + } else { + message.php_class_prefix = ""; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.php_namespace = object.php_namespace; + } else { + message.php_namespace = ""; + } + if ( + object.php_metadata_namespace !== undefined && + object.php_metadata_namespace !== null + ) { + message.php_metadata_namespace = object.php_metadata_namespace; + } else { + message.php_metadata_namespace = ""; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.ruby_package = object.ruby_package; + } else { + message.ruby_package = ""; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMessageOptions: object = { + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + deprecated: false, + map_entry: false, +}; + +export const MessageOptions = { + encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { + if (message.message_set_wire_format === true) { + writer.uint32(8).bool(message.message_set_wire_format); + } + if (message.no_standard_descriptor_accessor === true) { + writer.uint32(16).bool(message.no_standard_descriptor_accessor); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.map_entry === true) { + writer.uint32(56).bool(message.map_entry); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message_set_wire_format = reader.bool(); + break; + case 2: + message.no_standard_descriptor_accessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.map_entry = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + if ( + object.message_set_wire_format !== undefined && + object.message_set_wire_format !== null + ) { + message.message_set_wire_format = Boolean(object.message_set_wire_format); + } else { + message.message_set_wire_format = false; + } + if ( + object.no_standard_descriptor_accessor !== undefined && + object.no_standard_descriptor_accessor !== null + ) { + message.no_standard_descriptor_accessor = Boolean( + object.no_standard_descriptor_accessor + ); + } else { + message.no_standard_descriptor_accessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.map_entry = Boolean(object.map_entry); + } else { + message.map_entry = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MessageOptions): unknown { + const obj: any = {}; + message.message_set_wire_format !== undefined && + (obj.message_set_wire_format = message.message_set_wire_format); + message.no_standard_descriptor_accessor !== undefined && + (obj.no_standard_descriptor_accessor = + message.no_standard_descriptor_accessor); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.map_entry !== undefined && (obj.map_entry = message.map_entry); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + if ( + object.message_set_wire_format !== undefined && + object.message_set_wire_format !== null + ) { + message.message_set_wire_format = object.message_set_wire_format; + } else { + message.message_set_wire_format = false; + } + if ( + object.no_standard_descriptor_accessor !== undefined && + object.no_standard_descriptor_accessor !== null + ) { + message.no_standard_descriptor_accessor = + object.no_standard_descriptor_accessor; + } else { + message.no_standard_descriptor_accessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.map_entry = object.map_entry; + } else { + message.map_entry = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFieldOptions: object = { + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + deprecated: false, + weak: false, +}; + +export const FieldOptions = { + encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + if (message.ctype !== 0) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed === true) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== 0) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy === true) { + writer.uint32(40).bool(message.lazy); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak === true) { + writer.uint32(80).bool(message.weak); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32() as any; + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32() as any; + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = fieldOptions_CTypeFromJSON(object.ctype); + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = Boolean(object.packed); + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = Boolean(object.lazy); + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = Boolean(object.weak); + } else { + message.weak = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FieldOptions): unknown { + const obj: any = {}; + message.ctype !== undefined && + (obj.ctype = fieldOptions_CTypeToJSON(message.ctype)); + message.packed !== undefined && (obj.packed = message.packed); + message.jstype !== undefined && + (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); + message.lazy !== undefined && (obj.lazy = message.lazy); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.weak !== undefined && (obj.weak = message.weak); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = object.ctype; + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = object.jstype; + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } else { + message.weak = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseOneofOptions: object = {}; + +export const OneofOptions = { + encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: OneofOptions): unknown { + const obj: any = {}; + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseEnumOptions: object = { allow_alias: false, deprecated: false }; + +export const EnumOptions = { + encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { + if (message.allow_alias === true) { + writer.uint32(16).bool(message.allow_alias); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allow_alias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allow_alias = Boolean(object.allow_alias); + } else { + message.allow_alias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: EnumOptions): unknown { + const obj: any = {}; + message.allow_alias !== undefined && + (obj.allow_alias = message.allow_alias); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allow_alias = object.allow_alias; + } else { + message.allow_alias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseEnumValueOptions: object = { deprecated: false }; + +export const EnumValueOptions = { + encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(8).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: EnumValueOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseServiceOptions: object = { deprecated: false }; + +export const ServiceOptions = { + encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ServiceOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; + +export const MethodOptions = { + encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + if (message.idempotency_level !== 0) { + writer.uint32(272).int32(message.idempotency_level); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotency_level = reader.int32() as any; + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.idempotency_level !== undefined && + object.idempotency_level !== null + ) { + message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( + object.idempotency_level + ); + } else { + message.idempotency_level = 0; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MethodOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.idempotency_level !== undefined && + (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( + message.idempotency_level + )); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.idempotency_level !== undefined && + object.idempotency_level !== null + ) { + message.idempotency_level = object.idempotency_level; + } else { + message.idempotency_level = 0; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseUninterpretedOption: object = { + identifier_value: "", + positive_int_value: 0, + negative_int_value: 0, + double_value: 0, + aggregate_value: "", +}; + +export const UninterpretedOption = { + encode( + message: UninterpretedOption, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.name) { + UninterpretedOption_NamePart.encode( + v!, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.identifier_value !== "") { + writer.uint32(26).string(message.identifier_value); + } + if (message.positive_int_value !== 0) { + writer.uint32(32).uint64(message.positive_int_value); + } + if (message.negative_int_value !== 0) { + writer.uint32(40).int64(message.negative_int_value); + } + if (message.double_value !== 0) { + writer.uint32(49).double(message.double_value); + } + if (message.string_value.length !== 0) { + writer.uint32(58).bytes(message.string_value); + } + if (message.aggregate_value !== "") { + writer.uint32(66).string(message.aggregate_value); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.name.push( + UninterpretedOption_NamePart.decode(reader, reader.uint32()) + ); + break; + case 3: + message.identifier_value = reader.string(); + break; + case 4: + message.positive_int_value = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negative_int_value = longToNumber(reader.int64() as Long); + break; + case 6: + message.double_value = reader.double(); + break; + case 7: + message.string_value = reader.bytes(); + break; + case 8: + message.aggregate_value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromJSON(e)); + } + } + if ( + object.identifier_value !== undefined && + object.identifier_value !== null + ) { + message.identifier_value = String(object.identifier_value); + } else { + message.identifier_value = ""; + } + if ( + object.positive_int_value !== undefined && + object.positive_int_value !== null + ) { + message.positive_int_value = Number(object.positive_int_value); + } else { + message.positive_int_value = 0; + } + if ( + object.negative_int_value !== undefined && + object.negative_int_value !== null + ) { + message.negative_int_value = Number(object.negative_int_value); + } else { + message.negative_int_value = 0; + } + if (object.double_value !== undefined && object.double_value !== null) { + message.double_value = Number(object.double_value); + } else { + message.double_value = 0; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.string_value = bytesFromBase64(object.string_value); + } + if ( + object.aggregate_value !== undefined && + object.aggregate_value !== null + ) { + message.aggregate_value = String(object.aggregate_value); + } else { + message.aggregate_value = ""; + } + return message; + }, + + toJSON(message: UninterpretedOption): unknown { + const obj: any = {}; + if (message.name) { + obj.name = message.name.map((e) => + e ? UninterpretedOption_NamePart.toJSON(e) : undefined + ); + } else { + obj.name = []; + } + message.identifier_value !== undefined && + (obj.identifier_value = message.identifier_value); + message.positive_int_value !== undefined && + (obj.positive_int_value = message.positive_int_value); + message.negative_int_value !== undefined && + (obj.negative_int_value = message.negative_int_value); + message.double_value !== undefined && + (obj.double_value = message.double_value); + message.string_value !== undefined && + (obj.string_value = base64FromBytes( + message.string_value !== undefined + ? message.string_value + : new Uint8Array() + )); + message.aggregate_value !== undefined && + (obj.aggregate_value = message.aggregate_value); + return obj; + }, + + fromPartial(object: DeepPartial): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromPartial(e)); + } + } + if ( + object.identifier_value !== undefined && + object.identifier_value !== null + ) { + message.identifier_value = object.identifier_value; + } else { + message.identifier_value = ""; + } + if ( + object.positive_int_value !== undefined && + object.positive_int_value !== null + ) { + message.positive_int_value = object.positive_int_value; + } else { + message.positive_int_value = 0; + } + if ( + object.negative_int_value !== undefined && + object.negative_int_value !== null + ) { + message.negative_int_value = object.negative_int_value; + } else { + message.negative_int_value = 0; + } + if (object.double_value !== undefined && object.double_value !== null) { + message.double_value = object.double_value; + } else { + message.double_value = 0; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.string_value = object.string_value; + } else { + message.string_value = new Uint8Array(); + } + if ( + object.aggregate_value !== undefined && + object.aggregate_value !== null + ) { + message.aggregate_value = object.aggregate_value; + } else { + message.aggregate_value = ""; + } + return message; + }, +}; + +const baseUninterpretedOption_NamePart: object = { + name_part: "", + is_extension: false, +}; + +export const UninterpretedOption_NamePart = { + encode( + message: UninterpretedOption_NamePart, + writer: Writer = Writer.create() + ): Writer { + if (message.name_part !== "") { + writer.uint32(10).string(message.name_part); + } + if (message.is_extension === true) { + writer.uint32(16).bool(message.is_extension); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): UninterpretedOption_NamePart { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name_part = reader.string(); + break; + case 2: + message.is_extension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninterpretedOption_NamePart { + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + if (object.name_part !== undefined && object.name_part !== null) { + message.name_part = String(object.name_part); + } else { + message.name_part = ""; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.is_extension = Boolean(object.is_extension); + } else { + message.is_extension = false; + } + return message; + }, + + toJSON(message: UninterpretedOption_NamePart): unknown { + const obj: any = {}; + message.name_part !== undefined && (obj.name_part = message.name_part); + message.is_extension !== undefined && + (obj.is_extension = message.is_extension); + return obj; + }, + + fromPartial( + object: DeepPartial + ): UninterpretedOption_NamePart { + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + if (object.name_part !== undefined && object.name_part !== null) { + message.name_part = object.name_part; + } else { + message.name_part = ""; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.is_extension = object.is_extension; + } else { + message.is_extension = false; + } + return message; + }, +}; + +const baseSourceCodeInfo: object = {}; + +export const SourceCodeInfo = { + encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location.push( + SourceCodeInfo_Location.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: SourceCodeInfo): unknown { + const obj: any = {}; + if (message.location) { + obj.location = message.location.map((e) => + e ? SourceCodeInfo_Location.toJSON(e) : undefined + ); + } else { + obj.location = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromPartial(e)); + } + } + return message; + }, +}; + +const baseSourceCodeInfo_Location: object = { + path: 0, + span: 0, + leading_comments: "", + trailing_comments: "", + leading_detached_comments: "", +}; + +export const SourceCodeInfo_Location = { + encode( + message: SourceCodeInfo_Location, + writer: Writer = Writer.create() + ): Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + if (message.leading_comments !== "") { + writer.uint32(26).string(message.leading_comments); + } + if (message.trailing_comments !== "") { + writer.uint32(34).string(message.trailing_comments); + } + for (const v of message.leading_detached_comments) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + } else { + message.span.push(reader.int32()); + } + break; + case 3: + message.leading_comments = reader.string(); + break; + case 4: + message.trailing_comments = reader.string(); + break; + case 6: + message.leading_detached_comments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo_Location { + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(Number(e)); + } + } + if ( + object.leading_comments !== undefined && + object.leading_comments !== null + ) { + message.leading_comments = String(object.leading_comments); + } else { + message.leading_comments = ""; + } + if ( + object.trailing_comments !== undefined && + object.trailing_comments !== null + ) { + message.trailing_comments = String(object.trailing_comments); + } else { + message.trailing_comments = ""; + } + if ( + object.leading_detached_comments !== undefined && + object.leading_detached_comments !== null + ) { + for (const e of object.leading_detached_comments) { + message.leading_detached_comments.push(String(e)); + } + } + return message; + }, + + toJSON(message: SourceCodeInfo_Location): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + if (message.span) { + obj.span = message.span.map((e) => e); + } else { + obj.span = []; + } + message.leading_comments !== undefined && + (obj.leading_comments = message.leading_comments); + message.trailing_comments !== undefined && + (obj.trailing_comments = message.trailing_comments); + if (message.leading_detached_comments) { + obj.leading_detached_comments = message.leading_detached_comments.map( + (e) => e + ); + } else { + obj.leading_detached_comments = []; + } + return obj; + }, + + fromPartial( + object: DeepPartial + ): SourceCodeInfo_Location { + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(e); + } + } + if ( + object.leading_comments !== undefined && + object.leading_comments !== null + ) { + message.leading_comments = object.leading_comments; + } else { + message.leading_comments = ""; + } + if ( + object.trailing_comments !== undefined && + object.trailing_comments !== null + ) { + message.trailing_comments = object.trailing_comments; + } else { + message.trailing_comments = ""; + } + if ( + object.leading_detached_comments !== undefined && + object.leading_detached_comments !== null + ) { + for (const e of object.leading_detached_comments) { + message.leading_detached_comments.push(e); + } + } + return message; + }, +}; + +const baseGeneratedCodeInfo: object = {}; + +export const GeneratedCodeInfo = { + encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode( + v!, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annotation.push( + GeneratedCodeInfo_Annotation.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: GeneratedCodeInfo): unknown { + const obj: any = {}; + if (message.annotation) { + obj.annotation = message.annotation.map((e) => + e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined + ); + } else { + obj.annotation = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); + } + } + return message; + }, +}; + +const baseGeneratedCodeInfo_Annotation: object = { + path: 0, + source_file: "", + begin: 0, + end: 0, +}; + +export const GeneratedCodeInfo_Annotation = { + encode( + message: GeneratedCodeInfo_Annotation, + writer: Writer = Writer.create() + ): Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + if (message.source_file !== "") { + writer.uint32(18).string(message.source_file); + } + if (message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== 0) { + writer.uint32(32).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): GeneratedCodeInfo_Annotation { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + message.source_file = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo_Annotation { + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.source_file !== undefined && object.source_file !== null) { + message.source_file = String(object.source_file); + } else { + message.source_file = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = Number(object.begin); + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: GeneratedCodeInfo_Annotation): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + message.source_file !== undefined && + (obj.source_file = message.source_file); + message.begin !== undefined && (obj.begin = message.begin); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): GeneratedCodeInfo_Annotation { + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.source_file !== undefined && object.source_file !== null) { + message.source_file = object.source_file; + } else { + message.source_file = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/package.json b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/package.json new file mode 100755 index 00000000..87f4f652 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/package.json @@ -0,0 +1,18 @@ +{ + "name": "bzealphateam-bze-cointrunk-js", + "version": "0.1.0", + "description": "Autogenerated vuex store for Cosmos module bzealphateam.bze.cointrunk", + "author": "Starport Codegen ", + "homepage": "http://github.com/bze-alphateam/bze/x/cointrunk/types", + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "main": "index.js", + "publishConfig": { + "access": "public" + } +} \ No newline at end of file diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/vuex-root b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/vuex-root new file mode 100755 index 00000000..0fcc121a --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/vuex-root @@ -0,0 +1 @@ +THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/index.ts b/vue/src/store/generated/index.ts index 6d4dc173..63274577 100755 --- a/vue/src/store/generated/index.ts +++ b/vue/src/store/generated/index.ts @@ -1,6 +1,7 @@ // THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. import BzeAlphateamBzeBzeScavenge from './bze-alphateam/bze/bze.scavenge' +import BzeAlphateamBzeBzealphateamBzeCointrunk from './bze-alphateam/bze/bzealphateam.bze.cointrunk' import CosmosCosmosSdkCosmosAuthzV1Beta1 from './cosmos/cosmos-sdk/cosmos.authz.v1beta1' import CosmosCosmosSdkCosmosBankV1Beta1 from './cosmos/cosmos-sdk/cosmos.bank.v1beta1' import CosmosCosmosSdkCosmosCrisisV1Beta1 from './cosmos/cosmos-sdk/cosmos.crisis.v1beta1' @@ -16,6 +17,7 @@ import CosmosIbcGoIbcApplicationsTransferV1 from './cosmos/ibc-go/ibc.applicatio export default { BzeAlphateamBzeBzeScavenge: load(BzeAlphateamBzeBzeScavenge, 'bze.scavenge'), + BzeAlphateamBzeBzealphateamBzeCointrunk: load(BzeAlphateamBzeBzealphateamBzeCointrunk, 'bzealphateam.bze.cointrunk'), CosmosCosmosSdkCosmosAuthzV1Beta1: load(CosmosCosmosSdkCosmosAuthzV1Beta1, 'cosmos.authz.v1beta1'), CosmosCosmosSdkCosmosBankV1Beta1: load(CosmosCosmosSdkCosmosBankV1Beta1, 'cosmos.bank.v1beta1'), CosmosCosmosSdkCosmosCrisisV1Beta1: load(CosmosCosmosSdkCosmosCrisisV1Beta1, 'cosmos.crisis.v1beta1'), diff --git a/x/cointrunk/client/cli/query.go b/x/cointrunk/client/cli/query.go new file mode 100644 index 00000000..b30735c8 --- /dev/null +++ b/x/cointrunk/client/cli/query.go @@ -0,0 +1,32 @@ +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/bze-alphateam/bze/x/cointrunk/types" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd(queryRoute string) *cobra.Command { + // Group cointrunk 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/cointrunk/client/cli/query_params.go b/x/cointrunk/client/cli/query_params.go new file mode 100644 index 00000000..c27b2c6a --- /dev/null +++ b/x/cointrunk/client/cli/query_params.go @@ -0,0 +1,34 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + "github.com/bze-alphateam/bze/x/cointrunk/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 := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/cointrunk/client/cli/tx.go b/x/cointrunk/client/cli/tx.go new file mode 100644 index 00000000..0f377623 --- /dev/null +++ b/x/cointrunk/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/bze-alphateam/bze/x/cointrunk/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/cointrunk/genesis.go b/x/cointrunk/genesis.go new file mode 100644 index 00000000..ae08b8f6 --- /dev/null +++ b/x/cointrunk/genesis.go @@ -0,0 +1,25 @@ +package cointrunk + +import ( + "github.com/bze-alphateam/bze/x/cointrunk/keeper" + "github.com/bze-alphateam/bze/x/cointrunk/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// InitGenesis initializes the capability 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 capability 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/cointrunk/genesis_test.go b/x/cointrunk/genesis_test.go new file mode 100644 index 00000000..5300b907 --- /dev/null +++ b/x/cointrunk/genesis_test.go @@ -0,0 +1,29 @@ +package cointrunk_test + +import ( + "testing" + + keepertest "github.com/bze-alphateam/bze/testutil/keeper" + //"github.com/bze-alphateam/bze/testutil/nullify" + "github.com/bze-alphateam/bze/x/cointrunk" + "github.com/bze-alphateam/bze/x/cointrunk/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.CointrunkKeeper(t) + cointrunk.InitGenesis(ctx, *k, genesisState) + got := cointrunk.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/cointrunk/handler.go b/x/cointrunk/handler.go new file mode 100644 index 00000000..4b845fcb --- /dev/null +++ b/x/cointrunk/handler.go @@ -0,0 +1,26 @@ +package cointrunk + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/bze-alphateam/bze/x/cointrunk/keeper" + "github.com/bze-alphateam/bze/x/cointrunk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// NewHandler ... +func NewHandler(k keeper.Keeper) sdk.Handler { + // this line is used by starport scaffolding # handler/msgServer + + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { + ctx = ctx.WithEventManager(sdk.NewEventManager()) + + switch msg := msg.(type) { + // this line is used by starport scaffolding # 1 + default: + errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + } + } +} diff --git a/x/cointrunk/keeper/grpc_query.go b/x/cointrunk/keeper/grpc_query.go new file mode 100644 index 00000000..7d199eba --- /dev/null +++ b/x/cointrunk/keeper/grpc_query.go @@ -0,0 +1,7 @@ +package keeper + +import ( + "github.com/bze-alphateam/bze/x/cointrunk/types" +) + +var _ types.QueryServer = Keeper{} diff --git a/x/cointrunk/keeper/grpc_query_params.go b/x/cointrunk/keeper/grpc_query_params.go new file mode 100644 index 00000000..7055c2fe --- /dev/null +++ b/x/cointrunk/keeper/grpc_query_params.go @@ -0,0 +1,19 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/bze-alphateam/bze/x/cointrunk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} diff --git a/x/cointrunk/keeper/grpc_query_params_test.go b/x/cointrunk/keeper/grpc_query_params_test.go new file mode 100644 index 00000000..b0bd5c82 --- /dev/null +++ b/x/cointrunk/keeper/grpc_query_params_test.go @@ -0,0 +1,21 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + testkeeper "github.com/bze-alphateam/bze/testutil/keeper" + "github.com/bze-alphateam/bze/x/cointrunk/types" +) + +func TestParamsQuery(t *testing.T) { + keeper, ctx := testkeeper.CointrunkKeeper(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/cointrunk/keeper/keeper.go b/x/cointrunk/keeper/keeper.go new file mode 100644 index 00000000..86708af9 --- /dev/null +++ b/x/cointrunk/keeper/keeper.go @@ -0,0 +1,53 @@ +package keeper + +import ( + "fmt" + + "github.com/tendermint/tendermint/libs/log" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/bze-alphateam/bze/x/cointrunk/types" + +) + +type ( + Keeper struct { + + cdc codec.BinaryCodec + storeKey sdk.StoreKey + memKey sdk.StoreKey + paramstore paramtypes.Subspace + + bankKeeper types.BankKeeper + govKeeper types.GovKeeper + } +) + +func NewKeeper( + cdc codec.BinaryCodec, + storeKey, + memKey sdk.StoreKey, + ps paramtypes.Subspace, + + bankKeeper types.BankKeeper,govKeeper types.GovKeeper, +) *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, + bankKeeper: bankKeeper,govKeeper: govKeeper, + } +} + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} diff --git a/x/cointrunk/keeper/msg_server.go b/x/cointrunk/keeper/msg_server.go new file mode 100644 index 00000000..de00d24a --- /dev/null +++ b/x/cointrunk/keeper/msg_server.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/bze-alphateam/bze/x/cointrunk/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/cointrunk/keeper/msg_server_test.go b/x/cointrunk/keeper/msg_server_test.go new file mode 100644 index 00000000..d8e4f6f2 --- /dev/null +++ b/x/cointrunk/keeper/msg_server_test.go @@ -0,0 +1,16 @@ +package keeper_test + +import ( + "context" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/bze-alphateam/bze/x/cointrunk/keeper" + keepertest "github.com/bze-alphateam/bze/testutil/keeper" +) + +func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { + k, ctx := keepertest.CointrunkKeeper(t) + return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) +} diff --git a/x/cointrunk/keeper/params.go b/x/cointrunk/keeper/params.go new file mode 100644 index 00000000..91c4bd2b --- /dev/null +++ b/x/cointrunk/keeper/params.go @@ -0,0 +1,32 @@ +package keeper + +import ( + "github.com/bze-alphateam/bze/x/cointrunk/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( + k.AnonArticleLimit(ctx), + k.AnonArticleCost(ctx), + ) +} + +// SetParams set the params +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + k.paramstore.SetParamSet(ctx, ¶ms) +} + + +// AnonArticleLimit returns the AnonArticleLimit param +func (k Keeper) AnonArticleLimit(ctx sdk.Context) (res uint64) { + k.paramstore.Get(ctx, types.KeyAnonArticleLimit, &res) + return +} + +// AnonArticleCost returns the AnonArticleCost param +func (k Keeper) AnonArticleCost(ctx sdk.Context) (res string) { + k.paramstore.Get(ctx, types.KeyAnonArticleCost, &res) + return +} diff --git a/x/cointrunk/keeper/params_test.go b/x/cointrunk/keeper/params_test.go new file mode 100644 index 00000000..4f5ea850 --- /dev/null +++ b/x/cointrunk/keeper/params_test.go @@ -0,0 +1,20 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + testkeeper "github.com/bze-alphateam/bze/testutil/keeper" + "github.com/bze-alphateam/bze/x/cointrunk/types" +) + +func TestGetParams(t *testing.T) { + k, ctx := testkeeper.CointrunkKeeper(t) + params := types.DefaultParams() + + k.SetParams(ctx, params) + + require.EqualValues(t, params, k.GetParams(ctx)) + require.EqualValues(t, params.AnonArticleLimit, k.AnonArticleLimit(ctx)) + require.EqualValues(t, params.AnonArticleCost, k.AnonArticleCost(ctx)) +} diff --git a/x/cointrunk/module.go b/x/cointrunk/module.go new file mode 100644 index 00000000..fa663ee6 --- /dev/null +++ b/x/cointrunk/module.go @@ -0,0 +1,177 @@ +package cointrunk + +import ( + "encoding/json" + "fmt" + // this line is used by starport scaffolding # 1 + + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/tendermint/tendermint/abci/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" + "github.com/bze-alphateam/bze/x/cointrunk/keeper" + "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/bze-alphateam/bze/x/cointrunk/client/cli" + +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface for the capability module. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the capability module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +// RegisterInterfaces registers the module's interface types +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns the capability module's default genesis state. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis performs genesis state validation for the capability module. +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() +} + +// RegisterRESTRoutes registers the capability module's REST service handlers. +func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + // this line is used by starport scaffolding # 2 +} + +// GetTxCmd returns the capability module's root tx command. +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the capability module's root query command. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd(types.StoreKey) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface for the capability module. +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, + } +} + +// Name returns the capability module's name. +func (am AppModule) Name() string { + return am.AppModuleBasic.Name() +} + +// Route returns the capability module's message routing key. +func (am AppModule) Route() sdk.Route { + return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) +} + +// QuerierRoute returns the capability module's query routing key. +func (AppModule) QuerierRoute() string { return types.QuerierRoute } + +// LegacyQuerierHandler returns the capability module's Querier. +func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { + return nil +} + +// RegisterServices registers a GRPC query service to respond to the +// module-specific GRPC queries. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the capability module's invariants. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the capability 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 capability 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 implements ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 2 } + +// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. +func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} + +// EndBlock executes all ABCI EndBlock logic respective to the capability module. It +// returns no validator updates. +func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} diff --git a/x/cointrunk/module_simulation.go b/x/cointrunk/module_simulation.go new file mode 100644 index 00000000..e9e591aa --- /dev/null +++ b/x/cointrunk/module_simulation.go @@ -0,0 +1,71 @@ +package cointrunk + +import ( + "math/rand" + + "github.com/bze-alphateam/bze/testutil/sample" + cointrunksimulation "github.com/bze-alphateam/bze/x/cointrunk/simulation" + "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/cosmos/cosmos-sdk/baseapp" + simappparams "github.com/cosmos/cosmos-sdk/simapp/params" + 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 + _ = cointrunksimulation.FindAccount + _ = simappparams.StakePerAccount + _ = simulation.MsgEntryKind + _ = baseapp.Paramspace +) + +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() + } + cointrunkGenesis := types.GenesisState{ + Params: types.DefaultParams(), + // this line is used by starport scaffolding # simapp/module/genesisState + } + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&cointrunkGenesis) +} + +// ProposalContents doesn't return any content functions for governance proposals +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// RandomizedParams creates randomized param changes for the simulator +func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { + cointrunkParams := types.DefaultParams() + return []simtypes.ParamChange{ + simulation.NewSimParamChange(types.ModuleName, string(types.KeyAnonArticleLimit), func(r *rand.Rand) string { + return string(types.Amino.MustMarshalJSON(cointrunkParams.AnonArticleLimit)) + }), + simulation.NewSimParamChange(types.ModuleName, string(types.KeyAnonArticleCost), func(r *rand.Rand) string { + return string(types.Amino.MustMarshalJSON(cointrunkParams.AnonArticleCost)) + }), + } +} + +// RegisterStoreDecoder registers a decoder +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} + +// 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 +} diff --git a/x/cointrunk/simulation/simap.go b/x/cointrunk/simulation/simap.go new file mode 100644 index 00000000..92c437c0 --- /dev/null +++ b/x/cointrunk/simulation/simap.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/cointrunk/types/codec.go b/x/cointrunk/types/codec.go new file mode 100644 index 00000000..fb6871d2 --- /dev/null +++ b/x/cointrunk/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/cointrunk/types/errors.go b/x/cointrunk/types/errors.go new file mode 100644 index 00000000..a9751d63 --- /dev/null +++ b/x/cointrunk/types/errors.go @@ -0,0 +1,13 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// x/cointrunk module sentinel errors +var ( + ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") + +) diff --git a/x/cointrunk/types/expected_keepers.go b/x/cointrunk/types/expected_keepers.go new file mode 100644 index 00000000..a7fc23b7 --- /dev/null +++ b/x/cointrunk/types/expected_keepers.go @@ -0,0 +1,28 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/types" +) + + + + + +type GovKeeper interface { + // Methods imported from gov should be defined here +} + + + +// 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 +} \ No newline at end of file diff --git a/x/cointrunk/types/genesis.go b/x/cointrunk/types/genesis.go new file mode 100644 index 00000000..aa82115f --- /dev/null +++ b/x/cointrunk/types/genesis.go @@ -0,0 +1,24 @@ +package types + +import ( +// this line is used by starport scaffolding # genesis/types/import +) + +// DefaultIndex is the default capability global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default Capability 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/cointrunk/types/genesis.pb.go b/x/cointrunk/types/genesis.pb.go new file mode 100644 index 00000000..8ac5b31b --- /dev/null +++ b/x/cointrunk/types/genesis.pb.go @@ -0,0 +1,321 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cointrunk/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/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 cointrunk 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_20104b77ac07c6a4, []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), "bzealphateam.bze.cointrunk.GenesisState") +} + +func init() { proto.RegisterFile("cointrunk/genesis.proto", fileDescriptor_20104b77ac07c6a4) } + +var fileDescriptor_20104b77ac07c6a4 = []byte{ + // 201 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xce, 0xcf, 0xcc, + 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x4a, 0xaa, 0x4a, 0x4d, 0xcc, 0x29, 0xc8, 0x48, 0x2c, 0x49, 0x4d, + 0xcc, 0xd5, 0x4b, 0xaa, 0x4a, 0xd5, 0x83, 0xab, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, + 0xd3, 0x07, 0xb1, 0x20, 0x3a, 0xa4, 0xc4, 0x10, 0x46, 0x15, 0x24, 0x16, 0x25, 0xe6, 0x42, 0x4d, + 0x52, 0x0a, 0xe0, 0xe2, 0x71, 0x87, 0x18, 0x1d, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0xe4, 0xc0, 0xc5, + 0x06, 0x91, 0x97, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x52, 0xd2, 0xc3, 0x6d, 0x95, 0x5e, 0x00, + 0x58, 0xa5, 0x13, 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, 0x50, 0x7d, 0x4e, 0x1e, 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, 0xa5, 0x97, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, + 0x9c, 0x9f, 0xab, 0x9f, 0x54, 0x95, 0xaa, 0x0b, 0x37, 0x16, 0xc4, 0xd3, 0xaf, 0xd0, 0x47, 0x38, + 0xb1, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x44, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xe7, 0x36, 0x2f, 0x70, 0x07, 0x01, 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/cointrunk/types/genesis_test.go b/x/cointrunk/types/genesis_test.go new file mode 100644 index 00000000..39b876da --- /dev/null +++ b/x/cointrunk/types/genesis_test.go @@ -0,0 +1,40 @@ +package types_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/bze-alphateam/bze/x/cointrunk/types" +) + +func TestGenesisState_Validate(t *testing.T) { + for _, tc := range []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 + } { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} \ No newline at end of file diff --git a/x/cointrunk/types/keys.go b/x/cointrunk/types/keys.go new file mode 100644 index 00000000..df8b7baa --- /dev/null +++ b/x/cointrunk/types/keys.go @@ -0,0 +1,26 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "cointrunk" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // RouterKey is the message route for slashing + RouterKey = ModuleName + + // QuerierRoute defines the module's query routing key + QuerierRoute = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_cointrunk" + + +) + + + +func KeyPrefix(p string) []byte { + return []byte(p) +} diff --git a/x/cointrunk/types/params.go b/x/cointrunk/types/params.go new file mode 100644 index 00000000..1577bf20 --- /dev/null +++ b/x/cointrunk/types/params.go @@ -0,0 +1,97 @@ +package types + +import ( + "fmt" + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "gopkg.in/yaml.v2" +) + +var _ paramtypes.ParamSet = (*Params)(nil) + +var ( + KeyAnonArticleLimit = []byte("AnonArticleLimit") + DefaultAnonArticleLimit uint64 = 5 +) + +var ( + KeyAnonArticleCost = []byte("AnonArticleCost") + DefaultAnonArticleCost string = "50000000000ubze" +) + +// 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( + anonArticleLimit uint64, + anonArticleCost string, +) Params { + return Params{ + AnonArticleLimit: anonArticleLimit, + AnonArticleCost: anonArticleCost, + } +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return NewParams( + DefaultAnonArticleLimit, + DefaultAnonArticleCost, + ) +} + +// ParamSetPairs get the params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair(KeyAnonArticleLimit, &p.AnonArticleLimit, validateAnonArticleLimit), + paramtypes.NewParamSetPair(KeyAnonArticleCost, &p.AnonArticleCost, validateAnonArticleCost), + } +} + +// Validate validates the set of params +func (p Params) Validate() error { + if err := validateAnonArticleLimit(p.AnonArticleLimit); err != nil { + return err + } + + if err := validateAnonArticleCost(p.AnonArticleCost); err != nil { + return err + } + + return nil +} + +// String implements the Stringer interface. +func (p Params) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} + +// validateAnonArticleLimit validates the AnonArticleLimit param +func validateAnonArticleLimit(v interface{}) error { + anonArticleLimit, ok := v.(uint64) + if !ok { + return fmt.Errorf("invalid parameter type: %T", v) + } + + // TODO implement validation + _ = anonArticleLimit + + return nil +} + +// validateAnonArticleCost validates the AnonArticleCost param +func validateAnonArticleCost(v interface{}) error { + anonArticleCost, ok := v.(string) + if !ok { + return fmt.Errorf("invalid parameter type: %T", v) + } + + // TODO implement validation + _ = anonArticleCost + + return nil +} diff --git a/x/cointrunk/types/params.pb.go b/x/cointrunk/types/params.pb.go new file mode 100644 index 00000000..873f6369 --- /dev/null +++ b/x/cointrunk/types/params.pb.go @@ -0,0 +1,356 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cointrunk/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/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 { + AnonArticleLimit uint64 `protobuf:"varint,1,opt,name=anonArticleLimit,proto3" json:"anonArticleLimit,omitempty" yaml:"anon_article_limit"` + AnonArticleCost string `protobuf:"bytes,2,opt,name=anonArticleCost,proto3" json:"anonArticleCost,omitempty" yaml:"anon_article_cost"` +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_f29b1ecdb66bf452, []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) GetAnonArticleLimit() uint64 { + if m != nil { + return m.AnonArticleLimit + } + return 0 +} + +func (m *Params) GetAnonArticleCost() string { + if m != nil { + return m.AnonArticleCost + } + return "" +} + +func init() { + proto.RegisterType((*Params)(nil), "bzealphateam.bze.cointrunk.Params") +} + +func init() { proto.RegisterFile("cointrunk/params.proto", fileDescriptor_f29b1ecdb66bf452) } + +var fileDescriptor_f29b1ecdb66bf452 = []byte{ + // 246 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4b, 0xce, 0xcf, 0xcc, + 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, + 0x2f, 0xc9, 0x17, 0x92, 0x4a, 0xaa, 0x4a, 0x4d, 0xcc, 0x29, 0xc8, 0x48, 0x2c, 0x49, 0x4d, 0xcc, + 0xd5, 0x4b, 0xaa, 0x4a, 0xd5, 0x83, 0x2b, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, 0xd3, + 0x07, 0xb1, 0x20, 0x3a, 0x94, 0x16, 0x32, 0x72, 0xb1, 0x05, 0x80, 0x8d, 0x10, 0xf2, 0xe4, 0x12, + 0x48, 0xcc, 0xcb, 0xcf, 0x73, 0x2c, 0x2a, 0xc9, 0x4c, 0xce, 0x49, 0xf5, 0xc9, 0xcc, 0xcd, 0x2c, + 0x91, 0x60, 0x54, 0x60, 0xd4, 0x60, 0x71, 0x92, 0xfd, 0x74, 0x4f, 0x5e, 0xb2, 0x32, 0x31, 0x37, + 0xc7, 0x4a, 0x09, 0xa4, 0x22, 0x3e, 0x11, 0xa2, 0x24, 0x3e, 0x07, 0xa4, 0x46, 0x29, 0x08, 0x43, + 0x9b, 0x90, 0x1b, 0x17, 0x3f, 0x92, 0x98, 0x73, 0x7e, 0x71, 0x89, 0x04, 0x93, 0x02, 0xa3, 0x06, + 0xa7, 0x93, 0xcc, 0xa7, 0x7b, 0xf2, 0x12, 0x58, 0x4c, 0x4a, 0xce, 0x2f, 0x2e, 0x51, 0x0a, 0x42, + 0xd7, 0x64, 0xc5, 0x32, 0x63, 0x81, 0x3c, 0x83, 0x93, 0xc7, 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, 0xe9, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, + 0x27, 0x55, 0xa5, 0xea, 0xc2, 0xfd, 0x0e, 0xe2, 0xe9, 0x57, 0xe8, 0x23, 0x82, 0xa9, 0xa4, 0xb2, + 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x69, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x67, 0xaf, + 0xa6, 0x70, 0x40, 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.AnonArticleCost) > 0 { + i -= len(m.AnonArticleCost) + copy(dAtA[i:], m.AnonArticleCost) + i = encodeVarintParams(dAtA, i, uint64(len(m.AnonArticleCost))) + i-- + dAtA[i] = 0x12 + } + if m.AnonArticleLimit != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.AnonArticleLimit)) + i-- + dAtA[i] = 0x8 + } + 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 m.AnonArticleLimit != 0 { + n += 1 + sovParams(uint64(m.AnonArticleLimit)) + } + l = len(m.AnonArticleCost) + if l > 0 { + 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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AnonArticleLimit", wireType) + } + m.AnonArticleLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AnonArticleLimit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AnonArticleCost", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AnonArticleCost = string(dAtA[iNdEx:postIndex]) + 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/cointrunk/types/query.pb.go b/x/cointrunk/types/query.pb.go new file mode 100644 index 00000000..00cf48b6 --- /dev/null +++ b/x/cointrunk/types/query.pb.go @@ -0,0 +1,538 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cointrunk/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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_12b6eb50b0e9fa00, []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_12b6eb50b0e9fa00, []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), "bzealphateam.bze.cointrunk.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "bzealphateam.bze.cointrunk.QueryParamsResponse") +} + +func init() { proto.RegisterFile("cointrunk/query.proto", fileDescriptor_12b6eb50b0e9fa00) } + +var fileDescriptor_12b6eb50b0e9fa00 = []byte{ + // 308 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xb1, 0x4a, 0x03, 0x31, + 0x18, 0xc7, 0x2f, 0xa2, 0x1d, 0xe2, 0x16, 0xab, 0xc8, 0x21, 0x51, 0x0e, 0x07, 0x29, 0x98, 0xd0, + 0xfa, 0x02, 0xd2, 0xc9, 0x51, 0xbb, 0x08, 0x6e, 0x49, 0x09, 0xe9, 0x61, 0x9b, 0x2f, 0xbd, 0xe4, + 0xc4, 0x76, 0xf4, 0x09, 0x04, 0x71, 0xf6, 0x75, 0x3a, 0x16, 0x5c, 0x9c, 0x44, 0x5a, 0x1f, 0x44, + 0x9a, 0x1c, 0xda, 0x2a, 0x8a, 0xdb, 0xdd, 0x97, 0xdf, 0xef, 0x9f, 0x7f, 0x3e, 0xbc, 0xdd, 0x85, + 0xdc, 0xf8, 0xa2, 0x34, 0xd7, 0x7c, 0x58, 0xaa, 0x62, 0xc4, 0x6c, 0x01, 0x1e, 0x48, 0x2a, 0xc7, + 0x4a, 0xf4, 0x6d, 0x4f, 0x78, 0x25, 0x06, 0x4c, 0x8e, 0x15, 0xfb, 0xe4, 0xd2, 0xba, 0x06, 0x0d, + 0x01, 0xe3, 0x8b, 0xaf, 0x68, 0xa4, 0x7b, 0x1a, 0x40, 0xf7, 0x15, 0x17, 0x36, 0xe7, 0xc2, 0x18, + 0xf0, 0xc2, 0xe7, 0x60, 0x5c, 0x75, 0xda, 0xe8, 0x82, 0x1b, 0x80, 0xe3, 0x52, 0x38, 0x15, 0x2f, + 0xe2, 0x37, 0x4d, 0xa9, 0xbc, 0x68, 0x72, 0x2b, 0x74, 0x6e, 0x02, 0x5c, 0xb1, 0x3b, 0x5f, 0x95, + 0xac, 0x28, 0xc4, 0xa0, 0xca, 0xc8, 0xea, 0x98, 0x5c, 0x2c, 0xcc, 0xf3, 0x30, 0xec, 0xa8, 0x61, + 0xa9, 0x9c, 0xcf, 0x2e, 0xf1, 0xd6, 0xca, 0xd4, 0x59, 0x30, 0x4e, 0x91, 0x53, 0x5c, 0x8b, 0xf2, + 0x2e, 0x3a, 0x40, 0x47, 0x9b, 0xad, 0x8c, 0xfd, 0xfe, 0x22, 0x16, 0xdd, 0xf6, 0xfa, 0xe4, 0x75, + 0x3f, 0xe9, 0x54, 0x5e, 0xeb, 0x09, 0xe1, 0x8d, 0x90, 0x4c, 0x1e, 0x11, 0xae, 0x45, 0x84, 0xb0, + 0xbf, 0x62, 0x7e, 0xb6, 0x4b, 0xf9, 0xbf, 0xf9, 0xd8, 0x3b, 0x6b, 0xdc, 0x3d, 0xbf, 0x3f, 0xac, + 0x1d, 0x92, 0x8c, 0x2f, 0x8b, 0x8b, 0x1f, 0xfe, 0x7d, 0x2d, 0xed, 0xb3, 0xc9, 0x8c, 0xa2, 0xe9, + 0x8c, 0xa2, 0xb7, 0x19, 0x45, 0xf7, 0x73, 0x9a, 0x4c, 0xe7, 0x34, 0x79, 0x99, 0xd3, 0xe4, 0x8a, + 0xe9, 0xdc, 0xf7, 0x4a, 0xc9, 0xba, 0x10, 0xd4, 0xe3, 0xd5, 0xa0, 0xdb, 0xa5, 0x28, 0x3f, 0xb2, + 0xca, 0xc9, 0x5a, 0xd8, 0xf0, 0xc9, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0x50, 0x76, 0x59, 0x9b, + 0x0e, 0x02, 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, "/bzealphateam.bze.cointrunk.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: "/bzealphateam.bze.cointrunk.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: "bzealphateam.bze.cointrunk.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cointrunk/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/cointrunk/types/query.pb.gw.go b/x/cointrunk/types/query.pb.gw.go new file mode 100644 index 00000000..d4e4dda2 --- /dev/null +++ b/x/cointrunk/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cointrunk/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{"bzealphateam", "bze", "cointrunk", "params"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/cointrunk/types/tx.pb.go b/x/cointrunk/types/tx.pb.go new file mode 100644 index 00000000..fb7f977e --- /dev/null +++ b/x/cointrunk/types/tx.pb.go @@ -0,0 +1,81 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cointrunk/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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("cointrunk/tx.proto", fileDescriptor_776bb1586e9b1fcd) } + +var fileDescriptor_776bb1586e9b1fcd = []byte{ + // 135 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4a, 0xce, 0xcf, 0xcc, + 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, + 0x4a, 0xaa, 0x4a, 0x4d, 0xcc, 0x29, 0xc8, 0x48, 0x2c, 0x49, 0x4d, 0xcc, 0xd5, 0x4b, 0xaa, 0x4a, + 0xd5, 0x83, 0x2b, 0x32, 0x62, 0xe5, 0x62, 0xf6, 0x2d, 0x4e, 0x77, 0xf2, 0x38, 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, 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, + 0xfc, 0x5c, 0xfd, 0xa4, 0xaa, 0x54, 0x5d, 0xb8, 0x41, 0x20, 0x9e, 0x7e, 0x85, 0x3e, 0x92, 0x7d, + 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x3b, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x86, + 0xaa, 0x5a, 0x61, 0x89, 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: "bzealphateam.bze.cointrunk.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{}, + Metadata: "cointrunk/tx.proto", +} diff --git a/x/cointrunk/types/types.go b/x/cointrunk/types/types.go new file mode 100644 index 00000000..ab1254f4 --- /dev/null +++ b/x/cointrunk/types/types.go @@ -0,0 +1 @@ +package types From feb97c5038588c2c6369f7cd723331e78c9dd1e2 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 17 Nov 2022 22:45:30 +0200 Subject: [PATCH 03/54] wip --- go.mod | 8 ++-- go.sum | 16 ++++---- .../bze-alphateam/bze/bze.scavenge/index.ts | 40 +++++++++---------- .../bze/bze.scavenge/module/index.ts | 6 +-- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/go.mod b/go.mod index 6c61b551..a4f4b4cb 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/tendermint/starport v0.19.2 github.com/tendermint/tendermint v0.34.22 github.com/tendermint/tm-db v0.6.6 - google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c + google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1 google.golang.org/grpc v1.50.1 gopkg.in/yaml.v2 v2.4.0 ) @@ -114,9 +114,9 @@ require ( go.etcd.io/bbolt v1.3.6 // indirect golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect - golang.org/x/net v0.1.0 // indirect - golang.org/x/sys v0.1.0 // indirect - golang.org/x/term v0.1.0 // indirect + golang.org/x/net v0.2.0 // indirect + golang.org/x/sys v0.2.0 // indirect + golang.org/x/term v0.2.0 // indirect golang.org/x/text v0.4.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index 1dfbf1bb..4be8112d 100644 --- a/go.sum +++ b/go.sum @@ -1710,8 +1710,8 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1855,14 +1855,14 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2082,8 +2082,8 @@ google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaE google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c h1:QgY/XxIAIeccR+Ca/rDdKubLIU9rcJ3xfy1DC/Wd2Oo= -google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1 h1:jCw9YRd2s40X9Vxi4zKsPRvSPlHWNqadVkpbMsCPzPQ= +google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 36486b56..0a633940 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,21 +232,6 @@ export default { }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) - } - } - }, async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -277,20 +262,22 @@ export default { } } }, - - async MsgSubmitScavenge({ rootGetters }, { value }) { + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) const msg = await txClient.msgSubmitScavenge(value) - return msg + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result } catch (e) { if (e == MissingWalletError) { throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + }else{ + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) @@ -317,6 +304,19 @@ export default { } } }, + async MsgSubmitScavenge({ rootGetters }, { value }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgSubmitScavenge(value) + return msg + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + } else{ + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + } + } + }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 27b7f752..44bd4fda 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), }; }; From 5ca6aaed1af8ef8cf817d67ae909c424bd148706 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 17 Nov 2022 23:31:52 +0200 Subject: [PATCH 04/54] validate cointrunk params --- x/cointrunk/types/params.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/x/cointrunk/types/params.go b/x/cointrunk/types/params.go index 1577bf20..c66b7a1a 100644 --- a/x/cointrunk/types/params.go +++ b/x/cointrunk/types/params.go @@ -2,6 +2,7 @@ package types import ( "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" @@ -77,7 +78,9 @@ func validateAnonArticleLimit(v interface{}) error { return fmt.Errorf("invalid parameter type: %T", v) } - // TODO implement validation + if anonArticleLimit < 1 { + return fmt.Errorf("invalid anonArticleLimit. Expected uint64 higher than 0 received %v", anonArticleLimit) + } _ = anonArticleLimit return nil @@ -90,7 +93,10 @@ func validateAnonArticleCost(v interface{}) error { return fmt.Errorf("invalid parameter type: %T", v) } - // TODO implement validation + _, err := sdk.ParseCoinsNormalized(anonArticleCost) + if err != nil { + return err + } _ = anonArticleCost return nil From 3cfcd5d7e08d9331f0f34c8542ef23e549439b5c Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Sat, 19 Nov 2022 03:18:57 +0200 Subject: [PATCH 05/54] implemented accept domain and publisher proposals --- app/app.go | 32 +- app/export.go | 3 +- config.yml | 14 +- docs/static/openapi.yml | 536 +- proto/cointrunk/accepted_domain.proto | 10 + .../cointrunk/accepted_domain_proposal.proto | 12 + proto/cointrunk/genesis.proto | 2 +- proto/cointrunk/params.proto | 2 +- proto/cointrunk/publisher.proto | 11 + proto/cointrunk/publisher_proposal.proto | 13 + proto/cointrunk/query.proto | 2 +- proto/cointrunk/tx.proto | 2 +- testutil/keeper/cointrunk.go | 12 +- testutil/nullify/nullify.go | 57 + .../bze-alphateam/bze/bze.cointrunk/index.ts | 149 + .../bze/bze.cointrunk/module/index.ts | 57 + .../bze/bze.cointrunk/module/rest.ts | 251 + .../module/types/cointrunk/accepted_domain.ts | 92 + .../cointrunk/accepted_domain_proposal.ts | 139 + .../module/types/cointrunk/genesis.ts | 78 + .../module/types/cointrunk/params.ts | 130 + .../module/types/cointrunk/publisher.ts | 110 + .../types/cointrunk/publisher_proposal.ts | 153 + .../module/types/cointrunk/query.ts | 148 + .../module/types/cointrunk/tx.ts | 20 + .../cosmos/base/query/v1beta1/pagination.ts | 328 + .../module/types/gogoproto/gogo.ts | 2 + .../module/types/google/api/annotations.ts | 2 + .../module/types/google/api/http.ts | 706 +++ .../types/google/protobuf/descriptor.ts | 5314 +++++++++++++++++ .../bze/bze.cointrunk/package.json | 18 + .../bze-alphateam/bze/bze.cointrunk/vuex-root | 1 + .../bze-alphateam/bze/bze.scavenge/index.ts | 40 +- .../bze/bze.scavenge/module/index.ts | 6 +- .../bzealphateam.bze.cointrunk/module/rest.ts | 2 +- .../module/types/cointrunk/accepted_domain.ts | 92 + .../cointrunk/accepted_domain_proposal.ts | 139 + .../cointrunk/add_accepted_domain_proposal.ts | 148 + .../module/types/cointrunk/publisher.ts | 110 + .../types/cointrunk/publisher_proposal.ts | 153 + vue/src/store/generated/index.ts | 2 + x/cointrunk/client/cli/query.go | 3 +- x/cointrunk/client/cli/query_params.go | 2 +- x/cointrunk/client/cli/tx.go | 135 +- x/cointrunk/client/proposal_handler.go | 22 + x/cointrunk/handler.go | 2 +- x/cointrunk/keeper/cointrunk.go | 77 + x/cointrunk/keeper/grpc_query_params.go | 2 +- x/cointrunk/keeper/grpc_query_params_test.go | 4 +- x/cointrunk/keeper/keeper.go | 40 +- x/cointrunk/keeper/msg_server_test.go | 6 +- x/cointrunk/keeper/params.go | 1 - x/cointrunk/keeper/params_test.go | 2 +- x/cointrunk/module.go | 18 +- x/cointrunk/module_simulation.go | 4 +- x/cointrunk/proposal_handler.go | 40 + x/cointrunk/types/accepted_domain.pb.go | 356 ++ .../types/accepted_domain_proposal.pb.go | 464 ++ x/cointrunk/types/codec.go | 16 +- x/cointrunk/types/errors.go | 3 +- x/cointrunk/types/expected_keepers.go | 8 +- x/cointrunk/types/genesis.go | 10 +- x/cointrunk/types/genesis.pb.go | 26 +- x/cointrunk/types/genesis_test.go | 62 +- x/cointrunk/types/gov.go | 81 + x/cointrunk/types/key_accepted_domain.go | 23 + x/cointrunk/types/key_publisher.go | 23 + x/cointrunk/types/keys.go | 10 +- x/cointrunk/types/params.pb.go | 31 +- x/cointrunk/types/publisher.pb.go | 408 ++ x/cointrunk/types/publisher_proposal.pb.go | 515 ++ x/cointrunk/types/query.pb.go | 51 +- x/cointrunk/types/tx.pb.go | 19 +- x/scavenge/keeper/scavenge.go | 7 +- 74 files changed, 11079 insertions(+), 490 deletions(-) create mode 100644 proto/cointrunk/accepted_domain.proto create mode 100644 proto/cointrunk/accepted_domain_proposal.proto create mode 100644 proto/cointrunk/publisher.proto create mode 100644 proto/cointrunk/publisher_proposal.proto create mode 100644 testutil/nullify/nullify.go create mode 100755 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts create mode 100755 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/index.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/accepted_domain.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/accepted_domain_proposal.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/params.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher_proposal.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/tx.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cosmos/base/query/v1beta1/pagination.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/gogoproto/gogo.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/google/api/annotations.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/google/api/http.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/google/protobuf/descriptor.ts create mode 100755 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/package.json create mode 100755 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/vuex-root create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/accepted_domain.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/accepted_domain_proposal.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/add_accepted_domain_proposal.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/publisher.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/publisher_proposal.ts create mode 100644 x/cointrunk/client/proposal_handler.go create mode 100644 x/cointrunk/keeper/cointrunk.go create mode 100644 x/cointrunk/proposal_handler.go create mode 100644 x/cointrunk/types/accepted_domain.pb.go create mode 100644 x/cointrunk/types/accepted_domain_proposal.pb.go create mode 100644 x/cointrunk/types/gov.go create mode 100644 x/cointrunk/types/key_accepted_domain.go create mode 100644 x/cointrunk/types/key_publisher.go create mode 100644 x/cointrunk/types/publisher.pb.go create mode 100644 x/cointrunk/types/publisher_proposal.pb.go diff --git a/app/app.go b/app/app.go index d2f0ab4b..ea5b3ffa 100644 --- a/app/app.go +++ b/app/app.go @@ -95,6 +95,7 @@ import ( scavengemoduletypes "github.com/bze-alphateam/bze/x/scavenge/types" cointrunkmodule "github.com/bze-alphateam/bze/x/cointrunk" + cointrunkmoduleclient "github.com/bze-alphateam/bze/x/cointrunk/client" cointrunkmodulekeeper "github.com/bze-alphateam/bze/x/cointrunk/keeper" cointrunkmoduletypes "github.com/bze-alphateam/bze/x/cointrunk/types" // this line is used by starport scaffolding # stargate/app/moduleImport @@ -116,9 +117,11 @@ func getGovProposalHandlers() []govclient.ProposalHandler { distrclient.ProposalHandler, upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler, - // this line is used by starport scaffolding # stargate/app/govProposalHandler ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler, + cointrunkmoduleclient.AcceptedDomainProposalHandler, + cointrunkmoduleclient.PublisherProposalHandler, + // this line is used by starport scaffolding # stargate/app/govProposalHandler ) return govProposalHandlers @@ -327,14 +330,6 @@ func New( appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, ) - // register the proposal types - govRouter := govtypes.NewRouter() - govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) - // Create Transfer Keepers app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), @@ -350,11 +345,6 @@ func New( // If evidence needs to be handled for the app, set routes in router here and seal app.EvidenceKeeper = *evidenceKeeper - app.GovKeeper = govkeeper.NewKeeper( - appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - &stakingKeeper, govRouter, - ) - app.ScavengeKeeper = *scavengemodulekeeper.NewKeeper( appCodec, keys[scavengemoduletypes.StoreKey], @@ -375,6 +365,20 @@ func New( cointrunkModule := cointrunkmodule.NewAppModule(appCodec, app.CointrunkKeeper, app.AccountKeeper, app.BankKeeper) // this line is used by starport scaffolding # stargate/app/keeperDefinition + // register the proposal types + govRouter := govtypes.NewRouter() + govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). + AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). + AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). + AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). + AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). + AddRoute(cointrunkmoduletypes.RouterKey, cointrunkmodule.NewCointrunkProposalHandler(app.CointrunkKeeper)) + + app.GovKeeper = govkeeper.NewKeeper( + appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, + &stakingKeeper, govRouter, + ) + // Create static IBC router, add transfer route, then set and seal it ibcRouter := ibcporttypes.NewRouter() ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferModule) diff --git a/app/export.go b/app/export.go index a744e549..41dcc83d 100644 --- a/app/export.go +++ b/app/export.go @@ -50,7 +50,8 @@ func (app *App) ExportAppStateAndValidators( // prepare for fresh start at zero height // NOTE zero height genesis is a temporary feature which will be deprecated -// in favour of export at a block height +// +// in favour of export at a block height func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { applyAllowedAddrs := false diff --git a/config.yml b/config.yml index 003b5341..dbeec7ef 100644 --- a/config.yml +++ b/config.yml @@ -20,4 +20,16 @@ genesis: app_state: staking: params: - bond_denom: "utestbze" \ No newline at end of file + bond_denom: "utestbze" + gov: + voting_params: + voting_period: "120s" + deposit_params: + min_deposit: + - + denom: "utestbze" + amount: "1000000" + tally_params: + quorum: "0.00001" + threshold: "0.001" + veto_threshold: "0.01" \ No newline at end of file diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 77175191..b04ebe74 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -4,6 +4,48 @@ info: name: '' description: '' paths: + /bzealphateam/bze/cointrunk/params: + get: + summary: Parameters queries the parameters of the module. + operationId: BzeCointrunkParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + anonArticleLimit: + type: string + format: uint64 + anonArticleCost: + 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 /bze/scavenge/commit: get: summary: Queries a list of commit items. @@ -354,48 +396,6 @@ paths: type: string tags: - Query - /bzealphateam/bze/cointrunk/params: - get: - summary: Parameters queries the parameters of the module. - operationId: BzealphateamBzeCointrunkParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - anonArticleLimit: - type: string - format: uint64 - anonArticleCost: - 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 /cosmos/auth/v1beta1/accounts: get: summary: Accounts returns all the existing accounts @@ -30046,238 +30046,40 @@ paths: tags: - Query definitions: - bze.scavenge.Commit: + bze.cointrunk.Params: type: object properties: - index: - type: string - solutionHash: + anonArticleLimit: type: string - solutionScavengerHash: + format: uint64 + anonArticleCost: type: string - bze.scavenge.MsgCommitSolutionResponse: - type: object - bze.scavenge.MsgRevealSolutionResponse: - type: object - bze.scavenge.MsgSubmitScavengeResponse: - type: object - bze.scavenge.QueryAllCommitResponse: - type: object - properties: - commit: - type: array - items: - type: object - properties: - index: - type: string - solutionHash: - type: string - solutionScavengerHash: - type: string - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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; - } - bze.scavenge.QueryAllScavengeResponse: + description: Params defines the parameters for the module. + bze.cointrunk.QueryParamsResponse: type: object properties: - scavenge: - type: array - items: - type: object - properties: - index: - type: string - solutionHash: - type: string - solution: - type: string - description: - type: string - reward: - type: string - scavenger: - type: string - pagination: + params: + description: params holds all the parameters of this module. type: object properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + anonArticleLimit: 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; - } - bze.scavenge.QueryGetCommitResponse: - type: object - properties: - commit: - type: object - properties: - index: - type: string - solutionHash: - type: string - solutionScavengerHash: - type: string - bze.scavenge.QueryGetScavengeResponse: - type: object - properties: - scavenge: - type: object - properties: - index: - type: string - solutionHash: - type: string - solution: - type: string - description: - type: string - reward: - type: string - scavenger: + anonArticleCost: type: string - bze.scavenge.Scavenge: - type: object - properties: - index: - type: string - solutionHash: - type: string - solution: - type: string - description: - type: string - reward: - type: string - scavenger: - type: string - cosmos.base.query.v1beta1.PageRequest: + description: QueryParamsResponse is response type for the Query/Params RPC method. + google.protobuf.Any: 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': type: string - format: uint64 description: >- - limit is the total number of results to be returned in the result - page. + A URL/resource name that uniquely identifies the type of the + serialized - 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 + protocol buffer message. This string must contain at least - 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 - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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 + one "/" character. The last segment of the URL's path must represent the fully qualified name of the type (as in @@ -30589,28 +30391,226 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - bzealphateam.bze.cointrunk.Params: + bze.scavenge.Commit: type: object properties: - anonArticleLimit: + index: type: string - format: uint64 - anonArticleCost: + solutionHash: type: string - description: Params defines the parameters for the module. - bzealphateam.bze.cointrunk.QueryParamsResponse: + solutionScavengerHash: + type: string + bze.scavenge.MsgCommitSolutionResponse: + type: object + bze.scavenge.MsgRevealSolutionResponse: + type: object + bze.scavenge.MsgSubmitScavengeResponse: + type: object + bze.scavenge.QueryAllCommitResponse: type: object properties: - params: - description: params holds all the parameters of this module. + commit: + type: array + items: + type: object + properties: + index: + type: string + solutionHash: + type: string + solutionScavengerHash: + type: string + pagination: type: object properties: - anonArticleLimit: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: type: string format: uint64 - anonArticleCost: + 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; + } + bze.scavenge.QueryAllScavengeResponse: + type: object + properties: + scavenge: + type: array + items: + type: object + properties: + index: + type: string + solutionHash: + type: string + solution: + type: string + description: + type: string + reward: + type: string + scavenger: + type: string + pagination: + type: object + properties: + next_key: type: string - description: QueryParamsResponse is response type for the Query/Params RPC method. + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + bze.scavenge.QueryGetCommitResponse: + type: object + properties: + commit: + type: object + properties: + index: + type: string + solutionHash: + type: string + solutionScavengerHash: + type: string + bze.scavenge.QueryGetScavengeResponse: + type: object + properties: + scavenge: + type: object + properties: + index: + type: string + solutionHash: + type: string + solution: + type: string + description: + type: string + reward: + type: string + scavenger: + type: string + bze.scavenge.Scavenge: + type: object + properties: + index: + type: string + solutionHash: + type: string + solution: + type: string + description: + type: string + reward: + type: string + scavenger: + type: string + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } cosmos.auth.v1beta1.Params: type: object properties: diff --git a/proto/cointrunk/accepted_domain.proto b/proto/cointrunk/accepted_domain.proto new file mode 100644 index 00000000..013f39d8 --- /dev/null +++ b/proto/cointrunk/accepted_domain.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +package bze.cointrunk; + +option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; + +message AcceptedDomain { + + string domain = 1; + bool active = 2; +} diff --git a/proto/cointrunk/accepted_domain_proposal.proto b/proto/cointrunk/accepted_domain_proposal.proto new file mode 100644 index 00000000..2d9b3080 --- /dev/null +++ b/proto/cointrunk/accepted_domain_proposal.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package bze.cointrunk; + +option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; + +message AcceptedDomainProposal { + + string title = 1; + string description = 2; + string domain = 3; + bool active = 4; +} diff --git a/proto/cointrunk/genesis.proto b/proto/cointrunk/genesis.proto index 622246a2..a6bdb660 100644 --- a/proto/cointrunk/genesis.proto +++ b/proto/cointrunk/genesis.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package bzealphateam.bze.cointrunk; +package bze.cointrunk; import "gogoproto/gogo.proto"; import "cointrunk/params.proto"; diff --git a/proto/cointrunk/params.proto b/proto/cointrunk/params.proto index 90f264d3..7cbde734 100644 --- a/proto/cointrunk/params.proto +++ b/proto/cointrunk/params.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package bzealphateam.bze.cointrunk; +package bze.cointrunk; import "gogoproto/gogo.proto"; diff --git a/proto/cointrunk/publisher.proto b/proto/cointrunk/publisher.proto new file mode 100644 index 00000000..57279dbc --- /dev/null +++ b/proto/cointrunk/publisher.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package bze.cointrunk; + +option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; + +message Publisher { + + string name = 1; + string address = 2; + bool active = 3; +} diff --git a/proto/cointrunk/publisher_proposal.proto b/proto/cointrunk/publisher_proposal.proto new file mode 100644 index 00000000..db513cf2 --- /dev/null +++ b/proto/cointrunk/publisher_proposal.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package bze.cointrunk; + +option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; + +message PublisherProposal { + + string title = 1; + string description = 2; + string name = 3; + string address = 4; + bool active = 5; +} diff --git a/proto/cointrunk/query.proto b/proto/cointrunk/query.proto index 83e12447..a856ff00 100644 --- a/proto/cointrunk/query.proto +++ b/proto/cointrunk/query.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package bzealphateam.bze.cointrunk; +package bze.cointrunk; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; diff --git a/proto/cointrunk/tx.proto b/proto/cointrunk/tx.proto index 7ddbc529..e1100ad1 100644 --- a/proto/cointrunk/tx.proto +++ b/proto/cointrunk/tx.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package bzealphateam.bze.cointrunk; +package bze.cointrunk; // this line is used by starport scaffolding # proto/tx/import diff --git a/testutil/keeper/cointrunk.go b/testutil/keeper/cointrunk.go index 306fc4a8..22effda4 100644 --- a/testutil/keeper/cointrunk.go +++ b/testutil/keeper/cointrunk.go @@ -37,12 +37,12 @@ func CointrunkKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { "CointrunkParams", ) k := keeper.NewKeeper( - cdc, - storeKey, - memStoreKey, - paramsSubspace, - nil, - nil, + cdc, + storeKey, + memStoreKey, + paramsSubspace, + nil, + nil, ) ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) diff --git a/testutil/nullify/nullify.go b/testutil/nullify/nullify.go new file mode 100644 index 00000000..3b968c09 --- /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/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts new file mode 100755 index 00000000..28dcb8dd --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts @@ -0,0 +1,149 @@ +import { txClient, queryClient, MissingWalletError , registry} from './module' + +import { AcceptedDomain } from "./module/types/cointrunk/accepted_domain" +import { AcceptedDomainProposal } from "./module/types/cointrunk/accepted_domain_proposal" +import { Params } from "./module/types/cointrunk/params" +import { Publisher } from "./module/types/cointrunk/publisher" +import { PublisherProposal } from "./module/types/cointrunk/publisher_proposal" + + +export { AcceptedDomain, AcceptedDomainProposal, Params, Publisher, PublisherProposal }; + +async function initTxClient(vuexGetters) { + return await txClient(vuexGetters['common/wallet/signer'], { + addr: vuexGetters['common/env/apiTendermint'] + }) +} + +async function initQueryClient(vuexGetters) { + return await queryClient({ + addr: vuexGetters['common/env/apiCosmos'] + }) +} + +function mergeResults(value, next_values) { + for (let prop of Object.keys(next_values)) { + if (Array.isArray(next_values[prop])) { + value[prop]=[...value[prop], ...next_values[prop]] + }else{ + value[prop]=next_values[prop] + } + } + return value +} + +function getStructure(template) { + let structure = { fields: [] } + for (const [key, value] of Object.entries(template)) { + let field: any = {} + field.name = key + field.type = typeof value + structure.fields.push(field) + } + return structure +} + +const getDefaultState = () => { + return { + Params: {}, + + _Structure: { + AcceptedDomain: getStructure(AcceptedDomain.fromPartial({})), + AcceptedDomainProposal: getStructure(AcceptedDomainProposal.fromPartial({})), + Params: getStructure(Params.fromPartial({})), + Publisher: getStructure(Publisher.fromPartial({})), + PublisherProposal: getStructure(PublisherProposal.fromPartial({})), + + }, + _Registry: registry, + _Subscriptions: new Set(), + } +} + +// initial state +const state = getDefaultState() + +export default { + namespaced: true, + state, + mutations: { + RESET_STATE(state) { + Object.assign(state, getDefaultState()) + }, + QUERY(state, { query, key, value }) { + state[query][JSON.stringify(key)] = value + }, + SUBSCRIBE(state, subscription) { + state._Subscriptions.add(JSON.stringify(subscription)) + }, + UNSUBSCRIBE(state, subscription) { + state._Subscriptions.delete(JSON.stringify(subscription)) + } + }, + getters: { + getParams: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.Params[JSON.stringify(params)] ?? {} + }, + + getTypeStructure: (state) => (type) => { + return state._Structure[type].fields + }, + getRegistry: (state) => { + return state._Registry + } + }, + actions: { + init({ dispatch, rootGetters }) { + console.log('Vuex module: bze.cointrunk initialized!') + if (rootGetters['common/env/client']) { + rootGetters['common/env/client'].on('newblock', () => { + dispatch('StoreUpdate') + }) + } + }, + resetState({ commit }) { + commit('RESET_STATE') + }, + unsubscribe({ commit }, subscription) { + commit('UNSUBSCRIBE', subscription) + }, + async StoreUpdate({ state, dispatch }) { + state._Subscriptions.forEach(async (subscription) => { + try { + const sub=JSON.parse(subscription) + await dispatch(sub.action, sub.payload) + }catch(e) { + throw new Error('Subscriptions: ' + e.message) + } + }) + }, + + + + + + + async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryParams()).data + + + commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) + return getters['getParams']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + + + + } +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/index.ts new file mode 100755 index 00000000..67d4b093 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/index.ts @@ -0,0 +1,57 @@ +// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient } from "@cosmjs/stargate"; +import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; +import { Api } from "./rest"; + + +const types = [ + +]; +export const MissingWalletError = new Error("wallet is required"); + +export const registry = new Registry(types); + +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string +} + +interface SignAndBroadcastOptions { + fee: StdFee, + memo?: string +} + +const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { + if (!wallet) throw MissingWalletError; + let client; + if (addr) { + client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); + }else{ + client = await SigningStargateClient.offline( wallet, { registry }); + } + const { address } = (await wallet.getAccounts())[0]; + + return { + signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + + }; +}; + +interface QueryClientOptions { + addr: string +} + +const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseUrl: addr }); +}; + +export { + txClient, + queryClient, +}; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts new file mode 100644 index 00000000..955d29d8 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts @@ -0,0 +1,251 @@ +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** + * Params defines the parameters for the module. + */ +export interface CointrunkParams { + /** @format uint64 */ + anonArticleLimit?: string; + anonArticleCost?: string; +} + +/** + * QueryParamsResponse is response type for the Query/Params RPC method. + */ +export interface CointrunkQueryParamsResponse { + /** params holds all the parameters of this module. */ + params?: CointrunkParams; +} + +export interface ProtobufAny { + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: keyof Omit; + /** request body */ + body?: unknown; + /** base url */ + baseUrl?: string; + /** request cancellation token */ + cancelToken?: CancelToken; +} + +export type RequestParams = Omit; + +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: (securityData: SecurityDataType) => RequestParams | void; +} + +export interface HttpResponse extends Response { + data: D; + error: E; +} + +type CancelToken = Symbol | string | number; + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public baseUrl: string = ""; + private securityData: SecurityDataType = null as any; + private securityWorker: null | ApiConfig["securityWorker"] = null; + private abortControllers = new Map(); + + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; + + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } + + public setSecurityData = (data: SecurityDataType) => { + this.securityData = data; + }; + + private addQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + + return ( + encodeURIComponent(key) + + "=" + + encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) + ); + } + + protected toQueryString(rawQuery?: QueryParamsType): string { + const query = rawQuery || {}; + const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + return keys + .map((key) => + typeof query[key] === "object" && !Array.isArray(query[key]) + ? this.toQueryString(query[key] as QueryParamsType) + : this.addQueryParam(query, key), + ) + .join("&"); + } + + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? `?${queryString}` : ""; + } + + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, + [ContentType.FormData]: (input: any) => + Object.keys(input || {}).reduce((data, key) => { + data.append(key, input[key]); + return data; + }, new FormData()), + [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), + }; + + private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + if (this.abortControllers.has(cancelToken)) { + const abortController = this.abortControllers.get(cancelToken); + if (abortController) { + return abortController.signal; + } + return void 0; + } + + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; + + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); + + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; + + public request = ({ + body, + secure, + path, + type, + query, + format = "json", + baseUrl, + cancelToken, + ...params + }: FullRequestParams): Promise> => { + const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const queryString = query && this.toQueryString(query); + const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + + return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), + }).then(async (response) => { + const r = response as HttpResponse; + r.data = (null as unknown) as T; + r.error = (null as unknown) as E; + + const data = await response[format]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); + + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } + + if (!response.ok) throw data; + return data; + }); + }; +} + +/** + * @title cointrunk/accepted_domain.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryParams + * @summary Parameters queries the parameters of the module. + * @request GET:/bzealphateam/bze/cointrunk/params + */ + queryParams = (params: RequestParams = {}) => + this.request({ + path: `/bzealphateam/bze/cointrunk/params`, + method: "GET", + format: "json", + ...params, + }); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/accepted_domain.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/accepted_domain.ts new file mode 100644 index 00000000..c3ccefa6 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/accepted_domain.ts @@ -0,0 +1,92 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk"; + +export interface AcceptedDomain { + domain: string; + active: boolean; +} + +const baseAcceptedDomain: object = { domain: "", active: false }; + +export const AcceptedDomain = { + encode(message: AcceptedDomain, writer: Writer = Writer.create()): Writer { + if (message.domain !== "") { + writer.uint32(10).string(message.domain); + } + if (message.active === true) { + writer.uint32(16).bool(message.active); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): AcceptedDomain { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAcceptedDomain } as AcceptedDomain; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.domain = reader.string(); + break; + case 2: + message.active = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AcceptedDomain { + const message = { ...baseAcceptedDomain } as AcceptedDomain; + if (object.domain !== undefined && object.domain !== null) { + message.domain = String(object.domain); + } else { + message.domain = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = Boolean(object.active); + } else { + message.active = false; + } + return message; + }, + + toJSON(message: AcceptedDomain): unknown { + const obj: any = {}; + message.domain !== undefined && (obj.domain = message.domain); + message.active !== undefined && (obj.active = message.active); + return obj; + }, + + fromPartial(object: DeepPartial): AcceptedDomain { + const message = { ...baseAcceptedDomain } as AcceptedDomain; + if (object.domain !== undefined && object.domain !== null) { + message.domain = object.domain; + } else { + message.domain = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } else { + message.active = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/accepted_domain_proposal.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/accepted_domain_proposal.ts new file mode 100644 index 00000000..440d9905 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/accepted_domain_proposal.ts @@ -0,0 +1,139 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk"; + +export interface AcceptedDomainProposal { + title: string; + description: string; + domain: string; + active: boolean; +} + +const baseAcceptedDomainProposal: object = { + title: "", + description: "", + domain: "", + active: false, +}; + +export const AcceptedDomainProposal = { + encode( + message: AcceptedDomainProposal, + writer: Writer = Writer.create() + ): Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.domain !== "") { + writer.uint32(26).string(message.domain); + } + if (message.active === true) { + writer.uint32(32).bool(message.active); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): AcceptedDomainProposal { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAcceptedDomainProposal } as AcceptedDomainProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.domain = reader.string(); + break; + case 4: + message.active = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AcceptedDomainProposal { + const message = { ...baseAcceptedDomainProposal } as AcceptedDomainProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.domain !== undefined && object.domain !== null) { + message.domain = String(object.domain); + } else { + message.domain = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = Boolean(object.active); + } else { + message.active = false; + } + return message; + }, + + toJSON(message: AcceptedDomainProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.domain !== undefined && (obj.domain = message.domain); + message.active !== undefined && (obj.active = message.active); + return obj; + }, + + fromPartial( + object: DeepPartial + ): AcceptedDomainProposal { + const message = { ...baseAcceptedDomainProposal } as AcceptedDomainProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.domain !== undefined && object.domain !== null) { + message.domain = object.domain; + } else { + message.domain = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } else { + message.active = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts new file mode 100644 index 00000000..62782e44 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts @@ -0,0 +1,78 @@ +/* eslint-disable */ +import { Params } from "../cointrunk/params"; +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk"; + +/** GenesisState defines the cointrunk module's genesis state. */ +export interface GenesisState { + /** this line is used by starport scaffolding # genesis/proto/state */ + params: Params | undefined; +} + +const baseGenesisState: object = {}; + +export const GenesisState = { + encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/params.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/params.ts new file mode 100644 index 00000000..321d5a99 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/params.ts @@ -0,0 +1,130 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk"; + +/** Params defines the parameters for the module. */ +export interface Params { + anonArticleLimit: number; + anonArticleCost: string; +} + +const baseParams: object = { anonArticleLimit: 0, anonArticleCost: "" }; + +export const Params = { + encode(message: Params, writer: Writer = Writer.create()): Writer { + if (message.anonArticleLimit !== 0) { + writer.uint32(8).uint64(message.anonArticleLimit); + } + if (message.anonArticleCost !== "") { + writer.uint32(18).string(message.anonArticleCost); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Params { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.anonArticleLimit = longToNumber(reader.uint64() as Long); + break; + case 2: + message.anonArticleCost = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + if ( + object.anonArticleLimit !== undefined && + object.anonArticleLimit !== null + ) { + message.anonArticleLimit = Number(object.anonArticleLimit); + } else { + message.anonArticleLimit = 0; + } + if ( + object.anonArticleCost !== undefined && + object.anonArticleCost !== null + ) { + message.anonArticleCost = String(object.anonArticleCost); + } else { + message.anonArticleCost = ""; + } + return message; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.anonArticleLimit !== undefined && + (obj.anonArticleLimit = message.anonArticleLimit); + message.anonArticleCost !== undefined && + (obj.anonArticleCost = message.anonArticleCost); + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + if ( + object.anonArticleLimit !== undefined && + object.anonArticleLimit !== null + ) { + message.anonArticleLimit = object.anonArticleLimit; + } else { + message.anonArticleLimit = 0; + } + if ( + object.anonArticleCost !== undefined && + object.anonArticleCost !== null + ) { + message.anonArticleCost = object.anonArticleCost; + } else { + message.anonArticleCost = ""; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher.ts new file mode 100644 index 00000000..a332649d --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher.ts @@ -0,0 +1,110 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk"; + +export interface Publisher { + name: string; + address: string; + active: boolean; +} + +const basePublisher: object = { name: "", address: "", active: false }; + +export const Publisher = { + encode(message: Publisher, writer: Writer = Writer.create()): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.active === true) { + writer.uint32(24).bool(message.active); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Publisher { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublisher } as Publisher; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.active = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Publisher { + const message = { ...basePublisher } as Publisher; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = Boolean(object.active); + } else { + message.active = false; + } + return message; + }, + + toJSON(message: Publisher): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.address !== undefined && (obj.address = message.address); + message.active !== undefined && (obj.active = message.active); + return obj; + }, + + fromPartial(object: DeepPartial): Publisher { + const message = { ...basePublisher } as Publisher; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } else { + message.active = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher_proposal.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher_proposal.ts new file mode 100644 index 00000000..f066ab1a --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher_proposal.ts @@ -0,0 +1,153 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk"; + +export interface PublisherProposal { + title: string; + description: string; + name: string; + address: string; + active: boolean; +} + +const basePublisherProposal: object = { + title: "", + description: "", + name: "", + address: "", + active: false, +}; + +export const PublisherProposal = { + encode(message: PublisherProposal, writer: Writer = Writer.create()): Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.address !== "") { + writer.uint32(34).string(message.address); + } + if (message.active === true) { + writer.uint32(40).bool(message.active); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PublisherProposal { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublisherProposal } as PublisherProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.address = reader.string(); + break; + case 5: + message.active = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PublisherProposal { + const message = { ...basePublisherProposal } as PublisherProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = Boolean(object.active); + } else { + message.active = false; + } + return message; + }, + + toJSON(message: PublisherProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.name !== undefined && (obj.name = message.name); + message.address !== undefined && (obj.address = message.address); + message.active !== undefined && (obj.active = message.active); + return obj; + }, + + fromPartial(object: DeepPartial): PublisherProposal { + const message = { ...basePublisherProposal } as PublisherProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } else { + message.active = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts new file mode 100644 index 00000000..b05b8337 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts @@ -0,0 +1,148 @@ +/* eslint-disable */ +import { Reader, Writer } from "protobufjs/minimal"; +import { Params } from "../cointrunk/params"; + +export const protobufPackage = "bze.cointrunk"; + +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} + +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params | undefined; +} + +const baseQueryParamsRequest: object = {}; + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, +}; + +const baseQueryParamsResponse: object = {}; + +export const QueryParamsResponse = { + encode( + message: QueryParamsResponse, + writer: Writer = Writer.create() + ): Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** Parameters queries the parameters of the module. */ + Params(request: QueryParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("bze.cointrunk.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/tx.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/tx.ts new file mode 100644 index 00000000..aa7e3e92 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/tx.ts @@ -0,0 +1,20 @@ +/* eslint-disable */ +export const protobufPackage = "bze.cointrunk"; + +/** Msg defines the Msg service. */ +export interface Msg {} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 00000000..9c87ac0c --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,328 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.query.v1beta1"; + +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequest { + /** + * 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. + */ + key: Uint8Array; + /** + * 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. + */ + offset: number; + /** + * 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. + */ + limit: number; + /** + * 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. + */ + count_total: boolean; + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse: boolean; +} + +/** + * 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; + * } + */ +export interface PageResponse { + /** + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently + */ + next_key: Uint8Array; + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + */ + total: number; +} + +const basePageRequest: object = { + offset: 0, + limit: 0, + count_total: false, + reverse: false, +}; + +export const PageRequest = { + encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.offset !== 0) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== 0) { + writer.uint32(24).uint64(message.limit); + } + if (message.count_total === true) { + writer.uint32(32).bool(message.count_total); + } + if (message.reverse === true) { + writer.uint32(40).bool(message.reverse); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PageRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePageRequest } as PageRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.offset = longToNumber(reader.uint64() as Long); + break; + case 3: + message.limit = longToNumber(reader.uint64() as Long); + break; + case 4: + message.count_total = reader.bool(); + break; + case 5: + message.reverse = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PageRequest { + const message = { ...basePageRequest } as PageRequest; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = Number(object.offset); + } else { + message.offset = 0; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = Number(object.limit); + } else { + message.limit = 0; + } + if (object.count_total !== undefined && object.count_total !== null) { + message.count_total = Boolean(object.count_total); + } else { + message.count_total = false; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = Boolean(object.reverse); + } else { + message.reverse = false; + } + return message; + }, + + toJSON(message: PageRequest): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array() + )); + message.offset !== undefined && (obj.offset = message.offset); + message.limit !== undefined && (obj.limit = message.limit); + message.count_total !== undefined && + (obj.count_total = message.count_total); + message.reverse !== undefined && (obj.reverse = message.reverse); + return obj; + }, + + fromPartial(object: DeepPartial): PageRequest { + const message = { ...basePageRequest } as PageRequest; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = object.offset; + } else { + message.offset = 0; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = object.limit; + } else { + message.limit = 0; + } + if (object.count_total !== undefined && object.count_total !== null) { + message.count_total = object.count_total; + } else { + message.count_total = false; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = object.reverse; + } else { + message.reverse = false; + } + return message; + }, +}; + +const basePageResponse: object = { total: 0 }; + +export const PageResponse = { + encode(message: PageResponse, writer: Writer = Writer.create()): Writer { + if (message.next_key.length !== 0) { + writer.uint32(10).bytes(message.next_key); + } + if (message.total !== 0) { + writer.uint32(16).uint64(message.total); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PageResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePageResponse } as PageResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.next_key = reader.bytes(); + break; + case 2: + message.total = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PageResponse { + const message = { ...basePageResponse } as PageResponse; + if (object.next_key !== undefined && object.next_key !== null) { + message.next_key = bytesFromBase64(object.next_key); + } + if (object.total !== undefined && object.total !== null) { + message.total = Number(object.total); + } else { + message.total = 0; + } + return message; + }, + + toJSON(message: PageResponse): unknown { + const obj: any = {}; + message.next_key !== undefined && + (obj.next_key = base64FromBytes( + message.next_key !== undefined ? message.next_key : new Uint8Array() + )); + message.total !== undefined && (obj.total = message.total); + return obj; + }, + + fromPartial(object: DeepPartial): PageResponse { + const message = { ...basePageResponse } as PageResponse; + if (object.next_key !== undefined && object.next_key !== null) { + message.next_key = object.next_key; + } else { + message.next_key = new Uint8Array(); + } + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } else { + message.total = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/gogoproto/gogo.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/gogoproto/gogo.ts new file mode 100644 index 00000000..3f41a047 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/gogoproto/gogo.ts @@ -0,0 +1,2 @@ +/* eslint-disable */ +export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/google/api/annotations.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/google/api/annotations.ts new file mode 100644 index 00000000..aace4787 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/google/api/annotations.ts @@ -0,0 +1,2 @@ +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/google/api/http.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/google/api/http.ts new file mode 100644 index 00000000..ccadff68 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/google/api/http.ts @@ -0,0 +1,706 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "google.api"; + +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path parmeters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fully_decode_reserved_expansion: boolean; +} + +/** + * `HttpRule` defines the mapping of an RPC method to one or more HTTP + * REST API methods. The mapping specifies how different portions of the RPC + * request message are mapped to URL path, URL query parameters, and + * HTTP request body. The mapping is typically specified as an + * `google.api.http` annotation on the RPC method, + * see "google/api/annotations.proto" for details. + * + * The mapping consists of a field specifying the path template and + * method kind. The path template can refer to fields in the request + * message, as in the example below which describes a REST GET + * operation on a resource collection of messages: + * + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * SubMessage sub = 2; // `sub.subfield` is url-mapped + * } + * message Message { + * string text = 1; // content of the resource + * } + * + * The same http annotation can alternatively be expressed inside the + * `GRPC API Configuration` YAML file. + * + * http: + * rules: + * - selector: .Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * This definition enables an automatic, bidrectional mapping of HTTP + * JSON to RPC. Example: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` + * + * In general, not only fields but also field paths can be referenced + * from a path pattern. Fields mapped to the path pattern cannot be + * repeated and must have a primitive (non-message) type. + * + * Any fields in the request message which are not bound by the path + * pattern automatically become (optional) HTTP query + * parameters. Assume the following definition of the request message: + * + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * int64 revision = 2; // becomes a parameter + * SubMessage sub = 3; // `sub.subfield` becomes a parameter + * } + * + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` + * + * Note that fields which are mapped to HTTP parameters must have a + * primitive type or a repeated primitive type. Message types are not + * allowed. In the case of a repeated type, the parameter can be + * repeated in the URL, as in `...?param=A¶m=B`. + * + * For HTTP method kinds which allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | RPC + * -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | RPC + * -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice of + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * + * This enables the following two alternative HTTP JSON to RPC + * mappings: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` + * + * # Rules for HTTP mapping + * + * The rules for mapping HTTP path, query parameters, and body fields + * to the request message are as follows: + * + * 1. The `body` field specifies either `*` or a field path, or is + * omitted. If omitted, it indicates there is no HTTP request body. + * 2. Leaf fields (recursive expansion of nested messages in the + * request) can be classified into three types: + * (a) Matched in the URL template. + * (b) Covered by body (if body is `*`, everything except (a) fields; + * else everything under the body field) + * (c) All other fields. + * 3. URL query parameters found in the HTTP request are mapped to (c) fields. + * 4. Any body sent with an HTTP request can contain only (b) fields. + * + * The syntax of the path template is as follows: + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single path segment. The syntax `**` matches zero + * or more path segments, which must be the last part of the path except the + * `Verb`. The syntax `LITERAL` matches literal text in the path. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path, all characters + * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the + * Discovery Document as `{var}`. + * + * If a variable contains one or more path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path, all + * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables + * show up in the Discovery Document as `{+var}`. + * + * NOTE: While the single segment variable matches the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 + * Simple String Expansion, the multi segment variable **does not** match + * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. + * + * NOTE: the field paths in variables and in the `body` must not refer to + * repeated fields or map fields. + */ +export interface HttpRule { + /** + * Selects methods to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + */ + selector: string; + /** Used for listing and getting information about resources. */ + get: string | undefined; + /** Used for updating a resource. */ + put: string | undefined; + /** Used for creating a resource. */ + post: string | undefined; + /** Used for deleting a resource. */ + delete: string | undefined; + /** Used for updating a resource. */ + patch: string | undefined; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom: CustomHttpPattern | undefined; + /** + * The name of the request field whose value is mapped to the HTTP body, or + * `*` for mapping all fields not captured by the path pattern to the HTTP + * body. NOTE: the referred field must not be a repeated field and must be + * present at the top-level of request message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * body of response. Other response fields are ignored. When + * not set, the response message will be used as HTTP body of response. + */ + response_body: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additional_bindings: HttpRule[]; +} + +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPattern { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} + +const baseHttp: object = { fully_decode_reserved_expansion: false }; + +export const Http = { + encode(message: Http, writer: Writer = Writer.create()): Writer { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fully_decode_reserved_expansion === true) { + writer.uint32(16).bool(message.fully_decode_reserved_expansion); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Http { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHttp } as Http; + message.rules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rules.push(HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fully_decode_reserved_expansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromJSON(e)); + } + } + if ( + object.fully_decode_reserved_expansion !== undefined && + object.fully_decode_reserved_expansion !== null + ) { + message.fully_decode_reserved_expansion = Boolean( + object.fully_decode_reserved_expansion + ); + } else { + message.fully_decode_reserved_expansion = false; + } + return message; + }, + + toJSON(message: Http): unknown { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map((e) => + e ? HttpRule.toJSON(e) : undefined + ); + } else { + obj.rules = []; + } + message.fully_decode_reserved_expansion !== undefined && + (obj.fully_decode_reserved_expansion = + message.fully_decode_reserved_expansion); + return obj; + }, + + fromPartial(object: DeepPartial): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromPartial(e)); + } + } + if ( + object.fully_decode_reserved_expansion !== undefined && + object.fully_decode_reserved_expansion !== null + ) { + message.fully_decode_reserved_expansion = + object.fully_decode_reserved_expansion; + } else { + message.fully_decode_reserved_expansion = false; + } + return message; + }, +}; + +const baseHttpRule: object = { selector: "", body: "", response_body: "" }; + +export const HttpRule = { + encode(message: HttpRule, writer: Writer = Writer.create()): Writer { + if (message.selector !== "") { + writer.uint32(10).string(message.selector); + } + if (message.get !== undefined) { + writer.uint32(18).string(message.get); + } + if (message.put !== undefined) { + writer.uint32(26).string(message.put); + } + if (message.post !== undefined) { + writer.uint32(34).string(message.post); + } + if (message.delete !== undefined) { + writer.uint32(42).string(message.delete); + } + if (message.patch !== undefined) { + writer.uint32(50).string(message.patch); + } + if (message.custom !== undefined) { + CustomHttpPattern.encode( + message.custom, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.body !== "") { + writer.uint32(58).string(message.body); + } + if (message.response_body !== "") { + writer.uint32(98).string(message.response_body); + } + for (const v of message.additional_bindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): HttpRule { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message.delete = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.response_body = reader.string(); + break; + case 11: + message.additional_bindings.push( + HttpRule.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = String(object.selector); + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = String(object.get); + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = String(object.put); + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = String(object.post); + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = String(object.delete); + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = String(object.patch); + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromJSON(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = String(object.body); + } else { + message.body = ""; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.response_body = String(object.response_body); + } else { + message.response_body = ""; + } + if ( + object.additional_bindings !== undefined && + object.additional_bindings !== null + ) { + for (const e of object.additional_bindings) { + message.additional_bindings.push(HttpRule.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: HttpRule): unknown { + const obj: any = {}; + message.selector !== undefined && (obj.selector = message.selector); + message.get !== undefined && (obj.get = message.get); + message.put !== undefined && (obj.put = message.put); + message.post !== undefined && (obj.post = message.post); + message.delete !== undefined && (obj.delete = message.delete); + message.patch !== undefined && (obj.patch = message.patch); + message.custom !== undefined && + (obj.custom = message.custom + ? CustomHttpPattern.toJSON(message.custom) + : undefined); + message.body !== undefined && (obj.body = message.body); + message.response_body !== undefined && + (obj.response_body = message.response_body); + if (message.additional_bindings) { + obj.additional_bindings = message.additional_bindings.map((e) => + e ? HttpRule.toJSON(e) : undefined + ); + } else { + obj.additional_bindings = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromPartial(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } else { + message.body = ""; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.response_body = object.response_body; + } else { + message.response_body = ""; + } + if ( + object.additional_bindings !== undefined && + object.additional_bindings !== null + ) { + for (const e of object.additional_bindings) { + message.additional_bindings.push(HttpRule.fromPartial(e)); + } + } + return message; + }, +}; + +const baseCustomHttpPattern: object = { kind: "", path: "" }; + +export const CustomHttpPattern = { + encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + if (message.kind !== "") { + writer.uint32(10).string(message.kind); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = String(object.kind); + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = String(object.path); + } else { + message.path = ""; + } + return message; + }, + + toJSON(message: CustomHttpPattern): unknown { + const obj: any = {}; + message.kind !== undefined && (obj.kind = message.kind); + message.path !== undefined && (obj.path = message.path); + return obj; + }, + + fromPartial(object: DeepPartial): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/google/protobuf/descriptor.ts new file mode 100644 index 00000000..a0167cb2 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/google/protobuf/descriptor.ts @@ -0,0 +1,5314 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} + +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name: string; + /** e.g. "foo", "foo.bar", etc. */ + package: string; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + public_dependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weak_dependency: number[]; + /** All top-level definitions in this file. */ + message_type: DescriptorProto[]; + enum_type: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options: FileOptions | undefined; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + source_code_info: SourceCodeInfo | undefined; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax: string; +} + +/** Describes a message type. */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nested_type: DescriptorProto[]; + enum_type: EnumDescriptorProto[]; + extension_range: DescriptorProto_ExtensionRange[]; + oneof_decl: OneofDescriptorProto[]; + options: MessageOptions | undefined; + reserved_range: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reserved_name: string[]; +} + +export interface DescriptorProto_ExtensionRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; + options: ExtensionRangeOptions | undefined; +} + +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; +} + +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + type_name: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * TODO(kenton): Base-64 encode? + */ + default_value: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneof_index: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + json_name: string; + options: FieldOptions | undefined; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + */ + proto3_optional: boolean; +} + +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_TypeFromJSON( + object: any +): FieldDescriptorProto_Type { + switch (object) { + case 1: + case "TYPE_DOUBLE": + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case "TYPE_FLOAT": + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case "TYPE_INT64": + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case "TYPE_UINT64": + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case "TYPE_INT32": + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case "TYPE_FIXED64": + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case "TYPE_FIXED32": + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case "TYPE_BOOL": + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case "TYPE_STRING": + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case "TYPE_GROUP": + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case "TYPE_MESSAGE": + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case "TYPE_BYTES": + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case "TYPE_UINT32": + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case "TYPE_ENUM": + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case "TYPE_SFIXED32": + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case "TYPE_SFIXED64": + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case "TYPE_SINT32": + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case "TYPE_SINT64": + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_TypeToJSON( + object: FieldDescriptorProto_Type +): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return "TYPE_DOUBLE"; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return "TYPE_FLOAT"; + case FieldDescriptorProto_Type.TYPE_INT64: + return "TYPE_INT64"; + case FieldDescriptorProto_Type.TYPE_UINT64: + return "TYPE_UINT64"; + case FieldDescriptorProto_Type.TYPE_INT32: + return "TYPE_INT32"; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return "TYPE_FIXED64"; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return "TYPE_FIXED32"; + case FieldDescriptorProto_Type.TYPE_BOOL: + return "TYPE_BOOL"; + case FieldDescriptorProto_Type.TYPE_STRING: + return "TYPE_STRING"; + case FieldDescriptorProto_Type.TYPE_GROUP: + return "TYPE_GROUP"; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return "TYPE_MESSAGE"; + case FieldDescriptorProto_Type.TYPE_BYTES: + return "TYPE_BYTES"; + case FieldDescriptorProto_Type.TYPE_UINT32: + return "TYPE_UINT32"; + case FieldDescriptorProto_Type.TYPE_ENUM: + return "TYPE_ENUM"; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return "TYPE_SFIXED32"; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return "TYPE_SFIXED64"; + case FieldDescriptorProto_Type.TYPE_SINT32: + return "TYPE_SINT32"; + case FieldDescriptorProto_Type.TYPE_SINT64: + return "TYPE_SINT64"; + default: + return "UNKNOWN"; + } +} + +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_LabelFromJSON( + object: any +): FieldDescriptorProto_Label { + switch (object) { + case 1: + case "LABEL_OPTIONAL": + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_LabelToJSON( + object: FieldDescriptorProto_Label +): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return "LABEL_OPTIONAL"; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + default: + return "UNKNOWN"; + } +} + +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name: string; + options: OneofOptions | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: EnumOptions | undefined; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reserved_range: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reserved_name: string[]; +} + +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} + +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options: EnumValueOptions | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + input_type: string; + output_type: string; + options: MethodOptions | undefined; + /** Identifies if client streams multiple client messages */ + client_streaming: boolean; + /** Identifies if server streams multiple server messages */ + server_streaming: boolean; +} + +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + java_package: string; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + */ + java_outer_classname: string; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + java_multiple_files: boolean; + /** + * This option does nothing. + * + * @deprecated + */ + java_generate_equals_and_hash: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + java_string_check_utf8: boolean; + optimize_for: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + go_package: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + cc_generic_services: boolean; + java_generic_services: boolean; + py_generic_services: boolean; + php_generic_services: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + cc_enable_arenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objc_class_prefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharp_namespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swift_prefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + php_class_prefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + php_namespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + php_metadata_namespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + ruby_package: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpreted_option: UninterpretedOption[]; +} + +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, */ + SPEED = 1, + /** CODE_SIZE - etc. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} + +export function fileOptions_OptimizeModeFromJSON( + object: any +): FileOptions_OptimizeMode { + switch (object) { + case 1: + case "SPEED": + return FileOptions_OptimizeMode.SPEED; + case 2: + case "CODE_SIZE": + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case "LITE_RUNTIME": + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} + +export function fileOptions_OptimizeModeToJSON( + object: FileOptions_OptimizeMode +): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return "SPEED"; + case FileOptions_OptimizeMode.CODE_SIZE: + return "CODE_SIZE"; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return "LITE_RUNTIME"; + default: + return "UNKNOWN"; + } +} + +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + message_set_wire_format: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + no_standard_descriptor_accessor: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + map_entry: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + */ + lazy: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated: boolean; + /** For Google-internal migration only. Do not use. */ + weak: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case "STRING": + return FieldOptions_CType.STRING; + case 1: + case "CORD": + return FieldOptions_CType.CORD; + case 2: + case "STRING_PIECE": + return FieldOptions_CType.STRING_PIECE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} + +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return "STRING"; + case FieldOptions_CType.CORD: + return "CORD"; + case FieldOptions_CType.STRING_PIECE: + return "STRING_PIECE"; + default: + return "UNKNOWN"; + } +} + +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case "JS_NORMAL": + return FieldOptions_JSType.JS_NORMAL; + case 1: + case "JS_STRING": + return FieldOptions_JSType.JS_STRING; + case 2: + case "JS_NUMBER": + return FieldOptions_JSType.JS_NUMBER; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} + +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return "JS_NORMAL"; + case FieldOptions_JSType.JS_STRING: + return "JS_STRING"; + case FieldOptions_JSType.JS_NUMBER: + return "JS_NUMBER"; + default: + return "UNKNOWN"; + } +} + +export interface OneofOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allow_alias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface ServiceOptions { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated: boolean; + idempotency_level: MethodOptions_IdempotencyLevel; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} + +export function methodOptions_IdempotencyLevelFromJSON( + object: any +): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case "IDEMPOTENCY_UNKNOWN": + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case "NO_SIDE_EFFECTS": + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case "IDEMPOTENT": + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case "UNRECOGNIZED": + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} + +export function methodOptions_IdempotencyLevelToJSON( + object: MethodOptions_IdempotencyLevel +): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return "IDEMPOTENCY_UNKNOWN"; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return "NO_SIDE_EFFECTS"; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return "IDEMPOTENT"; + default: + return "UNKNOWN"; + } +} + +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifier_value: string; + positive_int_value: number; + negative_int_value: number; + double_value: number; + string_value: Uint8Array; + aggregate_value: string; +} + +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePart { + name_part: string; + is_extension: boolean; +} + +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} + +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition. For + * example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. * / + * /* Block comment attached to + * * grault. * / + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leading_comments: string; + trailing_comments: string; + leading_detached_comments: string[]; +} + +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} + +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + source_file: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end: number; +} + +const baseFileDescriptorSet: object = {}; + +export const FileDescriptorSet = { + encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.file.push( + FileDescriptorProto.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FileDescriptorSet): unknown { + const obj: any = {}; + if (message.file) { + obj.file = message.file.map((e) => + e ? FileDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.file = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFileDescriptorProto: object = { + name: "", + package: "", + dependency: "", + public_dependency: 0, + weak_dependency: 0, + syntax: "", +}; + +export const FileDescriptorProto = { + encode( + message: FileDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.package !== "") { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.public_dependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weak_dependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.message_type) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enum_type) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.source_code_info !== undefined) { + SourceCodeInfo.encode( + message.source_code_info, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.syntax !== "") { + writer.uint32(98).string(message.syntax); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.package = reader.string(); + break; + case 3: + message.dependency.push(reader.string()); + break; + case 10: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.public_dependency.push(reader.int32()); + } + } else { + message.public_dependency.push(reader.int32()); + } + break; + case 11: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weak_dependency.push(reader.int32()); + } + } else { + message.weak_dependency.push(reader.int32()); + } + break; + case 4: + message.message_type.push( + DescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 5: + message.enum_type.push( + EnumDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 6: + message.service.push( + ServiceDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 7: + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 8: + message.options = FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.source_code_info = SourceCodeInfo.decode( + reader, + reader.uint32() + ); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = String(object.package); + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(String(e)); + } + } + if ( + object.public_dependency !== undefined && + object.public_dependency !== null + ) { + for (const e of object.public_dependency) { + message.public_dependency.push(Number(e)); + } + } + if ( + object.weak_dependency !== undefined && + object.weak_dependency !== null + ) { + for (const e of object.weak_dependency) { + message.weak_dependency.push(Number(e)); + } + } + if (object.message_type !== undefined && object.message_type !== null) { + for (const e of object.message_type) { + message.message_type.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromJSON(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.source_code_info !== undefined && + object.source_code_info !== null + ) { + message.source_code_info = SourceCodeInfo.fromJSON( + object.source_code_info + ); + } else { + message.source_code_info = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = String(object.syntax); + } else { + message.syntax = ""; + } + return message; + }, + + toJSON(message: FileDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.package !== undefined && (obj.package = message.package); + if (message.dependency) { + obj.dependency = message.dependency.map((e) => e); + } else { + obj.dependency = []; + } + if (message.public_dependency) { + obj.public_dependency = message.public_dependency.map((e) => e); + } else { + obj.public_dependency = []; + } + if (message.weak_dependency) { + obj.weak_dependency = message.weak_dependency.map((e) => e); + } else { + obj.weak_dependency = []; + } + if (message.message_type) { + obj.message_type = message.message_type.map((e) => + e ? DescriptorProto.toJSON(e) : undefined + ); + } else { + obj.message_type = []; + } + if (message.enum_type) { + obj.enum_type = message.enum_type.map((e) => + e ? EnumDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.enum_type = []; + } + if (message.service) { + obj.service = message.service.map((e) => + e ? ServiceDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.service = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.extension = []; + } + message.options !== undefined && + (obj.options = message.options + ? FileOptions.toJSON(message.options) + : undefined); + message.source_code_info !== undefined && + (obj.source_code_info = message.source_code_info + ? SourceCodeInfo.toJSON(message.source_code_info) + : undefined); + message.syntax !== undefined && (obj.syntax = message.syntax); + return obj; + }, + + fromPartial(object: DeepPartial): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(e); + } + } + if ( + object.public_dependency !== undefined && + object.public_dependency !== null + ) { + for (const e of object.public_dependency) { + message.public_dependency.push(e); + } + } + if ( + object.weak_dependency !== undefined && + object.weak_dependency !== null + ) { + for (const e of object.weak_dependency) { + message.weak_dependency.push(e); + } + } + if (object.message_type !== undefined && object.message_type !== null) { + for (const e of object.message_type) { + message.message_type.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromPartial(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.source_code_info !== undefined && + object.source_code_info !== null + ) { + message.source_code_info = SourceCodeInfo.fromPartial( + object.source_code_info + ); + } else { + message.source_code_info = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } else { + message.syntax = ""; + } + return message; + }, +}; + +const baseDescriptorProto: object = { name: "", reserved_name: "" }; + +export const DescriptorProto = { + encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nested_type) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enum_type) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extension_range) { + DescriptorProto_ExtensionRange.encode( + v!, + writer.uint32(42).fork() + ).ldelim(); + } + for (const v of message.oneof_decl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reserved_range) { + DescriptorProto_ReservedRange.encode( + v!, + writer.uint32(74).fork() + ).ldelim(); + } + for (const v of message.reserved_name) { + writer.uint32(82).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.field.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 6: + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.nested_type.push( + DescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 4: + message.enum_type.push( + EnumDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 5: + message.extension_range.push( + DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) + ); + break; + case 8: + message.oneof_decl.push( + OneofDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 7: + message.options = MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + message.reserved_range.push( + DescriptorProto_ReservedRange.decode(reader, reader.uint32()) + ); + break; + case 10: + message.reserved_name.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.nested_type !== undefined && object.nested_type !== null) { + for (const e of object.nested_type) { + message.nested_type.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromJSON(e)); + } + } + if ( + object.extension_range !== undefined && + object.extension_range !== null + ) { + for (const e of object.extension_range) { + message.extension_range.push( + DescriptorProto_ExtensionRange.fromJSON(e) + ); + } + } + if (object.oneof_decl !== undefined && object.oneof_decl !== null) { + for (const e of object.oneof_decl) { + message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(String(e)); + } + } + return message; + }, + + toJSON(message: DescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.field) { + obj.field = message.field.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.field = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.extension = []; + } + if (message.nested_type) { + obj.nested_type = message.nested_type.map((e) => + e ? DescriptorProto.toJSON(e) : undefined + ); + } else { + obj.nested_type = []; + } + if (message.enum_type) { + obj.enum_type = message.enum_type.map((e) => + e ? EnumDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.enum_type = []; + } + if (message.extension_range) { + obj.extension_range = message.extension_range.map((e) => + e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined + ); + } else { + obj.extension_range = []; + } + if (message.oneof_decl) { + obj.oneof_decl = message.oneof_decl.map((e) => + e ? OneofDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.oneof_decl = []; + } + message.options !== undefined && + (obj.options = message.options + ? MessageOptions.toJSON(message.options) + : undefined); + if (message.reserved_range) { + obj.reserved_range = message.reserved_range.map((e) => + e ? DescriptorProto_ReservedRange.toJSON(e) : undefined + ); + } else { + obj.reserved_range = []; + } + if (message.reserved_name) { + obj.reserved_name = message.reserved_name.map((e) => e); + } else { + obj.reserved_name = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.nested_type !== undefined && object.nested_type !== null) { + for (const e of object.nested_type) { + message.nested_type.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromPartial(e)); + } + } + if ( + object.extension_range !== undefined && + object.extension_range !== null + ) { + for (const e of object.extension_range) { + message.extension_range.push( + DescriptorProto_ExtensionRange.fromPartial(e) + ); + } + } + if (object.oneof_decl !== undefined && object.oneof_decl !== null) { + for (const e of object.oneof_decl) { + message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + DescriptorProto_ReservedRange.fromPartial(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(e); + } + } + return message; + }, +}; + +const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; + +export const DescriptorProto_ExtensionRange = { + encode( + message: DescriptorProto_ExtensionRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode( + message.options, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): DescriptorProto_ExtensionRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = ExtensionRangeOptions.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ExtensionRange { + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: DescriptorProto_ExtensionRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + message.options !== undefined && + (obj.options = message.options + ? ExtensionRangeOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): DescriptorProto_ExtensionRange { + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; + +export const DescriptorProto_ReservedRange = { + encode( + message: DescriptorProto_ReservedRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): DescriptorProto_ReservedRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ReservedRange { + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: DescriptorProto_ReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): DescriptorProto_ReservedRange { + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +const baseExtensionRangeOptions: object = {}; + +export const ExtensionRangeOptions = { + encode( + message: ExtensionRangeOptions, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ExtensionRangeOptions): unknown { + const obj: any = {}; + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial( + object: DeepPartial + ): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFieldDescriptorProto: object = { + name: "", + number: 0, + label: 1, + type: 1, + type_name: "", + extendee: "", + default_value: "", + oneof_index: 0, + json_name: "", + proto3_optional: false, +}; + +export const FieldDescriptorProto = { + encode( + message: FieldDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.type_name !== "") { + writer.uint32(50).string(message.type_name); + } + if (message.extendee !== "") { + writer.uint32(18).string(message.extendee); + } + if (message.default_value !== "") { + writer.uint32(58).string(message.default_value); + } + if (message.oneof_index !== 0) { + writer.uint32(72).int32(message.oneof_index); + } + if (message.json_name !== "") { + writer.uint32(82).string(message.json_name); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.proto3_optional === true) { + writer.uint32(136).bool(message.proto3_optional); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32() as any; + break; + case 5: + message.type = reader.int32() as any; + break; + case 6: + message.type_name = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.default_value = reader.string(); + break; + case 9: + message.oneof_index = reader.int32(); + break; + case 10: + message.json_name = reader.string(); + break; + case 8: + message.options = FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3_optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = fieldDescriptorProto_LabelFromJSON(object.label); + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = fieldDescriptorProto_TypeFromJSON(object.type); + } else { + message.type = 1; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.type_name = String(object.type_name); + } else { + message.type_name = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = String(object.extendee); + } else { + message.extendee = ""; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.default_value = String(object.default_value); + } else { + message.default_value = ""; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneof_index = Number(object.oneof_index); + } else { + message.oneof_index = 0; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.json_name = String(object.json_name); + } else { + message.json_name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.proto3_optional !== undefined && + object.proto3_optional !== null + ) { + message.proto3_optional = Boolean(object.proto3_optional); + } else { + message.proto3_optional = false; + } + return message; + }, + + toJSON(message: FieldDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.label !== undefined && + (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); + message.type !== undefined && + (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); + message.type_name !== undefined && (obj.type_name = message.type_name); + message.extendee !== undefined && (obj.extendee = message.extendee); + message.default_value !== undefined && + (obj.default_value = message.default_value); + message.oneof_index !== undefined && + (obj.oneof_index = message.oneof_index); + message.json_name !== undefined && (obj.json_name = message.json_name); + message.options !== undefined && + (obj.options = message.options + ? FieldOptions.toJSON(message.options) + : undefined); + message.proto3_optional !== undefined && + (obj.proto3_optional = message.proto3_optional); + return obj; + }, + + fromPartial(object: DeepPartial): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 1; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.type_name = object.type_name; + } else { + message.type_name = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } else { + message.extendee = ""; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.default_value = object.default_value; + } else { + message.default_value = ""; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneof_index = object.oneof_index; + } else { + message.oneof_index = 0; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.json_name = object.json_name; + } else { + message.json_name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.proto3_optional !== undefined && + object.proto3_optional !== null + ) { + message.proto3_optional = object.proto3_optional; + } else { + message.proto3_optional = false; + } + return message; + }, +}; + +const baseOneofDescriptorProto: object = { name: "" }; + +export const OneofDescriptorProto = { + encode( + message: OneofDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: OneofDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.options !== undefined && + (obj.options = message.options + ? OneofOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; + +export const EnumDescriptorProto = { + encode( + message: EnumDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reserved_range) { + EnumDescriptorProto_EnumReservedRange.encode( + v!, + writer.uint32(34).fork() + ).ldelim(); + } + for (const v of message.reserved_name) { + writer.uint32(42).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value.push( + EnumValueDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.options = EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.decode( + reader, + reader.uint32() + ) + ); + break; + case 5: + message.reserved_name.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.fromJSON(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(String(e)); + } + } + return message; + }, + + toJSON(message: EnumDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.value) { + obj.value = message.value.map((e) => + e ? EnumValueDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.value = []; + } + message.options !== undefined && + (obj.options = message.options + ? EnumOptions.toJSON(message.options) + : undefined); + if (message.reserved_range) { + obj.reserved_range = message.reserved_range.map((e) => + e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined + ); + } else { + obj.reserved_range = []; + } + if (message.reserved_name) { + obj.reserved_name = message.reserved_name.map((e) => e); + } else { + obj.reserved_name = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.fromPartial(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(e); + } + } + return message; + }, +}; + +const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; + +export const EnumDescriptorProto_EnumReservedRange = { + encode( + message: EnumDescriptorProto_EnumReservedRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): EnumDescriptorProto_EnumReservedRange { + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; + +export const EnumValueDescriptorProto = { + encode( + message: EnumValueDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode( + message.options, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): EnumValueDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumValueDescriptorProto { + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: EnumValueDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.options !== undefined && + (obj.options = message.options + ? EnumValueOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): EnumValueDescriptorProto { + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseServiceDescriptorProto: object = { name: "" }; + +export const ServiceDescriptorProto = { + encode( + message: ServiceDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.method.push( + MethodDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.options = ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: ServiceDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.method) { + obj.method = message.method.map((e) => + e ? MethodDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.method = []; + } + message.options !== undefined && + (obj.options = message.options + ? ServiceOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseMethodDescriptorProto: object = { + name: "", + input_type: "", + output_type: "", + client_streaming: false, + server_streaming: false, +}; + +export const MethodDescriptorProto = { + encode( + message: MethodDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.input_type !== "") { + writer.uint32(18).string(message.input_type); + } + if (message.output_type !== "") { + writer.uint32(26).string(message.output_type); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + if (message.client_streaming === true) { + writer.uint32(40).bool(message.client_streaming); + } + if (message.server_streaming === true) { + writer.uint32(48).bool(message.server_streaming); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.input_type = reader.string(); + break; + case 3: + message.output_type = reader.string(); + break; + case 4: + message.options = MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.client_streaming = reader.bool(); + break; + case 6: + message.server_streaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.input_type = String(object.input_type); + } else { + message.input_type = ""; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.output_type = String(object.output_type); + } else { + message.output_type = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.client_streaming !== undefined && + object.client_streaming !== null + ) { + message.client_streaming = Boolean(object.client_streaming); + } else { + message.client_streaming = false; + } + if ( + object.server_streaming !== undefined && + object.server_streaming !== null + ) { + message.server_streaming = Boolean(object.server_streaming); + } else { + message.server_streaming = false; + } + return message; + }, + + toJSON(message: MethodDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.input_type !== undefined && (obj.input_type = message.input_type); + message.output_type !== undefined && + (obj.output_type = message.output_type); + message.options !== undefined && + (obj.options = message.options + ? MethodOptions.toJSON(message.options) + : undefined); + message.client_streaming !== undefined && + (obj.client_streaming = message.client_streaming); + message.server_streaming !== undefined && + (obj.server_streaming = message.server_streaming); + return obj; + }, + + fromPartial( + object: DeepPartial + ): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.input_type = object.input_type; + } else { + message.input_type = ""; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.output_type = object.output_type; + } else { + message.output_type = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.client_streaming !== undefined && + object.client_streaming !== null + ) { + message.client_streaming = object.client_streaming; + } else { + message.client_streaming = false; + } + if ( + object.server_streaming !== undefined && + object.server_streaming !== null + ) { + message.server_streaming = object.server_streaming; + } else { + message.server_streaming = false; + } + return message; + }, +}; + +const baseFileOptions: object = { + java_package: "", + java_outer_classname: "", + java_multiple_files: false, + java_generate_equals_and_hash: false, + java_string_check_utf8: false, + optimize_for: 1, + go_package: "", + cc_generic_services: false, + java_generic_services: false, + py_generic_services: false, + php_generic_services: false, + deprecated: false, + cc_enable_arenas: false, + objc_class_prefix: "", + csharp_namespace: "", + swift_prefix: "", + php_class_prefix: "", + php_namespace: "", + php_metadata_namespace: "", + ruby_package: "", +}; + +export const FileOptions = { + encode(message: FileOptions, writer: Writer = Writer.create()): Writer { + if (message.java_package !== "") { + writer.uint32(10).string(message.java_package); + } + if (message.java_outer_classname !== "") { + writer.uint32(66).string(message.java_outer_classname); + } + if (message.java_multiple_files === true) { + writer.uint32(80).bool(message.java_multiple_files); + } + if (message.java_generate_equals_and_hash === true) { + writer.uint32(160).bool(message.java_generate_equals_and_hash); + } + if (message.java_string_check_utf8 === true) { + writer.uint32(216).bool(message.java_string_check_utf8); + } + if (message.optimize_for !== 1) { + writer.uint32(72).int32(message.optimize_for); + } + if (message.go_package !== "") { + writer.uint32(90).string(message.go_package); + } + if (message.cc_generic_services === true) { + writer.uint32(128).bool(message.cc_generic_services); + } + if (message.java_generic_services === true) { + writer.uint32(136).bool(message.java_generic_services); + } + if (message.py_generic_services === true) { + writer.uint32(144).bool(message.py_generic_services); + } + if (message.php_generic_services === true) { + writer.uint32(336).bool(message.php_generic_services); + } + if (message.deprecated === true) { + writer.uint32(184).bool(message.deprecated); + } + if (message.cc_enable_arenas === true) { + writer.uint32(248).bool(message.cc_enable_arenas); + } + if (message.objc_class_prefix !== "") { + writer.uint32(290).string(message.objc_class_prefix); + } + if (message.csharp_namespace !== "") { + writer.uint32(298).string(message.csharp_namespace); + } + if (message.swift_prefix !== "") { + writer.uint32(314).string(message.swift_prefix); + } + if (message.php_class_prefix !== "") { + writer.uint32(322).string(message.php_class_prefix); + } + if (message.php_namespace !== "") { + writer.uint32(330).string(message.php_namespace); + } + if (message.php_metadata_namespace !== "") { + writer.uint32(354).string(message.php_metadata_namespace); + } + if (message.ruby_package !== "") { + writer.uint32(362).string(message.ruby_package); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.java_package = reader.string(); + break; + case 8: + message.java_outer_classname = reader.string(); + break; + case 10: + message.java_multiple_files = reader.bool(); + break; + case 20: + message.java_generate_equals_and_hash = reader.bool(); + break; + case 27: + message.java_string_check_utf8 = reader.bool(); + break; + case 9: + message.optimize_for = reader.int32() as any; + break; + case 11: + message.go_package = reader.string(); + break; + case 16: + message.cc_generic_services = reader.bool(); + break; + case 17: + message.java_generic_services = reader.bool(); + break; + case 18: + message.py_generic_services = reader.bool(); + break; + case 42: + message.php_generic_services = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.cc_enable_arenas = reader.bool(); + break; + case 36: + message.objc_class_prefix = reader.string(); + break; + case 37: + message.csharp_namespace = reader.string(); + break; + case 39: + message.swift_prefix = reader.string(); + break; + case 40: + message.php_class_prefix = reader.string(); + break; + case 41: + message.php_namespace = reader.string(); + break; + case 44: + message.php_metadata_namespace = reader.string(); + break; + case 45: + message.ruby_package = reader.string(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + if (object.java_package !== undefined && object.java_package !== null) { + message.java_package = String(object.java_package); + } else { + message.java_package = ""; + } + if ( + object.java_outer_classname !== undefined && + object.java_outer_classname !== null + ) { + message.java_outer_classname = String(object.java_outer_classname); + } else { + message.java_outer_classname = ""; + } + if ( + object.java_multiple_files !== undefined && + object.java_multiple_files !== null + ) { + message.java_multiple_files = Boolean(object.java_multiple_files); + } else { + message.java_multiple_files = false; + } + if ( + object.java_generate_equals_and_hash !== undefined && + object.java_generate_equals_and_hash !== null + ) { + message.java_generate_equals_and_hash = Boolean( + object.java_generate_equals_and_hash + ); + } else { + message.java_generate_equals_and_hash = false; + } + if ( + object.java_string_check_utf8 !== undefined && + object.java_string_check_utf8 !== null + ) { + message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); + } else { + message.java_string_check_utf8 = false; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimize_for = fileOptions_OptimizeModeFromJSON( + object.optimize_for + ); + } else { + message.optimize_for = 1; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.go_package = String(object.go_package); + } else { + message.go_package = ""; + } + if ( + object.cc_generic_services !== undefined && + object.cc_generic_services !== null + ) { + message.cc_generic_services = Boolean(object.cc_generic_services); + } else { + message.cc_generic_services = false; + } + if ( + object.java_generic_services !== undefined && + object.java_generic_services !== null + ) { + message.java_generic_services = Boolean(object.java_generic_services); + } else { + message.java_generic_services = false; + } + if ( + object.py_generic_services !== undefined && + object.py_generic_services !== null + ) { + message.py_generic_services = Boolean(object.py_generic_services); + } else { + message.py_generic_services = false; + } + if ( + object.php_generic_services !== undefined && + object.php_generic_services !== null + ) { + message.php_generic_services = Boolean(object.php_generic_services); + } else { + message.php_generic_services = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.cc_enable_arenas !== undefined && + object.cc_enable_arenas !== null + ) { + message.cc_enable_arenas = Boolean(object.cc_enable_arenas); + } else { + message.cc_enable_arenas = false; + } + if ( + object.objc_class_prefix !== undefined && + object.objc_class_prefix !== null + ) { + message.objc_class_prefix = String(object.objc_class_prefix); + } else { + message.objc_class_prefix = ""; + } + if ( + object.csharp_namespace !== undefined && + object.csharp_namespace !== null + ) { + message.csharp_namespace = String(object.csharp_namespace); + } else { + message.csharp_namespace = ""; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swift_prefix = String(object.swift_prefix); + } else { + message.swift_prefix = ""; + } + if ( + object.php_class_prefix !== undefined && + object.php_class_prefix !== null + ) { + message.php_class_prefix = String(object.php_class_prefix); + } else { + message.php_class_prefix = ""; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.php_namespace = String(object.php_namespace); + } else { + message.php_namespace = ""; + } + if ( + object.php_metadata_namespace !== undefined && + object.php_metadata_namespace !== null + ) { + message.php_metadata_namespace = String(object.php_metadata_namespace); + } else { + message.php_metadata_namespace = ""; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.ruby_package = String(object.ruby_package); + } else { + message.ruby_package = ""; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FileOptions): unknown { + const obj: any = {}; + message.java_package !== undefined && + (obj.java_package = message.java_package); + message.java_outer_classname !== undefined && + (obj.java_outer_classname = message.java_outer_classname); + message.java_multiple_files !== undefined && + (obj.java_multiple_files = message.java_multiple_files); + message.java_generate_equals_and_hash !== undefined && + (obj.java_generate_equals_and_hash = + message.java_generate_equals_and_hash); + message.java_string_check_utf8 !== undefined && + (obj.java_string_check_utf8 = message.java_string_check_utf8); + message.optimize_for !== undefined && + (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); + message.go_package !== undefined && (obj.go_package = message.go_package); + message.cc_generic_services !== undefined && + (obj.cc_generic_services = message.cc_generic_services); + message.java_generic_services !== undefined && + (obj.java_generic_services = message.java_generic_services); + message.py_generic_services !== undefined && + (obj.py_generic_services = message.py_generic_services); + message.php_generic_services !== undefined && + (obj.php_generic_services = message.php_generic_services); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.cc_enable_arenas !== undefined && + (obj.cc_enable_arenas = message.cc_enable_arenas); + message.objc_class_prefix !== undefined && + (obj.objc_class_prefix = message.objc_class_prefix); + message.csharp_namespace !== undefined && + (obj.csharp_namespace = message.csharp_namespace); + message.swift_prefix !== undefined && + (obj.swift_prefix = message.swift_prefix); + message.php_class_prefix !== undefined && + (obj.php_class_prefix = message.php_class_prefix); + message.php_namespace !== undefined && + (obj.php_namespace = message.php_namespace); + message.php_metadata_namespace !== undefined && + (obj.php_metadata_namespace = message.php_metadata_namespace); + message.ruby_package !== undefined && + (obj.ruby_package = message.ruby_package); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + if (object.java_package !== undefined && object.java_package !== null) { + message.java_package = object.java_package; + } else { + message.java_package = ""; + } + if ( + object.java_outer_classname !== undefined && + object.java_outer_classname !== null + ) { + message.java_outer_classname = object.java_outer_classname; + } else { + message.java_outer_classname = ""; + } + if ( + object.java_multiple_files !== undefined && + object.java_multiple_files !== null + ) { + message.java_multiple_files = object.java_multiple_files; + } else { + message.java_multiple_files = false; + } + if ( + object.java_generate_equals_and_hash !== undefined && + object.java_generate_equals_and_hash !== null + ) { + message.java_generate_equals_and_hash = + object.java_generate_equals_and_hash; + } else { + message.java_generate_equals_and_hash = false; + } + if ( + object.java_string_check_utf8 !== undefined && + object.java_string_check_utf8 !== null + ) { + message.java_string_check_utf8 = object.java_string_check_utf8; + } else { + message.java_string_check_utf8 = false; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimize_for = object.optimize_for; + } else { + message.optimize_for = 1; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.go_package = object.go_package; + } else { + message.go_package = ""; + } + if ( + object.cc_generic_services !== undefined && + object.cc_generic_services !== null + ) { + message.cc_generic_services = object.cc_generic_services; + } else { + message.cc_generic_services = false; + } + if ( + object.java_generic_services !== undefined && + object.java_generic_services !== null + ) { + message.java_generic_services = object.java_generic_services; + } else { + message.java_generic_services = false; + } + if ( + object.py_generic_services !== undefined && + object.py_generic_services !== null + ) { + message.py_generic_services = object.py_generic_services; + } else { + message.py_generic_services = false; + } + if ( + object.php_generic_services !== undefined && + object.php_generic_services !== null + ) { + message.php_generic_services = object.php_generic_services; + } else { + message.php_generic_services = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.cc_enable_arenas !== undefined && + object.cc_enable_arenas !== null + ) { + message.cc_enable_arenas = object.cc_enable_arenas; + } else { + message.cc_enable_arenas = false; + } + if ( + object.objc_class_prefix !== undefined && + object.objc_class_prefix !== null + ) { + message.objc_class_prefix = object.objc_class_prefix; + } else { + message.objc_class_prefix = ""; + } + if ( + object.csharp_namespace !== undefined && + object.csharp_namespace !== null + ) { + message.csharp_namespace = object.csharp_namespace; + } else { + message.csharp_namespace = ""; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swift_prefix = object.swift_prefix; + } else { + message.swift_prefix = ""; + } + if ( + object.php_class_prefix !== undefined && + object.php_class_prefix !== null + ) { + message.php_class_prefix = object.php_class_prefix; + } else { + message.php_class_prefix = ""; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.php_namespace = object.php_namespace; + } else { + message.php_namespace = ""; + } + if ( + object.php_metadata_namespace !== undefined && + object.php_metadata_namespace !== null + ) { + message.php_metadata_namespace = object.php_metadata_namespace; + } else { + message.php_metadata_namespace = ""; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.ruby_package = object.ruby_package; + } else { + message.ruby_package = ""; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMessageOptions: object = { + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + deprecated: false, + map_entry: false, +}; + +export const MessageOptions = { + encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { + if (message.message_set_wire_format === true) { + writer.uint32(8).bool(message.message_set_wire_format); + } + if (message.no_standard_descriptor_accessor === true) { + writer.uint32(16).bool(message.no_standard_descriptor_accessor); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.map_entry === true) { + writer.uint32(56).bool(message.map_entry); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message_set_wire_format = reader.bool(); + break; + case 2: + message.no_standard_descriptor_accessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.map_entry = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + if ( + object.message_set_wire_format !== undefined && + object.message_set_wire_format !== null + ) { + message.message_set_wire_format = Boolean(object.message_set_wire_format); + } else { + message.message_set_wire_format = false; + } + if ( + object.no_standard_descriptor_accessor !== undefined && + object.no_standard_descriptor_accessor !== null + ) { + message.no_standard_descriptor_accessor = Boolean( + object.no_standard_descriptor_accessor + ); + } else { + message.no_standard_descriptor_accessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.map_entry = Boolean(object.map_entry); + } else { + message.map_entry = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MessageOptions): unknown { + const obj: any = {}; + message.message_set_wire_format !== undefined && + (obj.message_set_wire_format = message.message_set_wire_format); + message.no_standard_descriptor_accessor !== undefined && + (obj.no_standard_descriptor_accessor = + message.no_standard_descriptor_accessor); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.map_entry !== undefined && (obj.map_entry = message.map_entry); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + if ( + object.message_set_wire_format !== undefined && + object.message_set_wire_format !== null + ) { + message.message_set_wire_format = object.message_set_wire_format; + } else { + message.message_set_wire_format = false; + } + if ( + object.no_standard_descriptor_accessor !== undefined && + object.no_standard_descriptor_accessor !== null + ) { + message.no_standard_descriptor_accessor = + object.no_standard_descriptor_accessor; + } else { + message.no_standard_descriptor_accessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.map_entry = object.map_entry; + } else { + message.map_entry = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFieldOptions: object = { + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + deprecated: false, + weak: false, +}; + +export const FieldOptions = { + encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + if (message.ctype !== 0) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed === true) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== 0) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy === true) { + writer.uint32(40).bool(message.lazy); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak === true) { + writer.uint32(80).bool(message.weak); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32() as any; + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32() as any; + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = fieldOptions_CTypeFromJSON(object.ctype); + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = Boolean(object.packed); + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = Boolean(object.lazy); + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = Boolean(object.weak); + } else { + message.weak = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FieldOptions): unknown { + const obj: any = {}; + message.ctype !== undefined && + (obj.ctype = fieldOptions_CTypeToJSON(message.ctype)); + message.packed !== undefined && (obj.packed = message.packed); + message.jstype !== undefined && + (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); + message.lazy !== undefined && (obj.lazy = message.lazy); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.weak !== undefined && (obj.weak = message.weak); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = object.ctype; + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = object.jstype; + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } else { + message.weak = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseOneofOptions: object = {}; + +export const OneofOptions = { + encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: OneofOptions): unknown { + const obj: any = {}; + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseEnumOptions: object = { allow_alias: false, deprecated: false }; + +export const EnumOptions = { + encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { + if (message.allow_alias === true) { + writer.uint32(16).bool(message.allow_alias); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allow_alias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allow_alias = Boolean(object.allow_alias); + } else { + message.allow_alias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: EnumOptions): unknown { + const obj: any = {}; + message.allow_alias !== undefined && + (obj.allow_alias = message.allow_alias); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allow_alias = object.allow_alias; + } else { + message.allow_alias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseEnumValueOptions: object = { deprecated: false }; + +export const EnumValueOptions = { + encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(8).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: EnumValueOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseServiceOptions: object = { deprecated: false }; + +export const ServiceOptions = { + encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ServiceOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; + +export const MethodOptions = { + encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + if (message.idempotency_level !== 0) { + writer.uint32(272).int32(message.idempotency_level); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotency_level = reader.int32() as any; + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.idempotency_level !== undefined && + object.idempotency_level !== null + ) { + message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( + object.idempotency_level + ); + } else { + message.idempotency_level = 0; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MethodOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.idempotency_level !== undefined && + (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( + message.idempotency_level + )); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.idempotency_level !== undefined && + object.idempotency_level !== null + ) { + message.idempotency_level = object.idempotency_level; + } else { + message.idempotency_level = 0; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseUninterpretedOption: object = { + identifier_value: "", + positive_int_value: 0, + negative_int_value: 0, + double_value: 0, + aggregate_value: "", +}; + +export const UninterpretedOption = { + encode( + message: UninterpretedOption, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.name) { + UninterpretedOption_NamePart.encode( + v!, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.identifier_value !== "") { + writer.uint32(26).string(message.identifier_value); + } + if (message.positive_int_value !== 0) { + writer.uint32(32).uint64(message.positive_int_value); + } + if (message.negative_int_value !== 0) { + writer.uint32(40).int64(message.negative_int_value); + } + if (message.double_value !== 0) { + writer.uint32(49).double(message.double_value); + } + if (message.string_value.length !== 0) { + writer.uint32(58).bytes(message.string_value); + } + if (message.aggregate_value !== "") { + writer.uint32(66).string(message.aggregate_value); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.name.push( + UninterpretedOption_NamePart.decode(reader, reader.uint32()) + ); + break; + case 3: + message.identifier_value = reader.string(); + break; + case 4: + message.positive_int_value = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negative_int_value = longToNumber(reader.int64() as Long); + break; + case 6: + message.double_value = reader.double(); + break; + case 7: + message.string_value = reader.bytes(); + break; + case 8: + message.aggregate_value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromJSON(e)); + } + } + if ( + object.identifier_value !== undefined && + object.identifier_value !== null + ) { + message.identifier_value = String(object.identifier_value); + } else { + message.identifier_value = ""; + } + if ( + object.positive_int_value !== undefined && + object.positive_int_value !== null + ) { + message.positive_int_value = Number(object.positive_int_value); + } else { + message.positive_int_value = 0; + } + if ( + object.negative_int_value !== undefined && + object.negative_int_value !== null + ) { + message.negative_int_value = Number(object.negative_int_value); + } else { + message.negative_int_value = 0; + } + if (object.double_value !== undefined && object.double_value !== null) { + message.double_value = Number(object.double_value); + } else { + message.double_value = 0; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.string_value = bytesFromBase64(object.string_value); + } + if ( + object.aggregate_value !== undefined && + object.aggregate_value !== null + ) { + message.aggregate_value = String(object.aggregate_value); + } else { + message.aggregate_value = ""; + } + return message; + }, + + toJSON(message: UninterpretedOption): unknown { + const obj: any = {}; + if (message.name) { + obj.name = message.name.map((e) => + e ? UninterpretedOption_NamePart.toJSON(e) : undefined + ); + } else { + obj.name = []; + } + message.identifier_value !== undefined && + (obj.identifier_value = message.identifier_value); + message.positive_int_value !== undefined && + (obj.positive_int_value = message.positive_int_value); + message.negative_int_value !== undefined && + (obj.negative_int_value = message.negative_int_value); + message.double_value !== undefined && + (obj.double_value = message.double_value); + message.string_value !== undefined && + (obj.string_value = base64FromBytes( + message.string_value !== undefined + ? message.string_value + : new Uint8Array() + )); + message.aggregate_value !== undefined && + (obj.aggregate_value = message.aggregate_value); + return obj; + }, + + fromPartial(object: DeepPartial): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromPartial(e)); + } + } + if ( + object.identifier_value !== undefined && + object.identifier_value !== null + ) { + message.identifier_value = object.identifier_value; + } else { + message.identifier_value = ""; + } + if ( + object.positive_int_value !== undefined && + object.positive_int_value !== null + ) { + message.positive_int_value = object.positive_int_value; + } else { + message.positive_int_value = 0; + } + if ( + object.negative_int_value !== undefined && + object.negative_int_value !== null + ) { + message.negative_int_value = object.negative_int_value; + } else { + message.negative_int_value = 0; + } + if (object.double_value !== undefined && object.double_value !== null) { + message.double_value = object.double_value; + } else { + message.double_value = 0; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.string_value = object.string_value; + } else { + message.string_value = new Uint8Array(); + } + if ( + object.aggregate_value !== undefined && + object.aggregate_value !== null + ) { + message.aggregate_value = object.aggregate_value; + } else { + message.aggregate_value = ""; + } + return message; + }, +}; + +const baseUninterpretedOption_NamePart: object = { + name_part: "", + is_extension: false, +}; + +export const UninterpretedOption_NamePart = { + encode( + message: UninterpretedOption_NamePart, + writer: Writer = Writer.create() + ): Writer { + if (message.name_part !== "") { + writer.uint32(10).string(message.name_part); + } + if (message.is_extension === true) { + writer.uint32(16).bool(message.is_extension); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): UninterpretedOption_NamePart { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name_part = reader.string(); + break; + case 2: + message.is_extension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninterpretedOption_NamePart { + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + if (object.name_part !== undefined && object.name_part !== null) { + message.name_part = String(object.name_part); + } else { + message.name_part = ""; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.is_extension = Boolean(object.is_extension); + } else { + message.is_extension = false; + } + return message; + }, + + toJSON(message: UninterpretedOption_NamePart): unknown { + const obj: any = {}; + message.name_part !== undefined && (obj.name_part = message.name_part); + message.is_extension !== undefined && + (obj.is_extension = message.is_extension); + return obj; + }, + + fromPartial( + object: DeepPartial + ): UninterpretedOption_NamePart { + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + if (object.name_part !== undefined && object.name_part !== null) { + message.name_part = object.name_part; + } else { + message.name_part = ""; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.is_extension = object.is_extension; + } else { + message.is_extension = false; + } + return message; + }, +}; + +const baseSourceCodeInfo: object = {}; + +export const SourceCodeInfo = { + encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location.push( + SourceCodeInfo_Location.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: SourceCodeInfo): unknown { + const obj: any = {}; + if (message.location) { + obj.location = message.location.map((e) => + e ? SourceCodeInfo_Location.toJSON(e) : undefined + ); + } else { + obj.location = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromPartial(e)); + } + } + return message; + }, +}; + +const baseSourceCodeInfo_Location: object = { + path: 0, + span: 0, + leading_comments: "", + trailing_comments: "", + leading_detached_comments: "", +}; + +export const SourceCodeInfo_Location = { + encode( + message: SourceCodeInfo_Location, + writer: Writer = Writer.create() + ): Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + if (message.leading_comments !== "") { + writer.uint32(26).string(message.leading_comments); + } + if (message.trailing_comments !== "") { + writer.uint32(34).string(message.trailing_comments); + } + for (const v of message.leading_detached_comments) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + } else { + message.span.push(reader.int32()); + } + break; + case 3: + message.leading_comments = reader.string(); + break; + case 4: + message.trailing_comments = reader.string(); + break; + case 6: + message.leading_detached_comments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo_Location { + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(Number(e)); + } + } + if ( + object.leading_comments !== undefined && + object.leading_comments !== null + ) { + message.leading_comments = String(object.leading_comments); + } else { + message.leading_comments = ""; + } + if ( + object.trailing_comments !== undefined && + object.trailing_comments !== null + ) { + message.trailing_comments = String(object.trailing_comments); + } else { + message.trailing_comments = ""; + } + if ( + object.leading_detached_comments !== undefined && + object.leading_detached_comments !== null + ) { + for (const e of object.leading_detached_comments) { + message.leading_detached_comments.push(String(e)); + } + } + return message; + }, + + toJSON(message: SourceCodeInfo_Location): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + if (message.span) { + obj.span = message.span.map((e) => e); + } else { + obj.span = []; + } + message.leading_comments !== undefined && + (obj.leading_comments = message.leading_comments); + message.trailing_comments !== undefined && + (obj.trailing_comments = message.trailing_comments); + if (message.leading_detached_comments) { + obj.leading_detached_comments = message.leading_detached_comments.map( + (e) => e + ); + } else { + obj.leading_detached_comments = []; + } + return obj; + }, + + fromPartial( + object: DeepPartial + ): SourceCodeInfo_Location { + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(e); + } + } + if ( + object.leading_comments !== undefined && + object.leading_comments !== null + ) { + message.leading_comments = object.leading_comments; + } else { + message.leading_comments = ""; + } + if ( + object.trailing_comments !== undefined && + object.trailing_comments !== null + ) { + message.trailing_comments = object.trailing_comments; + } else { + message.trailing_comments = ""; + } + if ( + object.leading_detached_comments !== undefined && + object.leading_detached_comments !== null + ) { + for (const e of object.leading_detached_comments) { + message.leading_detached_comments.push(e); + } + } + return message; + }, +}; + +const baseGeneratedCodeInfo: object = {}; + +export const GeneratedCodeInfo = { + encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode( + v!, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annotation.push( + GeneratedCodeInfo_Annotation.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: GeneratedCodeInfo): unknown { + const obj: any = {}; + if (message.annotation) { + obj.annotation = message.annotation.map((e) => + e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined + ); + } else { + obj.annotation = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); + } + } + return message; + }, +}; + +const baseGeneratedCodeInfo_Annotation: object = { + path: 0, + source_file: "", + begin: 0, + end: 0, +}; + +export const GeneratedCodeInfo_Annotation = { + encode( + message: GeneratedCodeInfo_Annotation, + writer: Writer = Writer.create() + ): Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + if (message.source_file !== "") { + writer.uint32(18).string(message.source_file); + } + if (message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== 0) { + writer.uint32(32).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): GeneratedCodeInfo_Annotation { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + message.source_file = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo_Annotation { + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.source_file !== undefined && object.source_file !== null) { + message.source_file = String(object.source_file); + } else { + message.source_file = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = Number(object.begin); + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: GeneratedCodeInfo_Annotation): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + message.source_file !== undefined && + (obj.source_file = message.source_file); + message.begin !== undefined && (obj.begin = message.begin); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): GeneratedCodeInfo_Annotation { + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.source_file !== undefined && object.source_file !== null) { + message.source_file = object.source_file; + } else { + message.source_file = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/package.json b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/package.json new file mode 100755 index 00000000..7a9bb5bc --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/package.json @@ -0,0 +1,18 @@ +{ + "name": "bze-cointrunk-js", + "version": "0.1.0", + "description": "Autogenerated vuex store for Cosmos module bze.cointrunk", + "author": "Starport Codegen ", + "homepage": "http://github.com/bze-alphateam/bze/x/cointrunk/types", + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "main": "index.js", + "publishConfig": { + "access": "public" + } +} \ No newline at end of file diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/vuex-root b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/vuex-root new file mode 100755 index 00000000..0fcc121a --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/vuex-root @@ -0,0 +1 @@ +THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 0a633940..36486b56 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,6 +232,21 @@ export default { }, + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgSubmitScavenge(value) + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + }else{ + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + } + } + }, async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -262,22 +277,20 @@ export default { } } }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) const msg = await txClient.msgSubmitScavenge(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result + return msg } catch (e) { if (e == MissingWalletError) { throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + } else{ + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, - async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) @@ -304,19 +317,6 @@ export default { } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) - } - } - }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 44bd4fda..27b7f752 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; const types = [ + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), }; }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/rest.ts index a004970f..955d29d8 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/rest.ts @@ -229,7 +229,7 @@ export class HttpClient { } /** - * @title cointrunk/genesis.proto + * @title cointrunk/accepted_domain.proto * @version version not set */ export class Api extends HttpClient { diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/accepted_domain.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/accepted_domain.ts new file mode 100644 index 00000000..c3ccefa6 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/accepted_domain.ts @@ -0,0 +1,92 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk"; + +export interface AcceptedDomain { + domain: string; + active: boolean; +} + +const baseAcceptedDomain: object = { domain: "", active: false }; + +export const AcceptedDomain = { + encode(message: AcceptedDomain, writer: Writer = Writer.create()): Writer { + if (message.domain !== "") { + writer.uint32(10).string(message.domain); + } + if (message.active === true) { + writer.uint32(16).bool(message.active); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): AcceptedDomain { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAcceptedDomain } as AcceptedDomain; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.domain = reader.string(); + break; + case 2: + message.active = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AcceptedDomain { + const message = { ...baseAcceptedDomain } as AcceptedDomain; + if (object.domain !== undefined && object.domain !== null) { + message.domain = String(object.domain); + } else { + message.domain = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = Boolean(object.active); + } else { + message.active = false; + } + return message; + }, + + toJSON(message: AcceptedDomain): unknown { + const obj: any = {}; + message.domain !== undefined && (obj.domain = message.domain); + message.active !== undefined && (obj.active = message.active); + return obj; + }, + + fromPartial(object: DeepPartial): AcceptedDomain { + const message = { ...baseAcceptedDomain } as AcceptedDomain; + if (object.domain !== undefined && object.domain !== null) { + message.domain = object.domain; + } else { + message.domain = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } else { + message.active = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/accepted_domain_proposal.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/accepted_domain_proposal.ts new file mode 100644 index 00000000..440d9905 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/accepted_domain_proposal.ts @@ -0,0 +1,139 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk"; + +export interface AcceptedDomainProposal { + title: string; + description: string; + domain: string; + active: boolean; +} + +const baseAcceptedDomainProposal: object = { + title: "", + description: "", + domain: "", + active: false, +}; + +export const AcceptedDomainProposal = { + encode( + message: AcceptedDomainProposal, + writer: Writer = Writer.create() + ): Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.domain !== "") { + writer.uint32(26).string(message.domain); + } + if (message.active === true) { + writer.uint32(32).bool(message.active); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): AcceptedDomainProposal { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAcceptedDomainProposal } as AcceptedDomainProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.domain = reader.string(); + break; + case 4: + message.active = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AcceptedDomainProposal { + const message = { ...baseAcceptedDomainProposal } as AcceptedDomainProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.domain !== undefined && object.domain !== null) { + message.domain = String(object.domain); + } else { + message.domain = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = Boolean(object.active); + } else { + message.active = false; + } + return message; + }, + + toJSON(message: AcceptedDomainProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.domain !== undefined && (obj.domain = message.domain); + message.active !== undefined && (obj.active = message.active); + return obj; + }, + + fromPartial( + object: DeepPartial + ): AcceptedDomainProposal { + const message = { ...baseAcceptedDomainProposal } as AcceptedDomainProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.domain !== undefined && object.domain !== null) { + message.domain = object.domain; + } else { + message.domain = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } else { + message.active = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/add_accepted_domain_proposal.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/add_accepted_domain_proposal.ts new file mode 100644 index 00000000..184539c7 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/add_accepted_domain_proposal.ts @@ -0,0 +1,148 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bzealphateam.bze.cointrunk"; + +export interface AddAcceptedDomainProposal { + title: string; + description: string; + domain: string; + active: boolean; +} + +const baseAddAcceptedDomainProposal: object = { + title: "", + description: "", + domain: "", + active: false, +}; + +export const AddAcceptedDomainProposal = { + encode( + message: AddAcceptedDomainProposal, + writer: Writer = Writer.create() + ): Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.domain !== "") { + writer.uint32(26).string(message.domain); + } + if (message.active === true) { + writer.uint32(32).bool(message.active); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): AddAcceptedDomainProposal { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAddAcceptedDomainProposal, + } as AddAcceptedDomainProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.domain = reader.string(); + break; + case 4: + message.active = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AddAcceptedDomainProposal { + const message = { + ...baseAddAcceptedDomainProposal, + } as AddAcceptedDomainProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.domain !== undefined && object.domain !== null) { + message.domain = String(object.domain); + } else { + message.domain = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = Boolean(object.active); + } else { + message.active = false; + } + return message; + }, + + toJSON(message: AddAcceptedDomainProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.domain !== undefined && (obj.domain = message.domain); + message.active !== undefined && (obj.active = message.active); + return obj; + }, + + fromPartial( + object: DeepPartial + ): AddAcceptedDomainProposal { + const message = { + ...baseAddAcceptedDomainProposal, + } as AddAcceptedDomainProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.domain !== undefined && object.domain !== null) { + message.domain = object.domain; + } else { + message.domain = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } else { + message.active = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/publisher.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/publisher.ts new file mode 100644 index 00000000..a332649d --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/publisher.ts @@ -0,0 +1,110 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk"; + +export interface Publisher { + name: string; + address: string; + active: boolean; +} + +const basePublisher: object = { name: "", address: "", active: false }; + +export const Publisher = { + encode(message: Publisher, writer: Writer = Writer.create()): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.active === true) { + writer.uint32(24).bool(message.active); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Publisher { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublisher } as Publisher; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.active = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Publisher { + const message = { ...basePublisher } as Publisher; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = Boolean(object.active); + } else { + message.active = false; + } + return message; + }, + + toJSON(message: Publisher): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.address !== undefined && (obj.address = message.address); + message.active !== undefined && (obj.active = message.active); + return obj; + }, + + fromPartial(object: DeepPartial): Publisher { + const message = { ...basePublisher } as Publisher; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } else { + message.active = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/publisher_proposal.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/publisher_proposal.ts new file mode 100644 index 00000000..f066ab1a --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.cointrunk/module/types/cointrunk/publisher_proposal.ts @@ -0,0 +1,153 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk"; + +export interface PublisherProposal { + title: string; + description: string; + name: string; + address: string; + active: boolean; +} + +const basePublisherProposal: object = { + title: "", + description: "", + name: "", + address: "", + active: false, +}; + +export const PublisherProposal = { + encode(message: PublisherProposal, writer: Writer = Writer.create()): Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.address !== "") { + writer.uint32(34).string(message.address); + } + if (message.active === true) { + writer.uint32(40).bool(message.active); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PublisherProposal { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublisherProposal } as PublisherProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.address = reader.string(); + break; + case 5: + message.active = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PublisherProposal { + const message = { ...basePublisherProposal } as PublisherProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = Boolean(object.active); + } else { + message.active = false; + } + return message; + }, + + toJSON(message: PublisherProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.name !== undefined && (obj.name = message.name); + message.address !== undefined && (obj.address = message.address); + message.active !== undefined && (obj.active = message.active); + return obj; + }, + + fromPartial(object: DeepPartial): PublisherProposal { + const message = { ...basePublisherProposal } as PublisherProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } else { + message.active = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/index.ts b/vue/src/store/generated/index.ts index 63274577..c4ddf6bd 100755 --- a/vue/src/store/generated/index.ts +++ b/vue/src/store/generated/index.ts @@ -1,5 +1,6 @@ // THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import BzeAlphateamBzeBzeCointrunk from './bze-alphateam/bze/bze.cointrunk' import BzeAlphateamBzeBzeScavenge from './bze-alphateam/bze/bze.scavenge' import BzeAlphateamBzeBzealphateamBzeCointrunk from './bze-alphateam/bze/bzealphateam.bze.cointrunk' import CosmosCosmosSdkCosmosAuthzV1Beta1 from './cosmos/cosmos-sdk/cosmos.authz.v1beta1' @@ -16,6 +17,7 @@ import CosmosIbcGoIbcApplicationsTransferV1 from './cosmos/ibc-go/ibc.applicatio export default { + BzeAlphateamBzeBzeCointrunk: load(BzeAlphateamBzeBzeCointrunk, 'bze.cointrunk'), BzeAlphateamBzeBzeScavenge: load(BzeAlphateamBzeBzeScavenge, 'bze.scavenge'), BzeAlphateamBzeBzealphateamBzeCointrunk: load(BzeAlphateamBzeBzealphateamBzeCointrunk, 'bzealphateam.bze.cointrunk'), CosmosCosmosSdkCosmosAuthzV1Beta1: load(CosmosCosmosSdkCosmosAuthzV1Beta1, 'cosmos.authz.v1beta1'), diff --git a/x/cointrunk/client/cli/query.go b/x/cointrunk/client/cli/query.go index b30735c8..4a45a47c 100644 --- a/x/cointrunk/client/cli/query.go +++ b/x/cointrunk/client/cli/query.go @@ -27,6 +27,5 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryParams()) // this line is used by starport scaffolding # 1 - return cmd + return cmd } - diff --git a/x/cointrunk/client/cli/query_params.go b/x/cointrunk/client/cli/query_params.go index c27b2c6a..e34266cb 100644 --- a/x/cointrunk/client/cli/query_params.go +++ b/x/cointrunk/client/cli/query_params.go @@ -3,10 +3,10 @@ package cli import ( "context" + "github.com/bze-alphateam/bze/x/cointrunk/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/bze-alphateam/bze/x/cointrunk/types" ) func CmdQueryParams() *cobra.Command { diff --git a/x/cointrunk/client/cli/tx.go b/x/cointrunk/client/cli/tx.go index 0f377623..2c84e346 100644 --- a/x/cointrunk/client/cli/tx.go +++ b/x/cointrunk/client/cli/tx.go @@ -2,6 +2,10 @@ package cli import ( "fmt" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + govcli "github.com/cosmos/cosmos-sdk/x/gov/client/cli" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "time" "github.com/spf13/cobra" @@ -16,6 +20,7 @@ var ( ) const ( + ActiveFlag = "active" flagPacketTimeoutTimestamp = "packet-timeout-timestamp" listSeparator = "," ) @@ -32,5 +37,133 @@ func GetTxCmd() *cobra.Command { // this line is used by starport scaffolding # 1 - return cmd + return cmd +} + +func NewCmdSubmitAcceptedDomainProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "accepted-domain [domain-name]", + Args: cobra.ExactArgs(1), + Short: "Submit an accepted domain proposal", + Long: "Submit an accepted domain proposal along with an initial deposit.\n" + + "Please specify the domain you want to add (ex: domain.com)\n", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + title, err := cmd.Flags().GetString(govcli.FlagTitle) + if err != nil { + return err + } + + description, err := cmd.Flags().GetString(govcli.FlagDescription) + if err != nil { + return err + } + + domain := args[0] + active, err := cmd.Flags().GetBool(ActiveFlag) + if err != nil { + return err + } + + content := types.NewAcceptedDomainProposal(title, description, domain, active) + + from := clientCtx.GetFromAddress() + + depositStr, err := cmd.Flags().GetString(govcli.FlagDeposit) + if err != nil { + return err + } + deposit, err := sdk.ParseCoinsNormalized(depositStr) + if err != nil { + return err + } + + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + if err = msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().String(govcli.FlagTitle, "", "title of proposal") + cmd.Flags().String(govcli.FlagDescription, "", "description of proposal") + cmd.Flags().String(govcli.FlagDeposit, "", "deposit of proposal") + cmd.Flags().Bool(ActiveFlag, true, "whether or not the proposed domain to be active") + + return cmd +} + +func NewCmdSubmitPublisherProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "publisher [name] [address]", + Args: cobra.ExactArgs(2), + Short: "Submit a publisher proposal", + Long: "Submit a publishers proposal along with an initial deposit.\n" + + "Please specify the public name of the publisher\n" + + "Please specify the address to become a publisher\n", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + title, err := cmd.Flags().GetString(govcli.FlagTitle) + if err != nil { + return err + } + + description, err := cmd.Flags().GetString(govcli.FlagDescription) + if err != nil { + return err + } + + name := args[0] + address := args[1] + active, err := cmd.Flags().GetBool(ActiveFlag) + if err != nil { + return err + } + + content := types.NewPublisherProposal(title, description, name, address, active) + + from := clientCtx.GetFromAddress() + + depositStr, err := cmd.Flags().GetString(govcli.FlagDeposit) + if err != nil { + return err + } + deposit, err := sdk.ParseCoinsNormalized(depositStr) + if err != nil { + return err + } + + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + if err = msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().String(govcli.FlagTitle, "", "title of proposal") + cmd.Flags().String(govcli.FlagDescription, "", "description of proposal") + cmd.Flags().String(govcli.FlagDeposit, "", "deposit of proposal") + cmd.Flags().Bool(ActiveFlag, true, "whether or not the proposed publisher to be active") + + return cmd } diff --git a/x/cointrunk/client/proposal_handler.go b/x/cointrunk/client/proposal_handler.go new file mode 100644 index 00000000..23a2c1f3 --- /dev/null +++ b/x/cointrunk/client/proposal_handler.go @@ -0,0 +1,22 @@ +package client + +import ( + "github.com/bze-alphateam/bze/x/cointrunk/client/cli" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/types/rest" + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" + govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest" + "net/http" +) + +var AcceptedDomainProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitAcceptedDomainProposal, emptyRestHandler) +var PublisherProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitPublisherProposal, emptyRestHandler) + +func emptyRestHandler(client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "unsupported-cointrunk", + Handler: func(w http.ResponseWriter, r *http.Request) { + rest.WriteErrorResponse(w, http.StatusBadRequest, "Legacy REST Routes are not supported for Cointrunk proposals") + }, + } +} diff --git a/x/cointrunk/handler.go b/x/cointrunk/handler.go index 4b845fcb..c81f7e3c 100644 --- a/x/cointrunk/handler.go +++ b/x/cointrunk/handler.go @@ -3,9 +3,9 @@ package cointrunk import ( "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/bze-alphateam/bze/x/cointrunk/keeper" "github.com/bze-alphateam/bze/x/cointrunk/types" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) diff --git a/x/cointrunk/keeper/cointrunk.go b/x/cointrunk/keeper/cointrunk.go new file mode 100644 index 00000000..87a22017 --- /dev/null +++ b/x/cointrunk/keeper/cointrunk.go @@ -0,0 +1,77 @@ +package keeper + +import ( + "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) GetPublisher(ctx sdk.Context, index string) (publisher types.Publisher, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PublisherKeyPrefix)) + record := store.Get(types.PublisherKey(index)) + if record == nil { + return publisher, false + } + + k.cdc.MustUnmarshal(record, &publisher) + + return publisher, true +} + +func (k Keeper) GetAllPublisher(ctx sdk.Context) (list []types.Publisher) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PublisherKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Publisher + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} + +func (k Keeper) SetPublisher(ctx sdk.Context, publisher types.Publisher) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PublisherKeyPrefix)) + val := k.cdc.MustMarshal(&publisher) + store.Set( + types.PublisherKey(publisher.Address), + val, + ) +} + +func (k Keeper) GetAcceptedDomain(ctx sdk.Context, index string) (acceptedDomain types.AcceptedDomain, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AcceptedDomainKeyPrefix)) + record := store.Get(types.AcceptedDomainKey(index)) + if record == nil { + return acceptedDomain, false + } + + k.cdc.MustUnmarshal(record, &acceptedDomain) + + return acceptedDomain, true +} + +func (k Keeper) GetAllAcceptedDomain(ctx sdk.Context) (list []types.AcceptedDomain) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AcceptedDomainKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.AcceptedDomain + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} + +func (k Keeper) SetAcceptedDomain(ctx sdk.Context, acceptedDomain types.AcceptedDomain) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AcceptedDomainKeyPrefix)) + record := k.cdc.MustMarshal(&acceptedDomain) + store.Set( + types.AcceptedDomainKey(acceptedDomain.Domain), + record, + ) +} diff --git a/x/cointrunk/keeper/grpc_query_params.go b/x/cointrunk/keeper/grpc_query_params.go index 7055c2fe..ffe29d7a 100644 --- a/x/cointrunk/keeper/grpc_query_params.go +++ b/x/cointrunk/keeper/grpc_query_params.go @@ -3,8 +3,8 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/bze-alphateam/bze/x/cointrunk/types" + sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/cointrunk/keeper/grpc_query_params_test.go b/x/cointrunk/keeper/grpc_query_params_test.go index b0bd5c82..23dcfa97 100644 --- a/x/cointrunk/keeper/grpc_query_params_test.go +++ b/x/cointrunk/keeper/grpc_query_params_test.go @@ -3,10 +3,10 @@ package keeper_test import ( "testing" + testkeeper "github.com/bze-alphateam/bze/testutil/keeper" + "github.com/bze-alphateam/bze/x/cointrunk/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - testkeeper "github.com/bze-alphateam/bze/testutil/keeper" - "github.com/bze-alphateam/bze/x/cointrunk/types" ) func TestParamsQuery(t *testing.T) { diff --git a/x/cointrunk/keeper/keeper.go b/x/cointrunk/keeper/keeper.go index 86708af9..9b9b44ae 100644 --- a/x/cointrunk/keeper/keeper.go +++ b/x/cointrunk/keeper/keeper.go @@ -5,33 +5,31 @@ import ( "github.com/tendermint/tendermint/libs/log" + "github.com/bze-alphateam/bze/x/cointrunk/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/bze-alphateam/bze/x/cointrunk/types" - ) type ( Keeper struct { - - cdc codec.BinaryCodec - storeKey sdk.StoreKey - memKey sdk.StoreKey - paramstore paramtypes.Subspace - - bankKeeper types.BankKeeper - govKeeper types.GovKeeper + cdc codec.BinaryCodec + storeKey sdk.StoreKey + memKey sdk.StoreKey + paramstore paramtypes.Subspace + + bankKeeper types.BankKeeper + govKeeper types.GovKeeper } ) func NewKeeper( - cdc codec.BinaryCodec, - storeKey, - memKey sdk.StoreKey, + cdc codec.BinaryCodec, + storeKey, + memKey sdk.StoreKey, ps paramtypes.Subspace, - - bankKeeper types.BankKeeper,govKeeper types.GovKeeper, + + bankKeeper types.BankKeeper, govKeeper types.GovKeeper, ) *Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -39,12 +37,12 @@ func NewKeeper( } return &Keeper{ - - cdc: cdc, - storeKey: storeKey, - memKey: memKey, - paramstore: ps, - bankKeeper: bankKeeper,govKeeper: govKeeper, + + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + paramstore: ps, + bankKeeper: bankKeeper, govKeeper: govKeeper, } } diff --git a/x/cointrunk/keeper/msg_server_test.go b/x/cointrunk/keeper/msg_server_test.go index d8e4f6f2..31a59796 100644 --- a/x/cointrunk/keeper/msg_server_test.go +++ b/x/cointrunk/keeper/msg_server_test.go @@ -4,10 +4,10 @@ import ( "context" "testing" + keepertest "github.com/bze-alphateam/bze/testutil/keeper" + "github.com/bze-alphateam/bze/x/cointrunk/keeper" + "github.com/bze-alphateam/bze/x/cointrunk/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/bze-alphateam/bze/x/cointrunk/types" - "github.com/bze-alphateam/bze/x/cointrunk/keeper" - keepertest "github.com/bze-alphateam/bze/testutil/keeper" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/cointrunk/keeper/params.go b/x/cointrunk/keeper/params.go index 91c4bd2b..f8e0411e 100644 --- a/x/cointrunk/keeper/params.go +++ b/x/cointrunk/keeper/params.go @@ -18,7 +18,6 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { k.paramstore.SetParamSet(ctx, ¶ms) } - // AnonArticleLimit returns the AnonArticleLimit param func (k Keeper) AnonArticleLimit(ctx sdk.Context) (res uint64) { k.paramstore.Get(ctx, types.KeyAnonArticleLimit, &res) diff --git a/x/cointrunk/keeper/params_test.go b/x/cointrunk/keeper/params_test.go index 4f5ea850..68f78c78 100644 --- a/x/cointrunk/keeper/params_test.go +++ b/x/cointrunk/keeper/params_test.go @@ -3,9 +3,9 @@ package keeper_test import ( "testing" - "github.com/stretchr/testify/require" testkeeper "github.com/bze-alphateam/bze/testutil/keeper" "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/stretchr/testify/require" ) func TestGetParams(t *testing.T) { diff --git a/x/cointrunk/module.go b/x/cointrunk/module.go index fa663ee6..f6afd898 100644 --- a/x/cointrunk/module.go +++ b/x/cointrunk/module.go @@ -3,7 +3,7 @@ package cointrunk import ( "encoding/json" "fmt" - // this line is used by starport scaffolding # 1 + // this line is used by starport scaffolding # 1 "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" @@ -11,21 +11,19 @@ import ( abci "github.com/tendermint/tendermint/abci/types" + "github.com/bze-alphateam/bze/x/cointrunk/client/cli" + "github.com/bze-alphateam/bze/x/cointrunk/keeper" + "github.com/bze-alphateam/bze/x/cointrunk/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" - "github.com/bze-alphateam/bze/x/cointrunk/keeper" - "github.com/bze-alphateam/bze/x/cointrunk/types" - "github.com/bze-alphateam/bze/x/cointrunk/client/cli" - ) var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - ) // ---------------------------------------------------------------------------- @@ -79,17 +77,17 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - // this line is used by starport scaffolding # 2 + // this line is used by starport scaffolding # 2 } // GetTxCmd returns the capability module's root tx command. func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() + return cli.GetTxCmd() } // GetQueryCmd returns the capability module's root query command. func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(types.StoreKey) + return cli.GetQueryCmd(types.StoreKey) } // ---------------------------------------------------------------------------- @@ -140,7 +138,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // RegisterInvariants registers the capability module's invariants. diff --git a/x/cointrunk/module_simulation.go b/x/cointrunk/module_simulation.go index e9e591aa..f47a8880 100644 --- a/x/cointrunk/module_simulation.go +++ b/x/cointrunk/module_simulation.go @@ -24,7 +24,7 @@ var ( ) const ( - // this line is used by starport scaffolding # simapp/module/const +// this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module @@ -34,7 +34,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { accs[i] = acc.Address.String() } cointrunkGenesis := types.GenesisState{ - Params: types.DefaultParams(), + Params: types.DefaultParams(), // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&cointrunkGenesis) diff --git a/x/cointrunk/proposal_handler.go b/x/cointrunk/proposal_handler.go new file mode 100644 index 00000000..6ef5ccbc --- /dev/null +++ b/x/cointrunk/proposal_handler.go @@ -0,0 +1,40 @@ +package cointrunk + +import ( + "github.com/bze-alphateam/bze/x/cointrunk/keeper" + "github.com/bze-alphateam/bze/x/cointrunk/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +func NewCointrunkProposalHandler(k keeper.Keeper) govtypes.Handler { + return func(ctx sdk.Context, content govtypes.Content) error { + switch c := content.(type) { + case *types.PublisherProposal: + return handlePublisherProposal(ctx, k, c) + case *types.AcceptedDomainProposal: + return handleAcceptedDomainProposal(ctx, k, c) + default: + return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized cointrunk proposal content type: %T", c) + } + } +} + +func handlePublisherProposal(ctx sdk.Context, k keeper.Keeper, proposal *types.PublisherProposal) error { + _ = sdk.MustAccAddressFromBech32(proposal.Address) + publisher, _ := k.GetPublisher(ctx, proposal.Address) + publisher.Name = proposal.Name + publisher.Active = proposal.Active + publisher.Address = proposal.Address + k.SetPublisher(ctx, publisher) + return nil +} + +func handleAcceptedDomainProposal(ctx sdk.Context, k keeper.Keeper, proposal *types.AcceptedDomainProposal) error { + acceptedDomain, _ := k.GetAcceptedDomain(ctx, proposal.Domain) + acceptedDomain.Domain = proposal.Domain + acceptedDomain.Active = proposal.Active + k.SetAcceptedDomain(ctx, acceptedDomain) + return nil +} diff --git a/x/cointrunk/types/accepted_domain.pb.go b/x/cointrunk/types/accepted_domain.pb.go new file mode 100644 index 00000000..ad8fb494 --- /dev/null +++ b/x/cointrunk/types/accepted_domain.pb.go @@ -0,0 +1,356 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cointrunk/accepted_domain.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/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 AcceptedDomain struct { + Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` + Active bool `protobuf:"varint,2,opt,name=active,proto3" json:"active,omitempty"` +} + +func (m *AcceptedDomain) Reset() { *m = AcceptedDomain{} } +func (m *AcceptedDomain) String() string { return proto.CompactTextString(m) } +func (*AcceptedDomain) ProtoMessage() {} +func (*AcceptedDomain) Descriptor() ([]byte, []int) { + return fileDescriptor_7857a0181b52415e, []int{0} +} +func (m *AcceptedDomain) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AcceptedDomain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AcceptedDomain.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 *AcceptedDomain) XXX_Merge(src proto.Message) { + xxx_messageInfo_AcceptedDomain.Merge(m, src) +} +func (m *AcceptedDomain) XXX_Size() int { + return m.Size() +} +func (m *AcceptedDomain) XXX_DiscardUnknown() { + xxx_messageInfo_AcceptedDomain.DiscardUnknown(m) +} + +var xxx_messageInfo_AcceptedDomain proto.InternalMessageInfo + +func (m *AcceptedDomain) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *AcceptedDomain) GetActive() bool { + if m != nil { + return m.Active + } + return false +} + +func init() { + proto.RegisterType((*AcceptedDomain)(nil), "bze.cointrunk.AcceptedDomain") +} + +func init() { proto.RegisterFile("cointrunk/accepted_domain.proto", fileDescriptor_7857a0181b52415e) } + +var fileDescriptor_7857a0181b52415e = []byte{ + // 176 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xce, 0xcf, 0xcc, + 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x4c, 0x4e, 0x4e, 0x2d, 0x28, 0x49, 0x4d, 0x89, 0x4f, + 0xc9, 0xcf, 0x4d, 0xcc, 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, + 0xd5, 0x83, 0x2b, 0x52, 0x72, 0xe0, 0xe2, 0x73, 0x84, 0xaa, 0x73, 0x01, 0x2b, 0x13, 0x12, 0xe3, + 0x62, 0x83, 0x68, 0x90, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0xf2, 0x40, 0xe2, 0x89, 0xc9, + 0x25, 0x99, 0x65, 0xa9, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x1c, 0x41, 0x50, 0x9e, 0x93, 0xc7, 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, 0xe9, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, + 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x27, 0x55, 0xa5, 0xea, 0x26, 0xe6, 0x14, 0x64, 0x24, 0x96, 0xa4, + 0x26, 0x82, 0x79, 0xfa, 0x15, 0xfa, 0x08, 0xa7, 0x96, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, + 0x5d, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xda, 0x95, 0x65, 0xbb, 0xc4, 0x00, 0x00, 0x00, +} + +func (m *AcceptedDomain) 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 *AcceptedDomain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AcceptedDomain) 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] = 0x10 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintAcceptedDomain(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintAcceptedDomain(dAtA []byte, offset int, v uint64) int { + offset -= sovAcceptedDomain(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AcceptedDomain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovAcceptedDomain(uint64(l)) + } + if m.Active { + n += 2 + } + return n +} + +func sovAcceptedDomain(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAcceptedDomain(x uint64) (n int) { + return sovAcceptedDomain(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AcceptedDomain) 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 ErrIntOverflowAcceptedDomain + } + 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: AcceptedDomain: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AcceptedDomain: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAcceptedDomain + } + 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 ErrInvalidLengthAcceptedDomain + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAcceptedDomain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowAcceptedDomain + } + 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 := skipAcceptedDomain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAcceptedDomain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAcceptedDomain(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, ErrIntOverflowAcceptedDomain + } + 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, ErrIntOverflowAcceptedDomain + } + 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, ErrIntOverflowAcceptedDomain + } + 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, ErrInvalidLengthAcceptedDomain + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAcceptedDomain + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAcceptedDomain + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAcceptedDomain = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAcceptedDomain = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAcceptedDomain = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/cointrunk/types/accepted_domain_proposal.pb.go b/x/cointrunk/types/accepted_domain_proposal.pb.go new file mode 100644 index 00000000..a1c7ded8 --- /dev/null +++ b/x/cointrunk/types/accepted_domain_proposal.pb.go @@ -0,0 +1,464 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cointrunk/accepted_domain_proposal.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/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 AcceptedDomainProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Domain string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain,omitempty"` + Active bool `protobuf:"varint,4,opt,name=active,proto3" json:"active,omitempty"` +} + +func (m *AcceptedDomainProposal) Reset() { *m = AcceptedDomainProposal{} } +func (m *AcceptedDomainProposal) String() string { return proto.CompactTextString(m) } +func (*AcceptedDomainProposal) ProtoMessage() {} +func (*AcceptedDomainProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_5b0b7ddc6f58933e, []int{0} +} +func (m *AcceptedDomainProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AcceptedDomainProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AcceptedDomainProposal.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 *AcceptedDomainProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_AcceptedDomainProposal.Merge(m, src) +} +func (m *AcceptedDomainProposal) XXX_Size() int { + return m.Size() +} +func (m *AcceptedDomainProposal) XXX_DiscardUnknown() { + xxx_messageInfo_AcceptedDomainProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_AcceptedDomainProposal proto.InternalMessageInfo + +func (m *AcceptedDomainProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *AcceptedDomainProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *AcceptedDomainProposal) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *AcceptedDomainProposal) GetActive() bool { + if m != nil { + return m.Active + } + return false +} + +func init() { + proto.RegisterType((*AcceptedDomainProposal)(nil), "bze.cointrunk.AcceptedDomainProposal") +} + +func init() { + proto.RegisterFile("cointrunk/accepted_domain_proposal.proto", fileDescriptor_5b0b7ddc6f58933e) +} + +var fileDescriptor_5b0b7ddc6f58933e = []byte{ + // 225 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x48, 0xce, 0xcf, 0xcc, + 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x4c, 0x4e, 0x4e, 0x2d, 0x28, 0x49, 0x4d, 0x89, 0x4f, + 0xc9, 0xcf, 0x4d, 0xcc, 0xcc, 0x8b, 0x2f, 0x28, 0xca, 0x2f, 0xc8, 0x2f, 0x4e, 0xcc, 0xd1, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0xab, 0x56, 0x6a, 0x60, 0xe4, + 0x12, 0x73, 0x84, 0xea, 0x70, 0x01, 0x6b, 0x08, 0x80, 0xaa, 0x17, 0x12, 0xe1, 0x62, 0x2d, 0xc9, + 0x2c, 0xc9, 0x49, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0x70, 0x84, 0x14, 0xb8, 0xb8, + 0x53, 0x52, 0x8b, 0x93, 0x8b, 0x32, 0x0b, 0x4a, 0x32, 0xf3, 0xf3, 0x24, 0x98, 0xc0, 0x72, 0xc8, + 0x42, 0x42, 0x62, 0x5c, 0x6c, 0x10, 0xab, 0x25, 0x98, 0xc1, 0x92, 0x50, 0x1e, 0x48, 0x3c, 0x31, + 0xb9, 0x24, 0xb3, 0x2c, 0x55, 0x82, 0x45, 0x81, 0x51, 0x83, 0x23, 0x08, 0xca, 0x73, 0xf2, 0x38, + 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, 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, + 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xa4, 0xaa, 0x54, 0xdd, 0xc4, 0x9c, 0x82, 0x8c, 0xc4, 0x92, + 0xd4, 0x44, 0x30, 0x4f, 0xbf, 0x42, 0x1f, 0xe1, 0xe9, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, + 0xb0, 0x17, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe7, 0x83, 0x5c, 0x70, 0x0e, 0x01, 0x00, + 0x00, +} + +func (m *AcceptedDomainProposal) 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 *AcceptedDomainProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AcceptedDomainProposal) 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] = 0x20 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintAcceptedDomainProposal(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintAcceptedDomainProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintAcceptedDomainProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintAcceptedDomainProposal(dAtA []byte, offset int, v uint64) int { + offset -= sovAcceptedDomainProposal(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AcceptedDomainProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovAcceptedDomainProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovAcceptedDomainProposal(uint64(l)) + } + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovAcceptedDomainProposal(uint64(l)) + } + if m.Active { + n += 2 + } + return n +} + +func sovAcceptedDomainProposal(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAcceptedDomainProposal(x uint64) (n int) { + return sovAcceptedDomainProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AcceptedDomainProposal) 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 ErrIntOverflowAcceptedDomainProposal + } + 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: AcceptedDomainProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AcceptedDomainProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAcceptedDomainProposal + } + 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 ErrInvalidLengthAcceptedDomainProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAcceptedDomainProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAcceptedDomainProposal + } + 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 ErrInvalidLengthAcceptedDomainProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAcceptedDomainProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAcceptedDomainProposal + } + 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 ErrInvalidLengthAcceptedDomainProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAcceptedDomainProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowAcceptedDomainProposal + } + 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 := skipAcceptedDomainProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAcceptedDomainProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAcceptedDomainProposal(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, ErrIntOverflowAcceptedDomainProposal + } + 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, ErrIntOverflowAcceptedDomainProposal + } + 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, ErrIntOverflowAcceptedDomainProposal + } + 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, ErrInvalidLengthAcceptedDomainProposal + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAcceptedDomainProposal + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAcceptedDomainProposal + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAcceptedDomainProposal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAcceptedDomainProposal = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAcceptedDomainProposal = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/cointrunk/types/codec.go b/x/cointrunk/types/codec.go index fb6871d2..ef008212 100644 --- a/x/cointrunk/types/codec.go +++ b/x/cointrunk/types/codec.go @@ -2,22 +2,30 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + // this line is used by starport scaffolding # 1 "github.com/cosmos/cosmos-sdk/types/msgservice" ) func RegisterCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&AcceptedDomainProposal{}, "cointrunk/AcceptedDomainProposal", nil) + cdc.RegisterConcrete(&PublisherProposal{}, "cointrunk/PublisherProposal", nil) // this line is used by starport scaffolding # 2 -} +} func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { // this line is used by starport scaffolding # 3 - + registry.RegisterImplementations( + (*govtypes.Content)(nil), + &AcceptedDomainProposal{}, + &PublisherProposal{}, + ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } var ( - Amino = codec.NewLegacyAmino() + Amino = codec.NewLegacyAmino() ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) ) diff --git a/x/cointrunk/types/errors.go b/x/cointrunk/types/errors.go index a9751d63..3402583e 100644 --- a/x/cointrunk/types/errors.go +++ b/x/cointrunk/types/errors.go @@ -8,6 +8,5 @@ import ( // x/cointrunk module sentinel errors var ( - ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") - + ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 5, "invalid proposal content") ) diff --git a/x/cointrunk/types/expected_keepers.go b/x/cointrunk/types/expected_keepers.go index a7fc23b7..5d230317 100644 --- a/x/cointrunk/types/expected_keepers.go +++ b/x/cointrunk/types/expected_keepers.go @@ -5,16 +5,10 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/types" ) - - - - type GovKeeper interface { // Methods imported from gov should be defined here } - - // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI @@ -25,4 +19,4 @@ type AccountKeeper interface { type BankKeeper interface { SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins // Methods imported from bank should be defined here -} \ No newline at end of file +} diff --git a/x/cointrunk/types/genesis.go b/x/cointrunk/types/genesis.go index aa82115f..56921182 100644 --- a/x/cointrunk/types/genesis.go +++ b/x/cointrunk/types/genesis.go @@ -1,24 +1,20 @@ package types -import ( -// this line is used by starport scaffolding # genesis/types/import -) - // DefaultIndex is the default capability global index const DefaultIndex uint64 = 1 // DefaultGenesis returns the default Capability genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - // this line is used by starport scaffolding # genesis/types/default - Params: DefaultParams(), + // 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 + // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() } diff --git a/x/cointrunk/types/genesis.pb.go b/x/cointrunk/types/genesis.pb.go index 8ac5b31b..56386aaf 100644 --- a/x/cointrunk/types/genesis.pb.go +++ b/x/cointrunk/types/genesis.pb.go @@ -69,26 +69,26 @@ func (m *GenesisState) GetParams() Params { } func init() { - proto.RegisterType((*GenesisState)(nil), "bzealphateam.bze.cointrunk.GenesisState") + proto.RegisterType((*GenesisState)(nil), "bze.cointrunk.GenesisState") } func init() { proto.RegisterFile("cointrunk/genesis.proto", fileDescriptor_20104b77ac07c6a4) } var fileDescriptor_20104b77ac07c6a4 = []byte{ - // 201 bytes of a gzipped FileDescriptorProto + // 193 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xce, 0xcf, 0xcc, 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x4a, 0xaa, 0x4a, 0x4d, 0xcc, 0x29, 0xc8, 0x48, 0x2c, 0x49, 0x4d, - 0xcc, 0xd5, 0x4b, 0xaa, 0x4a, 0xd5, 0x83, 0xab, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, - 0xd3, 0x07, 0xb1, 0x20, 0x3a, 0xa4, 0xc4, 0x10, 0x46, 0x15, 0x24, 0x16, 0x25, 0xe6, 0x42, 0x4d, - 0x52, 0x0a, 0xe0, 0xe2, 0x71, 0x87, 0x18, 0x1d, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0xe4, 0xc0, 0xc5, - 0x06, 0x91, 0x97, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x52, 0xd2, 0xc3, 0x6d, 0x95, 0x5e, 0x00, - 0x58, 0xa5, 0x13, 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, 0x50, 0x7d, 0x4e, 0x1e, 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, 0xa5, 0x97, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, - 0x9c, 0x9f, 0xab, 0x9f, 0x54, 0x95, 0xaa, 0x0b, 0x37, 0x16, 0xc4, 0xd3, 0xaf, 0xd0, 0x47, 0x38, - 0xb1, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x44, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xe7, 0x36, 0x2f, 0x70, 0x07, 0x01, 0x00, 0x00, + 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x4b, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, + 0xe7, 0x83, 0x65, 0xf4, 0x41, 0x2c, 0x88, 0x22, 0x29, 0x31, 0x84, 0xee, 0x82, 0xc4, 0xa2, 0xc4, + 0x5c, 0xa8, 0x66, 0x25, 0x67, 0x2e, 0x1e, 0x77, 0x88, 0x69, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x42, + 0xc6, 0x5c, 0x6c, 0x10, 0x79, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x51, 0x3d, 0x14, 0xd3, + 0xf5, 0x02, 0xc0, 0x92, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0x95, 0x3a, 0x79, 0x9c, + 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, 0x5e, 0x7a, 0x66, 0x49, 0x46, 0x69, + 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x52, 0x55, 0xaa, 0x6e, 0x62, 0x4e, 0x41, 0x46, 0x62, 0x49, + 0x6a, 0x22, 0x98, 0xa7, 0x5f, 0xa1, 0x8f, 0x70, 0x55, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, + 0xd8, 0x55, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x89, 0xab, 0x2d, 0xed, 0x00, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/cointrunk/types/genesis_test.go b/x/cointrunk/types/genesis_test.go index 39b876da..ad251ad5 100644 --- a/x/cointrunk/types/genesis_test.go +++ b/x/cointrunk/types/genesis_test.go @@ -3,38 +3,38 @@ package types_test import ( "testing" - "github.com/stretchr/testify/require" "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/stretchr/testify/require" ) func TestGenesisState_Validate(t *testing.T) { - for _, tc := range []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 - } { - t.Run(tc.desc, func(t *testing.T) { - err := tc.genState.Validate() - if tc.valid { - require.NoError(t, err) - } else { - require.Error(t, err) - } - }) - } -} \ No newline at end of file + for _, tc := range []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 + } { + 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/cointrunk/types/gov.go b/x/cointrunk/types/gov.go new file mode 100644 index 00000000..56660226 --- /dev/null +++ b/x/cointrunk/types/gov.go @@ -0,0 +1,81 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "regexp" +) + +const ( + ProposalTypeAcceptedDomain = "AcceptedDomainProposal" + ProposalTypePublisher = "PublisherProposal" +) + +func init() { + govtypes.RegisterProposalType(ProposalTypeAcceptedDomain) + govtypes.RegisterProposalTypeCodec(&AcceptedDomainProposal{}, "cointrunk/AcceptedDomainProposal") + govtypes.RegisterProposalType(ProposalTypePublisher) + govtypes.RegisterProposalTypeCodec(&PublisherProposal{}, "cointrunk/PublisherProposal") +} + +var ( + _ govtypes.Content = &AcceptedDomainProposal{} + _ govtypes.Content = &PublisherProposal{} +) + +func NewAcceptedDomainProposal(title, description, domain string, active bool) govtypes.Content { + return &AcceptedDomainProposal{ + Title: title, + Description: description, + Domain: domain, + Active: active, + } +} + +func (m *AcceptedDomainProposal) ProposalRoute() string { return RouterKey } + +func (m *AcceptedDomainProposal) ProposalType() string { return ProposalTypeAcceptedDomain } + +func (m *AcceptedDomainProposal) ValidateBasic() error { + err := govtypes.ValidateAbstract(m) + if err != nil { + return err + } + RegExp := regexp.MustCompile(`^(([a-zA-Z]{1})|([a-zA-Z]{1}[a-zA-Z]{1})|([a-zA-Z]{1}[0-9]{1})|([0-9]{1}[a-zA-Z]{1})|([a-zA-Z0-9][a-zA-Z0-9-_]{1,61}[a-zA-Z0-9]))\.([a-zA-Z]{2,6}|[a-zA-Z0-9-]{2,30}\.[a-zA-Z + ]{2,3})$`) + + isValidDomain := RegExp.MatchString(m.Domain) + if !isValidDomain { + return sdkerrors.Wrapf(ErrInvalidProposalContent, "proposal domain is invalid") + } + + return nil +} + +func NewPublisherProposal(title, description, name, address string, active bool) govtypes.Content { + return &PublisherProposal{ + Title: title, + Description: description, + Name: name, + Address: address, + Active: active, + } +} + +func (m *PublisherProposal) ProposalRoute() string { return RouterKey } + +func (m *PublisherProposal) ProposalType() string { return ProposalTypePublisher } + +func (m *PublisherProposal) ValidateBasic() error { + err := govtypes.ValidateAbstract(m) + if err != nil { + return err + } + _, err = sdk.AccAddressFromBech32(m.Address) + if err != nil { + return sdkerrors.Wrapf(ErrInvalidProposalContent, "proposal publisher address is invalid") + } + + return nil +} diff --git a/x/cointrunk/types/key_accepted_domain.go b/x/cointrunk/types/key_accepted_domain.go new file mode 100644 index 00000000..9a376f46 --- /dev/null +++ b/x/cointrunk/types/key_accepted_domain.go @@ -0,0 +1,23 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // AcceptedDomainKeyPrefix is the prefix to retrieve all AcceptedDomain + AcceptedDomainKeyPrefix = "AcceptedDomain/value/" +) + +// AcceptedDomainKey returns the store key to retrieve an AcceptedDomain from the index fields +func AcceptedDomainKey( + index string, +) []byte { + var key []byte + + indexBytes := []byte(index) + key = append(key, indexBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/cointrunk/types/key_publisher.go b/x/cointrunk/types/key_publisher.go new file mode 100644 index 00000000..a83f8966 --- /dev/null +++ b/x/cointrunk/types/key_publisher.go @@ -0,0 +1,23 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // PublisherKeyPrefix is the prefix to retrieve all Publisher + PublisherKeyPrefix = "Publisher/value/" +) + +// PublisherKey returns the store key to retrieve a Publisher from the index fields +func PublisherKey( + index string, +) []byte { + var key []byte + + indexBytes := []byte(index) + key = append(key, indexBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/cointrunk/types/keys.go b/x/cointrunk/types/keys.go index df8b7baa..2c0f2f74 100644 --- a/x/cointrunk/types/keys.go +++ b/x/cointrunk/types/keys.go @@ -10,17 +10,13 @@ const ( // RouterKey is the message route for slashing RouterKey = ModuleName - // QuerierRoute defines the module's query routing key - QuerierRoute = ModuleName + // QuerierRoute defines the module's query routing key + QuerierRoute = ModuleName // MemStoreKey defines the in-memory store key MemStoreKey = "mem_cointrunk" - - ) - - func KeyPrefix(p string) []byte { - return []byte(p) + return []byte(p) } diff --git a/x/cointrunk/types/params.pb.go b/x/cointrunk/types/params.pb.go index 873f6369..f211fe5e 100644 --- a/x/cointrunk/types/params.pb.go +++ b/x/cointrunk/types/params.pb.go @@ -76,29 +76,28 @@ func (m *Params) GetAnonArticleCost() string { } func init() { - proto.RegisterType((*Params)(nil), "bzealphateam.bze.cointrunk.Params") + proto.RegisterType((*Params)(nil), "bze.cointrunk.Params") } func init() { proto.RegisterFile("cointrunk/params.proto", fileDescriptor_f29b1ecdb66bf452) } var fileDescriptor_f29b1ecdb66bf452 = []byte{ - // 246 bytes of a gzipped FileDescriptorProto + // 238 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4b, 0xce, 0xcf, 0xcc, 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, - 0x2f, 0xc9, 0x17, 0x92, 0x4a, 0xaa, 0x4a, 0x4d, 0xcc, 0x29, 0xc8, 0x48, 0x2c, 0x49, 0x4d, 0xcc, - 0xd5, 0x4b, 0xaa, 0x4a, 0xd5, 0x83, 0x2b, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, 0xd3, - 0x07, 0xb1, 0x20, 0x3a, 0x94, 0x16, 0x32, 0x72, 0xb1, 0x05, 0x80, 0x8d, 0x10, 0xf2, 0xe4, 0x12, - 0x48, 0xcc, 0xcb, 0xcf, 0x73, 0x2c, 0x2a, 0xc9, 0x4c, 0xce, 0x49, 0xf5, 0xc9, 0xcc, 0xcd, 0x2c, - 0x91, 0x60, 0x54, 0x60, 0xd4, 0x60, 0x71, 0x92, 0xfd, 0x74, 0x4f, 0x5e, 0xb2, 0x32, 0x31, 0x37, - 0xc7, 0x4a, 0x09, 0xa4, 0x22, 0x3e, 0x11, 0xa2, 0x24, 0x3e, 0x07, 0xa4, 0x46, 0x29, 0x08, 0x43, - 0x9b, 0x90, 0x1b, 0x17, 0x3f, 0x92, 0x98, 0x73, 0x7e, 0x71, 0x89, 0x04, 0x93, 0x02, 0xa3, 0x06, - 0xa7, 0x93, 0xcc, 0xa7, 0x7b, 0xf2, 0x12, 0x58, 0x4c, 0x4a, 0xce, 0x2f, 0x2e, 0x51, 0x0a, 0x42, - 0xd7, 0x64, 0xc5, 0x32, 0x63, 0x81, 0x3c, 0x83, 0x93, 0xc7, 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, 0xe9, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, - 0x27, 0x55, 0xa5, 0xea, 0xc2, 0xfd, 0x0e, 0xe2, 0xe9, 0x57, 0xe8, 0x23, 0x82, 0xa9, 0xa4, 0xb2, - 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x69, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x67, 0xaf, - 0xa6, 0x70, 0x40, 0x01, 0x00, 0x00, + 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0xcb, 0x49, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, + 0x83, 0x65, 0xf4, 0x41, 0x2c, 0x88, 0x22, 0xa5, 0x85, 0x8c, 0x5c, 0x6c, 0x01, 0x60, 0x5d, 0x42, + 0x9e, 0x5c, 0x02, 0x89, 0x79, 0xf9, 0x79, 0x8e, 0x45, 0x25, 0x99, 0xc9, 0x39, 0xa9, 0x3e, 0x99, + 0xb9, 0x99, 0x25, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x2c, 0x4e, 0xb2, 0x9f, 0xee, 0xc9, 0x4b, 0x56, + 0x26, 0xe6, 0xe6, 0x58, 0x29, 0x81, 0x54, 0xc4, 0x27, 0x42, 0x94, 0xc4, 0xe7, 0x80, 0xd4, 0x28, + 0x05, 0x61, 0x68, 0x13, 0x72, 0xe3, 0xe2, 0x47, 0x12, 0x73, 0xce, 0x2f, 0x2e, 0x91, 0x60, 0x52, + 0x60, 0xd4, 0xe0, 0x74, 0x92, 0xf9, 0x74, 0x4f, 0x5e, 0x02, 0x8b, 0x49, 0xc9, 0xf9, 0xc5, 0x25, + 0x4a, 0x41, 0xe8, 0x9a, 0xac, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0xf2, 0x38, 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, 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, + 0xfc, 0x5c, 0xfd, 0xa4, 0xaa, 0x54, 0xdd, 0xc4, 0x9c, 0x82, 0x8c, 0xc4, 0x92, 0xd4, 0x44, 0x30, + 0x4f, 0xbf, 0x42, 0x1f, 0x11, 0x32, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x4f, 0x1b, + 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x25, 0x0c, 0x6d, 0x6e, 0x33, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/cointrunk/types/publisher.pb.go b/x/cointrunk/types/publisher.pb.go new file mode 100644 index 00000000..a4de6be1 --- /dev/null +++ b/x/cointrunk/types/publisher.pb.go @@ -0,0 +1,408 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cointrunk/publisher.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/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 Publisher struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + Active bool `protobuf:"varint,3,opt,name=active,proto3" json:"active,omitempty"` +} + +func (m *Publisher) Reset() { *m = Publisher{} } +func (m *Publisher) String() string { return proto.CompactTextString(m) } +func (*Publisher) ProtoMessage() {} +func (*Publisher) Descriptor() ([]byte, []int) { + return fileDescriptor_13a2ab3c46c6721e, []int{0} +} +func (m *Publisher) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Publisher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Publisher.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 *Publisher) XXX_Merge(src proto.Message) { + xxx_messageInfo_Publisher.Merge(m, src) +} +func (m *Publisher) XXX_Size() int { + return m.Size() +} +func (m *Publisher) XXX_DiscardUnknown() { + xxx_messageInfo_Publisher.DiscardUnknown(m) +} + +var xxx_messageInfo_Publisher proto.InternalMessageInfo + +func (m *Publisher) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Publisher) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Publisher) GetActive() bool { + if m != nil { + return m.Active + } + return false +} + +func init() { + proto.RegisterType((*Publisher)(nil), "bze.cointrunk.Publisher") +} + +func init() { proto.RegisterFile("cointrunk/publisher.proto", fileDescriptor_13a2ab3c46c6721e) } + +var fileDescriptor_13a2ab3c46c6721e = []byte{ + // 188 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xce, 0xcf, 0xcc, + 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x2f, 0x28, 0x4d, 0xca, 0xc9, 0x2c, 0xce, 0x48, 0x2d, 0xd2, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x4b, 0x2b, 0x05, 0x72, + 0x71, 0x06, 0xc0, 0x54, 0x08, 0x09, 0x71, 0xb1, 0xe4, 0x25, 0xe6, 0xa6, 0x4a, 0x30, 0x2a, 0x30, + 0x6a, 0x70, 0x06, 0x81, 0xd9, 0x42, 0x12, 0x5c, 0xec, 0x89, 0x29, 0x29, 0x45, 0xa9, 0xc5, 0xc5, + 0x12, 0x4c, 0x60, 0x61, 0x18, 0x57, 0x48, 0x8c, 0x8b, 0x2d, 0x31, 0xb9, 0x24, 0xb3, 0x2c, 0x55, + 0x82, 0x59, 0x81, 0x51, 0x83, 0x23, 0x08, 0xca, 0x73, 0xf2, 0x38, 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, 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, + 0xfd, 0xa4, 0xaa, 0x54, 0xdd, 0xc4, 0x9c, 0x82, 0x8c, 0xc4, 0x92, 0xd4, 0x44, 0x30, 0x4f, 0xbf, + 0x42, 0x1f, 0xe1, 0xea, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x93, 0x8d, 0x01, 0x01, + 0x00, 0x00, 0xff, 0xff, 0xc4, 0x47, 0xc8, 0x62, 0xcf, 0x00, 0x00, 0x00, +} + +func (m *Publisher) 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 *Publisher) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Publisher) 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] = 0x18 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintPublisher(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintPublisher(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintPublisher(dAtA []byte, offset int, v uint64) int { + offset -= sovPublisher(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Publisher) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovPublisher(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovPublisher(uint64(l)) + } + if m.Active { + n += 2 + } + return n +} + +func sovPublisher(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPublisher(x uint64) (n int) { + return sovPublisher(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Publisher) 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 ErrIntOverflowPublisher + } + 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: Publisher: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Publisher: 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 ErrIntOverflowPublisher + } + 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 ErrInvalidLengthPublisher + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPublisher + } + 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 Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPublisher + } + 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 ErrInvalidLengthPublisher + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPublisher + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowPublisher + } + 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 := skipPublisher(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPublisher + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPublisher(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, ErrIntOverflowPublisher + } + 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, ErrIntOverflowPublisher + } + 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, ErrIntOverflowPublisher + } + 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, ErrInvalidLengthPublisher + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPublisher + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPublisher + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPublisher = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPublisher = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPublisher = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/cointrunk/types/publisher_proposal.pb.go b/x/cointrunk/types/publisher_proposal.pb.go new file mode 100644 index 00000000..9a381de3 --- /dev/null +++ b/x/cointrunk/types/publisher_proposal.pb.go @@ -0,0 +1,515 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cointrunk/publisher_proposal.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/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 PublisherProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` + Active bool `protobuf:"varint,5,opt,name=active,proto3" json:"active,omitempty"` +} + +func (m *PublisherProposal) Reset() { *m = PublisherProposal{} } +func (m *PublisherProposal) String() string { return proto.CompactTextString(m) } +func (*PublisherProposal) ProtoMessage() {} +func (*PublisherProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_3acb71719072ee70, []int{0} +} +func (m *PublisherProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PublisherProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PublisherProposal.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 *PublisherProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_PublisherProposal.Merge(m, src) +} +func (m *PublisherProposal) XXX_Size() int { + return m.Size() +} +func (m *PublisherProposal) XXX_DiscardUnknown() { + xxx_messageInfo_PublisherProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_PublisherProposal proto.InternalMessageInfo + +func (m *PublisherProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *PublisherProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *PublisherProposal) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PublisherProposal) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *PublisherProposal) GetActive() bool { + if m != nil { + return m.Active + } + return false +} + +func init() { + proto.RegisterType((*PublisherProposal)(nil), "bze.cointrunk.PublisherProposal") +} + +func init() { + proto.RegisterFile("cointrunk/publisher_proposal.proto", fileDescriptor_3acb71719072ee70) +} + +var fileDescriptor_3acb71719072ee70 = []byte{ + // 233 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x8f, 0x31, 0x4e, 0xc3, 0x30, + 0x18, 0x85, 0x63, 0x68, 0x0b, 0x18, 0x31, 0x60, 0x21, 0xe4, 0xc9, 0x8a, 0x3a, 0x75, 0x21, 0x1e, + 0xb8, 0x01, 0x13, 0x63, 0xd5, 0x91, 0x05, 0xd9, 0xce, 0x2f, 0x62, 0xe1, 0xda, 0x96, 0xfd, 0x07, + 0x41, 0x4f, 0x01, 0xb7, 0x62, 0xec, 0xc8, 0x88, 0x92, 0x8b, 0x20, 0x99, 0x16, 0xba, 0xbd, 0xef, + 0xbd, 0x6f, 0x79, 0x74, 0x6e, 0x82, 0xf5, 0x98, 0x7a, 0xff, 0x2c, 0x63, 0xaf, 0x9d, 0xcd, 0x1d, + 0xa4, 0xc7, 0x98, 0x42, 0x0c, 0x59, 0xb9, 0x26, 0xa6, 0x80, 0x81, 0x5d, 0xe8, 0x0d, 0x34, 0x7f, + 0xde, 0xfc, 0x83, 0xd0, 0xcb, 0xe5, 0xde, 0x5d, 0xee, 0x54, 0x76, 0x45, 0xa7, 0x68, 0xd1, 0x01, + 0x27, 0x35, 0x59, 0x9c, 0xad, 0x7e, 0x81, 0xd5, 0xf4, 0xbc, 0x85, 0x6c, 0x92, 0x8d, 0x68, 0x83, + 0xe7, 0x47, 0x65, 0x3b, 0xac, 0x18, 0xa3, 0x13, 0xaf, 0xd6, 0xc0, 0x8f, 0xcb, 0x54, 0x32, 0xe3, + 0xf4, 0x44, 0xb5, 0x6d, 0x82, 0x9c, 0xf9, 0xa4, 0xd4, 0x7b, 0x64, 0xd7, 0x74, 0xa6, 0x0c, 0xda, + 0x17, 0xe0, 0xd3, 0x9a, 0x2c, 0x4e, 0x57, 0x3b, 0xba, 0xbb, 0xff, 0x1c, 0x04, 0xd9, 0x0e, 0x82, + 0x7c, 0x0f, 0x82, 0xbc, 0x8f, 0xa2, 0xda, 0x8e, 0xa2, 0xfa, 0x1a, 0x45, 0xf5, 0xd0, 0x3c, 0x59, + 0xec, 0x7a, 0xdd, 0x98, 0xb0, 0x96, 0x7a, 0x03, 0x37, 0xca, 0xc5, 0x4e, 0x21, 0xa8, 0x42, 0xf2, + 0x55, 0xfe, 0xff, 0xc7, 0xb7, 0x08, 0x59, 0xcf, 0xca, 0xe7, 0xdb, 0x9f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x77, 0x79, 0x0e, 0xad, 0x19, 0x01, 0x00, 0x00, +} + +func (m *PublisherProposal) 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 *PublisherProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PublisherProposal) 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 len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintPublisherProposal(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x22 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintPublisherProposal(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintPublisherProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintPublisherProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintPublisherProposal(dAtA []byte, offset int, v uint64) int { + offset -= sovPublisherProposal(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PublisherProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovPublisherProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovPublisherProposal(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovPublisherProposal(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovPublisherProposal(uint64(l)) + } + if m.Active { + n += 2 + } + return n +} + +func sovPublisherProposal(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPublisherProposal(x uint64) (n int) { + return sovPublisherProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PublisherProposal) 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 ErrIntOverflowPublisherProposal + } + 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: PublisherProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PublisherProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPublisherProposal + } + 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 ErrInvalidLengthPublisherProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPublisherProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPublisherProposal + } + 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 ErrInvalidLengthPublisherProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPublisherProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowPublisherProposal + } + 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 ErrInvalidLengthPublisherProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPublisherProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPublisherProposal + } + 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 ErrInvalidLengthPublisherProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPublisherProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 ErrIntOverflowPublisherProposal + } + 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 := skipPublisherProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPublisherProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPublisherProposal(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, ErrIntOverflowPublisherProposal + } + 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, ErrIntOverflowPublisherProposal + } + 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, ErrIntOverflowPublisherProposal + } + 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, ErrInvalidLengthPublisherProposal + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPublisherProposal + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPublisherProposal + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPublisherProposal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPublisherProposal = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPublisherProposal = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/cointrunk/types/query.pb.go b/x/cointrunk/types/query.pb.go index 00cf48b6..79e5958b 100644 --- a/x/cointrunk/types/query.pb.go +++ b/x/cointrunk/types/query.pb.go @@ -114,34 +114,33 @@ func (m *QueryParamsResponse) GetParams() Params { } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "bzealphateam.bze.cointrunk.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "bzealphateam.bze.cointrunk.QueryParamsResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "bze.cointrunk.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "bze.cointrunk.QueryParamsResponse") } func init() { proto.RegisterFile("cointrunk/query.proto", fileDescriptor_12b6eb50b0e9fa00) } var fileDescriptor_12b6eb50b0e9fa00 = []byte{ - // 308 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xb1, 0x4a, 0x03, 0x31, - 0x18, 0xc7, 0x2f, 0xa2, 0x1d, 0xe2, 0x16, 0xab, 0xc8, 0x21, 0x51, 0x0e, 0x07, 0x29, 0x98, 0xd0, - 0xfa, 0x02, 0xd2, 0xc9, 0x51, 0xbb, 0x08, 0x6e, 0x49, 0x09, 0xe9, 0x61, 0x9b, 0x2f, 0xbd, 0xe4, - 0xc4, 0x76, 0xf4, 0x09, 0x04, 0x71, 0xf6, 0x75, 0x3a, 0x16, 0x5c, 0x9c, 0x44, 0x5a, 0x1f, 0x44, - 0x9a, 0x1c, 0xda, 0x2a, 0x8a, 0xdb, 0xdd, 0x97, 0xdf, 0xef, 0x9f, 0x7f, 0x3e, 0xbc, 0xdd, 0x85, - 0xdc, 0xf8, 0xa2, 0x34, 0xd7, 0x7c, 0x58, 0xaa, 0x62, 0xc4, 0x6c, 0x01, 0x1e, 0x48, 0x2a, 0xc7, - 0x4a, 0xf4, 0x6d, 0x4f, 0x78, 0x25, 0x06, 0x4c, 0x8e, 0x15, 0xfb, 0xe4, 0xd2, 0xba, 0x06, 0x0d, - 0x01, 0xe3, 0x8b, 0xaf, 0x68, 0xa4, 0x7b, 0x1a, 0x40, 0xf7, 0x15, 0x17, 0x36, 0xe7, 0xc2, 0x18, - 0xf0, 0xc2, 0xe7, 0x60, 0x5c, 0x75, 0xda, 0xe8, 0x82, 0x1b, 0x80, 0xe3, 0x52, 0x38, 0x15, 0x2f, - 0xe2, 0x37, 0x4d, 0xa9, 0xbc, 0x68, 0x72, 0x2b, 0x74, 0x6e, 0x02, 0x5c, 0xb1, 0x3b, 0x5f, 0x95, - 0xac, 0x28, 0xc4, 0xa0, 0xca, 0xc8, 0xea, 0x98, 0x5c, 0x2c, 0xcc, 0xf3, 0x30, 0xec, 0xa8, 0x61, - 0xa9, 0x9c, 0xcf, 0x2e, 0xf1, 0xd6, 0xca, 0xd4, 0x59, 0x30, 0x4e, 0x91, 0x53, 0x5c, 0x8b, 0xf2, - 0x2e, 0x3a, 0x40, 0x47, 0x9b, 0xad, 0x8c, 0xfd, 0xfe, 0x22, 0x16, 0xdd, 0xf6, 0xfa, 0xe4, 0x75, - 0x3f, 0xe9, 0x54, 0x5e, 0xeb, 0x09, 0xe1, 0x8d, 0x90, 0x4c, 0x1e, 0x11, 0xae, 0x45, 0x84, 0xb0, - 0xbf, 0x62, 0x7e, 0xb6, 0x4b, 0xf9, 0xbf, 0xf9, 0xd8, 0x3b, 0x6b, 0xdc, 0x3d, 0xbf, 0x3f, 0xac, - 0x1d, 0x92, 0x8c, 0x2f, 0x8b, 0x8b, 0x1f, 0xfe, 0x7d, 0x2d, 0xed, 0xb3, 0xc9, 0x8c, 0xa2, 0xe9, - 0x8c, 0xa2, 0xb7, 0x19, 0x45, 0xf7, 0x73, 0x9a, 0x4c, 0xe7, 0x34, 0x79, 0x99, 0xd3, 0xe4, 0x8a, - 0xe9, 0xdc, 0xf7, 0x4a, 0xc9, 0xba, 0x10, 0xd4, 0xe3, 0xd5, 0xa0, 0xdb, 0xa5, 0x28, 0x3f, 0xb2, - 0xca, 0xc9, 0x5a, 0xd8, 0xf0, 0xc9, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0x50, 0x76, 0x59, 0x9b, - 0x0e, 0x02, 0x00, 0x00, + // 304 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xc1, 0x4a, 0x33, 0x31, + 0x14, 0x85, 0x27, 0x3f, 0xbf, 0x5d, 0x44, 0xdc, 0xc4, 0x56, 0xa4, 0x48, 0xd4, 0xc1, 0x85, 0x14, + 0x4c, 0x68, 0xfb, 0x06, 0x5d, 0x89, 0x2b, 0xed, 0xd2, 0x5d, 0x52, 0x42, 0x3a, 0xd8, 0xe6, 0xa6, + 0x93, 0x8c, 0xd8, 0xba, 0x13, 0x1f, 0x40, 0xf0, 0xa5, 0xba, 0x2c, 0xb8, 0x71, 0x25, 0xd2, 0xfa, + 0x20, 0xd2, 0x64, 0x50, 0xa7, 0x82, 0xbb, 0xe4, 0x9e, 0xef, 0x1c, 0xce, 0xbd, 0xb8, 0x31, 0x80, + 0xcc, 0xf8, 0xbc, 0x30, 0x37, 0x7c, 0x52, 0xa8, 0x7c, 0xca, 0x6c, 0x0e, 0x1e, 0xc8, 0x8e, 0x9c, + 0x29, 0xf6, 0x25, 0x35, 0xeb, 0x1a, 0x34, 0x04, 0x85, 0xaf, 0x5f, 0x11, 0x6a, 0x1e, 0x68, 0x00, + 0x3d, 0x52, 0x5c, 0xd8, 0x8c, 0x0b, 0x63, 0xc0, 0x0b, 0x9f, 0x81, 0x71, 0xa5, 0xda, 0x1a, 0x80, + 0x1b, 0x83, 0xe3, 0x52, 0x38, 0x15, 0xb3, 0xf9, 0x6d, 0x5b, 0x2a, 0x2f, 0xda, 0xdc, 0x0a, 0x9d, + 0x99, 0x00, 0x97, 0xec, 0xde, 0x77, 0x0b, 0x2b, 0x72, 0x31, 0x2e, 0x33, 0xd2, 0x3a, 0x26, 0x57, + 0x6b, 0xe7, 0x65, 0x18, 0xf6, 0xd5, 0xa4, 0x50, 0xce, 0xa7, 0x17, 0x78, 0xb7, 0x32, 0x75, 0x16, + 0x8c, 0x53, 0xa4, 0x8b, 0x6b, 0xd1, 0xbc, 0x8f, 0x8e, 0xd0, 0xe9, 0x76, 0xa7, 0xc1, 0x2a, 0x4b, + 0xb0, 0x88, 0xf7, 0xfe, 0xcf, 0xdf, 0x0e, 0x93, 0x7e, 0x89, 0x76, 0x1e, 0x11, 0xde, 0x0a, 0x61, + 0xe4, 0x1e, 0xd7, 0x22, 0x41, 0x8e, 0x37, 0x8c, 0xbf, 0x2b, 0x34, 0xd3, 0xbf, 0x90, 0xd8, 0x27, + 0x6d, 0x3d, 0xbc, 0x7c, 0x3c, 0xff, 0x3b, 0x21, 0x29, 0x97, 0x33, 0x25, 0x46, 0x76, 0x28, 0xbc, + 0x12, 0xe3, 0xf5, 0x87, 0x6f, 0xae, 0xdb, 0x3b, 0x9f, 0x2f, 0x29, 0x5a, 0x2c, 0x29, 0x7a, 0x5f, + 0x52, 0xf4, 0xb4, 0xa2, 0xc9, 0x62, 0x45, 0x93, 0xd7, 0x15, 0x4d, 0xae, 0x99, 0xce, 0xfc, 0xb0, + 0x90, 0x6c, 0x00, 0xc1, 0x7a, 0x56, 0x0d, 0xba, 0xfb, 0x11, 0xe5, 0xa7, 0x56, 0x39, 0x59, 0x0b, + 0x97, 0xeb, 0x7e, 0x06, 0x00, 0x00, 0xff, 0xff, 0x45, 0x35, 0xe5, 0x39, 0xd9, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -170,7 +169,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/bzealphateam.bze.cointrunk.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -205,7 +204,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bzealphateam.bze.cointrunk.Query/Params", + FullMethod: "/bze.cointrunk.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -214,7 +213,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "bzealphateam.bze.cointrunk.Query", + ServiceName: "bze.cointrunk.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/x/cointrunk/types/tx.pb.go b/x/cointrunk/types/tx.pb.go index fb7f977e..6987192e 100644 --- a/x/cointrunk/types/tx.pb.go +++ b/x/cointrunk/types/tx.pb.go @@ -26,16 +26,15 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("cointrunk/tx.proto", fileDescriptor_776bb1586e9b1fcd) } var fileDescriptor_776bb1586e9b1fcd = []byte{ - // 135 bytes of a gzipped FileDescriptorProto + // 128 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4a, 0xce, 0xcf, 0xcc, - 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, - 0x4a, 0xaa, 0x4a, 0x4d, 0xcc, 0x29, 0xc8, 0x48, 0x2c, 0x49, 0x4d, 0xcc, 0xd5, 0x4b, 0xaa, 0x4a, - 0xd5, 0x83, 0x2b, 0x32, 0x62, 0xe5, 0x62, 0xf6, 0x2d, 0x4e, 0x77, 0xf2, 0x38, 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, 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, - 0xfc, 0x5c, 0xfd, 0xa4, 0xaa, 0x54, 0x5d, 0xb8, 0x41, 0x20, 0x9e, 0x7e, 0x85, 0x3e, 0x92, 0x7d, - 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x3b, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x86, - 0xaa, 0x5a, 0x61, 0x89, 0x00, 0x00, 0x00, + 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, + 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x8b, 0x1b, 0xb1, 0x72, 0x31, 0xfb, 0x16, 0xa7, 0x3b, 0x79, 0x9c, + 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, 0x5e, 0x7a, 0x66, 0x49, 0x46, 0x69, + 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x52, 0x55, 0xaa, 0x6e, 0x62, 0x4e, 0x41, 0x46, 0x62, 0x49, + 0x6a, 0x22, 0x98, 0xa7, 0x5f, 0xa1, 0x8f, 0x64, 0x45, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, + 0x1a, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x06, 0x30, 0x5f, 0x7c, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -73,7 +72,7 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "bzealphateam.bze.cointrunk.Msg", + ServiceName: "bze.cointrunk.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{}, diff --git a/x/scavenge/keeper/scavenge.go b/x/scavenge/keeper/scavenge.go index a03e585a..25ac9502 100644 --- a/x/scavenge/keeper/scavenge.go +++ b/x/scavenge/keeper/scavenge.go @@ -10,9 +10,10 @@ import ( func (k Keeper) SetScavenge(ctx sdk.Context, scavenge types.Scavenge) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ScavengeKeyPrefix)) b := k.cdc.MustMarshal(&scavenge) - store.Set(types.ScavengeKey( - scavenge.Index, - ), b) + store.Set( + types.ScavengeKey(scavenge.Index), + b, + ) } // GetScavenge returns a scavenge from its index From 70f470d52b58f74236af80eb52c46167f02773ab Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Tue, 22 Nov 2022 19:21:52 +0200 Subject: [PATCH 06/54] added queries for accepted domain and publisher --- docs/static/openapi.yml | 492 ++++++-- proto/cointrunk/query.proto | 32 +- .../bze-alphateam/bze/bze.cointrunk/index.ts | 66 ++ .../bze/bze.cointrunk/module/rest.ts | 156 +++ .../module/types/cointrunk/query.ts | 382 ++++++ .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +- .../bze/bze.scavenge/module/index.ts | 6 +- x/cointrunk/client/cli/query.go | 4 + .../client/cli/query_accepted_domain.go | 48 + x/cointrunk/client/cli/query_publisher.go | 48 + .../keeper/grpc_query_accepted_domain.go | 38 + x/cointrunk/keeper/grpc_query_publisher.go | 36 + x/cointrunk/types/query.pb.go | 1048 ++++++++++++++++- x/cointrunk/types/query.pb.gw.go | 166 +++ 14 files changed, 2399 insertions(+), 155 deletions(-) create mode 100644 x/cointrunk/client/cli/query_accepted_domain.go create mode 100644 x/cointrunk/client/cli/query_publisher.go create mode 100644 x/cointrunk/keeper/grpc_query_accepted_domain.go create mode 100644 x/cointrunk/keeper/grpc_query_publisher.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index b04ebe74..8a96f282 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -4,6 +4,254 @@ info: name: '' description: '' paths: + /bze-alphateam/bze/cointrunk/accepted_domain: + get: + summary: Queries a list of AcceptedDomain items. + operationId: BzeCointrunkAcceptedDomain + responses: + '200': + description: A successful response. + schema: + type: object + properties: + acceptedDomain: + type: array + items: + type: object + properties: + domain: + type: string + active: + type: boolean + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + default: + description: An unexpected 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 + /bze-alphateam/bze/cointrunk/publisher: + get: + summary: Queries a list of Publisher items. + operationId: BzeCointrunkPublisher + responses: + '200': + description: A successful response. + schema: + type: object + properties: + publisher: + type: array + items: + type: object + properties: + name: + type: string + address: + type: string + active: + type: boolean + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + default: + description: An unexpected 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 /bzealphateam/bze/cointrunk/params: get: summary: Parameters queries the parameters of the module. @@ -30046,6 +30294,13 @@ paths: tags: - Query definitions: + bze.cointrunk.AcceptedDomain: + type: object + properties: + domain: + type: string + active: + type: boolean bze.cointrunk.Params: type: object properties: @@ -30055,6 +30310,52 @@ definitions: anonArticleCost: type: string description: Params defines the parameters for the module. + bze.cointrunk.Publisher: + type: object + properties: + name: + type: string + address: + type: string + active: + type: boolean + bze.cointrunk.QueryAcceptedDomainResponse: + type: object + properties: + acceptedDomain: + type: array + items: + type: object + properties: + domain: + type: string + active: + type: boolean + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } bze.cointrunk.QueryParamsResponse: type: object properties: @@ -30068,6 +30369,121 @@ definitions: anonArticleCost: type: string description: QueryParamsResponse is response type for the Query/Params RPC method. + bze.cointrunk.QueryPublisherResponse: + type: object + properties: + publisher: + type: array + items: + type: object + properties: + name: + type: string + address: + type: string + active: + type: boolean + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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: @@ -30535,82 +30951,6 @@ definitions: type: string scavenger: type: string - 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 - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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; - } cosmos.auth.v1beta1.Params: type: object properties: diff --git a/proto/cointrunk/query.proto b/proto/cointrunk/query.proto index a856ff00..7f081ef0 100644 --- a/proto/cointrunk/query.proto +++ b/proto/cointrunk/query.proto @@ -5,6 +5,8 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "cointrunk/params.proto"; +import "cointrunk/accepted_domain.proto"; +import "cointrunk/publisher.proto"; // this line is used by starport scaffolding # 1 option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; @@ -15,7 +17,17 @@ service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/bzealphateam/bze/cointrunk/params"; } - // this line is used by starport scaffolding # 2 + // Queries a list of AcceptedDomain items. + rpc AcceptedDomain(QueryAcceptedDomainRequest) returns (QueryAcceptedDomainResponse) { + option (google.api.http).get = "/bze-alphateam/bze/cointrunk/accepted_domain"; + } + +// Queries a list of Publisher items. + rpc Publisher(QueryPublisherRequest) returns (QueryPublisherResponse) { + option (google.api.http).get = "/bze-alphateam/bze/cointrunk/publisher"; + } + +// this line is used by starport scaffolding # 2 } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -27,4 +39,22 @@ message QueryParamsResponse { Params params = 1 [(gogoproto.nullable) = false]; } +message QueryAcceptedDomainRequest { +cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAcceptedDomainResponse { +repeated AcceptedDomain acceptedDomain = 1 [(gogoproto.nullable) = false]; +cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryPublisherRequest { +cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryPublisherResponse { +repeated Publisher publisher = 1 [(gogoproto.nullable) = false]; +cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + // this line is used by starport scaffolding # 3 diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts index 28dcb8dd..fe3fe265 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts @@ -46,6 +46,8 @@ function getStructure(template) { const getDefaultState = () => { return { Params: {}, + AcceptedDomain: {}, + Publisher: {}, _Structure: { AcceptedDomain: getStructure(AcceptedDomain.fromPartial({})), @@ -87,6 +89,18 @@ export default { } return state.Params[JSON.stringify(params)] ?? {} }, + getAcceptedDomain: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.AcceptedDomain[JSON.stringify(params)] ?? {} + }, + getPublisher: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.Publisher[JSON.stringify(params)] ?? {} + }, getTypeStructure: (state) => (type) => { return state._Structure[type].fields @@ -145,5 +159,57 @@ export default { + + + + async QueryAcceptedDomain({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryAcceptedDomain(query)).data + + + while (all && ( value).pagination && ( value).pagination.next_key!=null) { + let next_values=(await queryClient.queryAcceptedDomain({...query, 'pagination.key':( value).pagination.next_key})).data + value = mergeResults(value, next_values); + } + commit('QUERY', { query: 'AcceptedDomain', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryAcceptedDomain', payload: { options: { all }, params: {...key},query }}) + return getters['getAcceptedDomain']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryAcceptedDomain API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + + + + + + + async QueryPublisher({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryPublisher(query)).data + + + while (all && ( value).pagination && ( value).pagination.next_key!=null) { + let next_values=(await queryClient.queryPublisher({...query, 'pagination.key':( value).pagination.next_key})).data + value = mergeResults(value, next_values); + } + commit('QUERY', { query: 'Publisher', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryPublisher', payload: { options: { all }, params: {...key},query }}) + return getters['getPublisher']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryPublisher API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + + + } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts index 955d29d8..ca15079b 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts @@ -9,6 +9,11 @@ * --------------------------------------------------------------- */ +export interface CointrunkAcceptedDomain { + domain?: string; + active?: boolean; +} + /** * Params defines the parameters for the module. */ @@ -18,6 +23,27 @@ export interface CointrunkParams { anonArticleCost?: string; } +export interface CointrunkPublisher { + name?: string; + address?: string; + active?: boolean; +} + +export interface CointrunkQueryAcceptedDomainResponse { + acceptedDomain?: CointrunkAcceptedDomain[]; + + /** + * 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; + * } + */ + pagination?: V1Beta1PageResponse; +} + /** * QueryParamsResponse is response type for the Query/Params RPC method. */ @@ -26,6 +52,21 @@ export interface CointrunkQueryParamsResponse { params?: CointrunkParams; } +export interface CointrunkQueryPublisherResponse { + publisher?: CointrunkPublisher[]; + + /** + * 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; + * } + */ + pagination?: V1Beta1PageResponse; +} + export interface ProtobufAny { "@type"?: string; } @@ -37,6 +78,69 @@ export interface RpcStatus { details?: ProtobufAny[]; } +/** +* message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } +*/ +export interface V1Beta1PageRequest { + /** + * 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. + * @format byte + */ + key?: string; + + /** + * 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. + * @format uint64 + */ + offset?: string; + + /** + * 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. + * @format uint64 + */ + limit?: string; + + /** + * 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. + */ + count_total?: boolean; + + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse?: boolean; +} + +/** +* 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; + } +*/ +export interface V1Beta1PageResponse { + /** @format byte */ + next_key?: string; + + /** @format uint64 */ + total?: string; +} + export type QueryParamsType = Record; export type ResponseFormat = keyof Omit; @@ -233,6 +337,58 @@ export class HttpClient { * @version version not set */ export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryAcceptedDomain + * @summary Queries a list of AcceptedDomain items. + * @request GET:/bze-alphateam/bze/cointrunk/accepted_domain + */ + queryAcceptedDomain = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/bze-alphateam/bze/cointrunk/accepted_domain`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryPublisher + * @summary Queries a list of Publisher items. + * @request GET:/bze-alphateam/bze/cointrunk/publisher + */ + queryPublisher = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/bze-alphateam/bze/cointrunk/publisher`, + method: "GET", + query: query, + format: "json", + ...params, + }); + /** * No description * diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts index b05b8337..659f7635 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts @@ -1,6 +1,12 @@ /* eslint-disable */ import { Reader, Writer } from "protobufjs/minimal"; import { Params } from "../cointrunk/params"; +import { + PageRequest, + PageResponse, +} from "../cosmos/base/query/v1beta1/pagination"; +import { AcceptedDomain } from "../cointrunk/accepted_domain"; +import { Publisher } from "../cointrunk/publisher"; export const protobufPackage = "bze.cointrunk"; @@ -13,6 +19,24 @@ export interface QueryParamsResponse { params: Params | undefined; } +export interface QueryAcceptedDomainRequest { + pagination: PageRequest | undefined; +} + +export interface QueryAcceptedDomainResponse { + acceptedDomain: AcceptedDomain[]; + pagination: PageResponse | undefined; +} + +export interface QueryPublisherRequest { + pagination: PageRequest | undefined; +} + +export interface QueryPublisherResponse { + publisher: Publisher[]; + pagination: PageResponse | undefined; +} + const baseQueryParamsRequest: object = {}; export const QueryParamsRequest = { @@ -110,10 +134,346 @@ export const QueryParamsResponse = { }, }; +const baseQueryAcceptedDomainRequest: object = {}; + +export const QueryAcceptedDomainRequest = { + encode( + message: QueryAcceptedDomainRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryAcceptedDomainRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAcceptedDomainRequest, + } as QueryAcceptedDomainRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAcceptedDomainRequest { + const message = { + ...baseQueryAcceptedDomainRequest, + } as QueryAcceptedDomainRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAcceptedDomainRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAcceptedDomainRequest { + const message = { + ...baseQueryAcceptedDomainRequest, + } as QueryAcceptedDomainRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAcceptedDomainResponse: object = {}; + +export const QueryAcceptedDomainResponse = { + encode( + message: QueryAcceptedDomainResponse, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.acceptedDomain) { + AcceptedDomain.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryAcceptedDomainResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAcceptedDomainResponse, + } as QueryAcceptedDomainResponse; + message.acceptedDomain = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acceptedDomain.push( + AcceptedDomain.decode(reader, reader.uint32()) + ); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAcceptedDomainResponse { + const message = { + ...baseQueryAcceptedDomainResponse, + } as QueryAcceptedDomainResponse; + message.acceptedDomain = []; + if (object.acceptedDomain !== undefined && object.acceptedDomain !== null) { + for (const e of object.acceptedDomain) { + message.acceptedDomain.push(AcceptedDomain.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAcceptedDomainResponse): unknown { + const obj: any = {}; + if (message.acceptedDomain) { + obj.acceptedDomain = message.acceptedDomain.map((e) => + e ? AcceptedDomain.toJSON(e) : undefined + ); + } else { + obj.acceptedDomain = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAcceptedDomainResponse { + const message = { + ...baseQueryAcceptedDomainResponse, + } as QueryAcceptedDomainResponse; + message.acceptedDomain = []; + if (object.acceptedDomain !== undefined && object.acceptedDomain !== null) { + for (const e of object.acceptedDomain) { + message.acceptedDomain.push(AcceptedDomain.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryPublisherRequest: object = {}; + +export const QueryPublisherRequest = { + encode( + message: QueryPublisherRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryPublisherRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPublisherRequest } as QueryPublisherRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPublisherRequest { + const message = { ...baseQueryPublisherRequest } as QueryPublisherRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryPublisherRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryPublisherRequest { + const message = { ...baseQueryPublisherRequest } as QueryPublisherRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryPublisherResponse: object = {}; + +export const QueryPublisherResponse = { + encode( + message: QueryPublisherResponse, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.publisher) { + Publisher.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryPublisherResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPublisherResponse } as QueryPublisherResponse; + message.publisher = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publisher.push(Publisher.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPublisherResponse { + const message = { ...baseQueryPublisherResponse } as QueryPublisherResponse; + message.publisher = []; + if (object.publisher !== undefined && object.publisher !== null) { + for (const e of object.publisher) { + message.publisher.push(Publisher.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryPublisherResponse): unknown { + const obj: any = {}; + if (message.publisher) { + obj.publisher = message.publisher.map((e) => + e ? Publisher.toJSON(e) : undefined + ); + } else { + obj.publisher = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryPublisherResponse { + const message = { ...baseQueryPublisherResponse } as QueryPublisherResponse; + message.publisher = []; + if (object.publisher !== undefined && object.publisher !== null) { + for (const e of object.publisher) { + message.publisher.push(Publisher.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + /** Query defines the gRPC querier service. */ export interface Query { /** Parameters queries the parameters of the module. */ Params(request: QueryParamsRequest): Promise; + /** Queries a list of AcceptedDomain items. */ + AcceptedDomain( + request: QueryAcceptedDomainRequest + ): Promise; + /** Queries a list of Publisher items. */ + Publisher(request: QueryPublisherRequest): Promise; } export class QueryClientImpl implements Query { @@ -126,6 +486,28 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("bze.cointrunk.Query", "Params", data); return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); } + + AcceptedDomain( + request: QueryAcceptedDomainRequest + ): Promise { + const data = QueryAcceptedDomainRequest.encode(request).finish(); + const promise = this.rpc.request( + "bze.cointrunk.Query", + "AcceptedDomain", + data + ); + return promise.then((data) => + QueryAcceptedDomainResponse.decode(new Reader(data)) + ); + } + + Publisher(request: QueryPublisherRequest): Promise { + const data = QueryPublisherRequest.encode(request).finish(); + const promise = this.rpc.request("bze.cointrunk.Query", "Publisher", data); + return promise.then((data) => + QueryPublisherResponse.decode(new Reader(data)) + ); + } } interface Rpc { diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 36486b56..0b1e1ca7 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -247,33 +247,33 @@ export default { } } }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -291,29 +291,29 @@ export default { } } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, - async MsgRevealSolution({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 27b7f752..0e8c4c98 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -5,14 +5,14 @@ import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; -import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; +import { MsgCommitSolution } from "./types/scavenge/tx"; const types = [ ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], - ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], + ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -46,8 +46,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), - msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), + msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/client/cli/query.go b/x/cointrunk/client/cli/query.go index 4a45a47c..8db7c8da 100644 --- a/x/cointrunk/client/cli/query.go +++ b/x/cointrunk/client/cli/query.go @@ -25,6 +25,10 @@ func GetQueryCmd(queryRoute string) *cobra.Command { } cmd.AddCommand(CmdQueryParams()) + cmd.AddCommand(CmdAcceptedDomain()) + + cmd.AddCommand(CmdPublisher()) + // this line is used by starport scaffolding # 1 return cmd diff --git a/x/cointrunk/client/cli/query_accepted_domain.go b/x/cointrunk/client/cli/query_accepted_domain.go new file mode 100644 index 00000000..f314021c --- /dev/null +++ b/x/cointrunk/client/cli/query_accepted_domain.go @@ -0,0 +1,48 @@ +package cli + +import ( + "strconv" + + "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdAcceptedDomain() *cobra.Command { + cmd := &cobra.Command{ + Use: "accepted-domain", + Short: "Query accepted-domain", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAcceptedDomainRequest{} + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + params.Pagination = pageReq + + res, err := queryClient.AcceptedDomain(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/cointrunk/client/cli/query_publisher.go b/x/cointrunk/client/cli/query_publisher.go new file mode 100644 index 00000000..4a566564 --- /dev/null +++ b/x/cointrunk/client/cli/query_publisher.go @@ -0,0 +1,48 @@ +package cli + +import ( + "strconv" + + "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdPublisher() *cobra.Command { + cmd := &cobra.Command{ + Use: "publisher", + Short: "Query publisher", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryPublisherRequest{} + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + params.Pagination = pageReq + + res, err := queryClient.Publisher(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/cointrunk/keeper/grpc_query_accepted_domain.go b/x/cointrunk/keeper/grpc_query_accepted_domain.go new file mode 100644 index 00000000..4ce78b93 --- /dev/null +++ b/x/cointrunk/keeper/grpc_query_accepted_domain.go @@ -0,0 +1,38 @@ +package keeper + +import ( + "context" + "github.com/cosmos/cosmos-sdk/store/prefix" + "github.com/cosmos/cosmos-sdk/types/query" + + "github.com/bze-alphateam/bze/x/cointrunk/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) AcceptedDomain(goCtx context.Context, req *types.QueryAcceptedDomainRequest) (*types.QueryAcceptedDomainResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + var acceptedDomains []types.AcceptedDomain + store := ctx.KVStore(k.storeKey) + adStore := prefix.NewStore(store, types.KeyPrefix(types.AcceptedDomainKeyPrefix)) + + pageRes, err := query.Paginate(adStore, req.Pagination, func(key []byte, value []byte) error { + var acceptedDomain types.AcceptedDomain + if err := k.cdc.Unmarshal(value, &acceptedDomain); err != nil { + return err + } + acceptedDomains = append(acceptedDomains, acceptedDomain) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAcceptedDomainResponse{AcceptedDomain: acceptedDomains, Pagination: pageRes}, nil +} diff --git a/x/cointrunk/keeper/grpc_query_publisher.go b/x/cointrunk/keeper/grpc_query_publisher.go new file mode 100644 index 00000000..f2fe15fc --- /dev/null +++ b/x/cointrunk/keeper/grpc_query_publisher.go @@ -0,0 +1,36 @@ +package keeper + +import ( + "context" + "github.com/cosmos/cosmos-sdk/store/prefix" + "github.com/cosmos/cosmos-sdk/types/query" + + "github.com/bze-alphateam/bze/x/cointrunk/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Publisher(goCtx context.Context, req *types.QueryPublisherRequest) (*types.QueryPublisherResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + var publishers []types.Publisher + store := ctx.KVStore(k.storeKey) + publisherStore := prefix.NewStore(store, types.KeyPrefix(types.PublisherKeyPrefix)) + pageRes, err := query.Paginate(publisherStore, req.Pagination, func(key []byte, value []byte) error { + var publisher types.Publisher + if err := k.cdc.Unmarshal(value, &publisher); err != nil { + return err + } + publishers = append(publishers, publisher) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryPublisherResponse{Publisher: publishers, Pagination: pageRes}, nil +} diff --git a/x/cointrunk/types/query.pb.go b/x/cointrunk/types/query.pb.go index 79e5958b..a29518f7 100644 --- a/x/cointrunk/types/query.pb.go +++ b/x/cointrunk/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/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -113,34 +113,244 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } +type QueryAcceptedDomainRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAcceptedDomainRequest) Reset() { *m = QueryAcceptedDomainRequest{} } +func (m *QueryAcceptedDomainRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAcceptedDomainRequest) ProtoMessage() {} +func (*QueryAcceptedDomainRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_12b6eb50b0e9fa00, []int{2} +} +func (m *QueryAcceptedDomainRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAcceptedDomainRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAcceptedDomainRequest.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 *QueryAcceptedDomainRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAcceptedDomainRequest.Merge(m, src) +} +func (m *QueryAcceptedDomainRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAcceptedDomainRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAcceptedDomainRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAcceptedDomainRequest proto.InternalMessageInfo + +func (m *QueryAcceptedDomainRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAcceptedDomainResponse struct { + AcceptedDomain []AcceptedDomain `protobuf:"bytes,1,rep,name=acceptedDomain,proto3" json:"acceptedDomain"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAcceptedDomainResponse) Reset() { *m = QueryAcceptedDomainResponse{} } +func (m *QueryAcceptedDomainResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAcceptedDomainResponse) ProtoMessage() {} +func (*QueryAcceptedDomainResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_12b6eb50b0e9fa00, []int{3} +} +func (m *QueryAcceptedDomainResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAcceptedDomainResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAcceptedDomainResponse.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 *QueryAcceptedDomainResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAcceptedDomainResponse.Merge(m, src) +} +func (m *QueryAcceptedDomainResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAcceptedDomainResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAcceptedDomainResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAcceptedDomainResponse proto.InternalMessageInfo + +func (m *QueryAcceptedDomainResponse) GetAcceptedDomain() []AcceptedDomain { + if m != nil { + return m.AcceptedDomain + } + return nil +} + +func (m *QueryAcceptedDomainResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryPublisherRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryPublisherRequest) Reset() { *m = QueryPublisherRequest{} } +func (m *QueryPublisherRequest) String() string { return proto.CompactTextString(m) } +func (*QueryPublisherRequest) ProtoMessage() {} +func (*QueryPublisherRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_12b6eb50b0e9fa00, []int{4} +} +func (m *QueryPublisherRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPublisherRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPublisherRequest.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 *QueryPublisherRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPublisherRequest.Merge(m, src) +} +func (m *QueryPublisherRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryPublisherRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPublisherRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPublisherRequest proto.InternalMessageInfo + +func (m *QueryPublisherRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryPublisherResponse struct { + Publisher []Publisher `protobuf:"bytes,1,rep,name=publisher,proto3" json:"publisher"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryPublisherResponse) Reset() { *m = QueryPublisherResponse{} } +func (m *QueryPublisherResponse) String() string { return proto.CompactTextString(m) } +func (*QueryPublisherResponse) ProtoMessage() {} +func (*QueryPublisherResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_12b6eb50b0e9fa00, []int{5} +} +func (m *QueryPublisherResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPublisherResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPublisherResponse.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 *QueryPublisherResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPublisherResponse.Merge(m, src) +} +func (m *QueryPublisherResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryPublisherResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPublisherResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPublisherResponse proto.InternalMessageInfo + +func (m *QueryPublisherResponse) GetPublisher() []Publisher { + if m != nil { + return m.Publisher + } + return nil +} + +func (m *QueryPublisherResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "bze.cointrunk.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "bze.cointrunk.QueryParamsResponse") + proto.RegisterType((*QueryAcceptedDomainRequest)(nil), "bze.cointrunk.QueryAcceptedDomainRequest") + proto.RegisterType((*QueryAcceptedDomainResponse)(nil), "bze.cointrunk.QueryAcceptedDomainResponse") + proto.RegisterType((*QueryPublisherRequest)(nil), "bze.cointrunk.QueryPublisherRequest") + proto.RegisterType((*QueryPublisherResponse)(nil), "bze.cointrunk.QueryPublisherResponse") } func init() { proto.RegisterFile("cointrunk/query.proto", fileDescriptor_12b6eb50b0e9fa00) } var fileDescriptor_12b6eb50b0e9fa00 = []byte{ - // 304 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xc1, 0x4a, 0x33, 0x31, - 0x14, 0x85, 0x27, 0x3f, 0xbf, 0x5d, 0x44, 0xdc, 0xc4, 0x56, 0xa4, 0x48, 0xd4, 0xc1, 0x85, 0x14, - 0x4c, 0x68, 0xfb, 0x06, 0x5d, 0x89, 0x2b, 0xed, 0xd2, 0x5d, 0x52, 0x42, 0x3a, 0xd8, 0xe6, 0xa6, - 0x93, 0x8c, 0xd8, 0xba, 0x13, 0x1f, 0x40, 0xf0, 0xa5, 0xba, 0x2c, 0xb8, 0x71, 0x25, 0xd2, 0xfa, - 0x20, 0xd2, 0x64, 0x50, 0xa7, 0x82, 0xbb, 0xe4, 0x9e, 0xef, 0x1c, 0xce, 0xbd, 0xb8, 0x31, 0x80, - 0xcc, 0xf8, 0xbc, 0x30, 0x37, 0x7c, 0x52, 0xa8, 0x7c, 0xca, 0x6c, 0x0e, 0x1e, 0xc8, 0x8e, 0x9c, - 0x29, 0xf6, 0x25, 0x35, 0xeb, 0x1a, 0x34, 0x04, 0x85, 0xaf, 0x5f, 0x11, 0x6a, 0x1e, 0x68, 0x00, - 0x3d, 0x52, 0x5c, 0xd8, 0x8c, 0x0b, 0x63, 0xc0, 0x0b, 0x9f, 0x81, 0x71, 0xa5, 0xda, 0x1a, 0x80, - 0x1b, 0x83, 0xe3, 0x52, 0x38, 0x15, 0xb3, 0xf9, 0x6d, 0x5b, 0x2a, 0x2f, 0xda, 0xdc, 0x0a, 0x9d, - 0x99, 0x00, 0x97, 0xec, 0xde, 0x77, 0x0b, 0x2b, 0x72, 0x31, 0x2e, 0x33, 0xd2, 0x3a, 0x26, 0x57, - 0x6b, 0xe7, 0x65, 0x18, 0xf6, 0xd5, 0xa4, 0x50, 0xce, 0xa7, 0x17, 0x78, 0xb7, 0x32, 0x75, 0x16, - 0x8c, 0x53, 0xa4, 0x8b, 0x6b, 0xd1, 0xbc, 0x8f, 0x8e, 0xd0, 0xe9, 0x76, 0xa7, 0xc1, 0x2a, 0x4b, - 0xb0, 0x88, 0xf7, 0xfe, 0xcf, 0xdf, 0x0e, 0x93, 0x7e, 0x89, 0x76, 0x1e, 0x11, 0xde, 0x0a, 0x61, - 0xe4, 0x1e, 0xd7, 0x22, 0x41, 0x8e, 0x37, 0x8c, 0xbf, 0x2b, 0x34, 0xd3, 0xbf, 0x90, 0xd8, 0x27, - 0x6d, 0x3d, 0xbc, 0x7c, 0x3c, 0xff, 0x3b, 0x21, 0x29, 0x97, 0x33, 0x25, 0x46, 0x76, 0x28, 0xbc, - 0x12, 0xe3, 0xf5, 0x87, 0x6f, 0xae, 0xdb, 0x3b, 0x9f, 0x2f, 0x29, 0x5a, 0x2c, 0x29, 0x7a, 0x5f, - 0x52, 0xf4, 0xb4, 0xa2, 0xc9, 0x62, 0x45, 0x93, 0xd7, 0x15, 0x4d, 0xae, 0x99, 0xce, 0xfc, 0xb0, - 0x90, 0x6c, 0x00, 0xc1, 0x7a, 0x56, 0x0d, 0xba, 0xfb, 0x11, 0xe5, 0xa7, 0x56, 0x39, 0x59, 0x0b, - 0x97, 0xeb, 0x7e, 0x06, 0x00, 0x00, 0xff, 0xff, 0x45, 0x35, 0xe5, 0x39, 0xd9, 0x01, 0x00, 0x00, + // 528 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xc7, 0x73, 0x2d, 0x44, 0xea, 0x55, 0x74, 0x38, 0x9a, 0x2a, 0x18, 0x70, 0x8b, 0x55, 0x4a, + 0x88, 0xe0, 0x4e, 0x4d, 0x19, 0x59, 0xa8, 0x10, 0x20, 0x58, 0x4a, 0x46, 0x96, 0xea, 0xec, 0x9c, + 0x1c, 0x8b, 0xd8, 0xe7, 0xfa, 0xce, 0x88, 0x96, 0x8d, 0x89, 0x11, 0x89, 0x19, 0xf1, 0x11, 0x18, + 0xf8, 0x12, 0x1d, 0x2b, 0xb1, 0x30, 0x21, 0x94, 0xf0, 0x41, 0x90, 0xef, 0x2e, 0x71, 0x7c, 0x98, + 0x96, 0x21, 0x5b, 0xe2, 0xf7, 0x7f, 0xef, 0xfd, 0xde, 0xff, 0x3d, 0x1b, 0xb6, 0x02, 0x1e, 0x25, + 0x32, 0xcb, 0x93, 0xd7, 0xe4, 0x28, 0x67, 0xd9, 0x31, 0x4e, 0x33, 0x2e, 0x39, 0xba, 0xe2, 0x9f, + 0x30, 0x3c, 0x0b, 0x39, 0xeb, 0x21, 0x0f, 0xb9, 0x8a, 0x90, 0xe2, 0x97, 0x16, 0x39, 0x37, 0x42, + 0xce, 0xc3, 0x11, 0x23, 0x34, 0x8d, 0x08, 0x4d, 0x12, 0x2e, 0xa9, 0x8c, 0x78, 0x22, 0x4c, 0xb4, + 0x1b, 0x70, 0x11, 0x73, 0x41, 0x7c, 0x2a, 0x98, 0xae, 0x4d, 0xde, 0xec, 0xfa, 0x4c, 0xd2, 0x5d, + 0x92, 0xd2, 0x30, 0x4a, 0x94, 0xd8, 0x68, 0x37, 0x4a, 0x8a, 0x94, 0x66, 0x34, 0x9e, 0xd6, 0xd8, + 0x2c, 0x9f, 0xd3, 0x20, 0x60, 0xa9, 0x64, 0x83, 0xc3, 0x01, 0x8f, 0x69, 0x34, 0x4d, 0xbc, 0x36, + 0x97, 0x98, 0xfb, 0xa3, 0x48, 0x0c, 0x59, 0xa6, 0x43, 0xde, 0x3a, 0x44, 0x2f, 0x8b, 0xae, 0x07, + 0xaa, 0x60, 0x9f, 0x1d, 0xe5, 0x4c, 0x48, 0xef, 0x39, 0xbc, 0x5a, 0x79, 0x2a, 0x52, 0x9e, 0x08, + 0x86, 0xf6, 0x60, 0x53, 0x37, 0x6e, 0x83, 0x2d, 0xd0, 0x59, 0xed, 0xb5, 0x70, 0xc5, 0x00, 0xac, + 0xe5, 0xfb, 0x97, 0x4e, 0x7f, 0x6e, 0x36, 0xfa, 0x46, 0xea, 0x0d, 0xa0, 0xa3, 0x6a, 0x3d, 0x32, + 0x68, 0x8f, 0x15, 0x99, 0xe9, 0x84, 0x9e, 0x40, 0x58, 0xce, 0x69, 0xca, 0xee, 0x60, 0x6d, 0x0a, + 0x2e, 0x4c, 0xc1, 0xda, 0x70, 0x63, 0x0a, 0x3e, 0xa0, 0x21, 0x33, 0xb9, 0xfd, 0xb9, 0x4c, 0xef, + 0x1b, 0x80, 0xd7, 0x6b, 0xdb, 0x18, 0xf4, 0x17, 0x70, 0x8d, 0x56, 0x22, 0x6d, 0xb0, 0xb5, 0xdc, + 0x59, 0xed, 0xdd, 0xb4, 0x46, 0xa8, 0xa6, 0x9b, 0x51, 0xac, 0x54, 0xf4, 0xb4, 0x02, 0xbd, 0xa4, + 0xa0, 0xef, 0x5c, 0x08, 0xad, 0x49, 0x2a, 0xd4, 0x87, 0xb0, 0xa5, 0x7d, 0x9e, 0x6e, 0x65, 0xd1, + 0xb6, 0x7c, 0x01, 0x70, 0xc3, 0xee, 0x60, 0x1c, 0x79, 0x08, 0x57, 0x66, 0xc7, 0x60, 0xcc, 0x68, + 0xdb, 0xfb, 0x9c, 0xc6, 0x8d, 0x0f, 0x65, 0xc2, 0xc2, 0x2c, 0xe8, 0x7d, 0x5d, 0x86, 0x97, 0x15, + 0x21, 0x7a, 0x07, 0x9b, 0xfa, 0x80, 0xd0, 0x2d, 0x8b, 0xe3, 0xef, 0x0b, 0x75, 0xbc, 0xf3, 0x24, + 0xba, 0x8d, 0xd7, 0x7d, 0xff, 0xfd, 0xf7, 0xa7, 0xa5, 0x6d, 0xe4, 0x11, 0xff, 0x84, 0xd1, 0x51, + 0x3a, 0xa4, 0x92, 0xd1, 0xb8, 0xf8, 0x43, 0xec, 0x37, 0x09, 0x7d, 0x06, 0x70, 0xad, 0xba, 0x7b, + 0x74, 0xb7, 0xae, 0x45, 0xed, 0x15, 0x3b, 0xdd, 0xff, 0x91, 0x1a, 0xaa, 0x07, 0x8a, 0x0a, 0xa3, + 0x7b, 0x05, 0xc8, 0xfd, 0x7f, 0x61, 0x59, 0x2f, 0x32, 0xfa, 0x00, 0xe0, 0xca, 0x6c, 0x1d, 0x68, + 0xbb, 0x76, 0x7a, 0xeb, 0x88, 0x9c, 0xdb, 0x17, 0xa8, 0x0c, 0x10, 0x56, 0x40, 0x1d, 0xb4, 0x73, + 0x2e, 0xd0, 0x6c, 0xf5, 0xfb, 0xcf, 0x4e, 0xc7, 0x2e, 0x38, 0x1b, 0xbb, 0xe0, 0xd7, 0xd8, 0x05, + 0x1f, 0x27, 0x6e, 0xe3, 0x6c, 0xe2, 0x36, 0x7e, 0x4c, 0xdc, 0xc6, 0x2b, 0x1c, 0x46, 0x72, 0x98, + 0xfb, 0x38, 0xe0, 0x71, 0x4d, 0xad, 0xb7, 0x73, 0xd5, 0xe4, 0x71, 0xca, 0x84, 0xdf, 0x54, 0xdf, + 0xa0, 0xbd, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x40, 0x3b, 0xc0, 0x8f, 0x5f, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -157,6 +367,10 @@ 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 AcceptedDomain items. + AcceptedDomain(ctx context.Context, in *QueryAcceptedDomainRequest, opts ...grpc.CallOption) (*QueryAcceptedDomainResponse, error) + // Queries a list of Publisher items. + Publisher(ctx context.Context, in *QueryPublisherRequest, opts ...grpc.CallOption) (*QueryPublisherResponse, error) } type queryClient struct { @@ -176,10 +390,32 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } +func (c *queryClient) AcceptedDomain(ctx context.Context, in *QueryAcceptedDomainRequest, opts ...grpc.CallOption) (*QueryAcceptedDomainResponse, error) { + out := new(QueryAcceptedDomainResponse) + err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/AcceptedDomain", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Publisher(ctx context.Context, in *QueryPublisherRequest, opts ...grpc.CallOption) (*QueryPublisherResponse, error) { + out := new(QueryPublisherResponse) + err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/Publisher", 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 AcceptedDomain items. + AcceptedDomain(context.Context, *QueryAcceptedDomainRequest) (*QueryAcceptedDomainResponse, error) + // Queries a list of Publisher items. + Publisher(context.Context, *QueryPublisherRequest) (*QueryPublisherResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -189,6 +425,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) AcceptedDomain(ctx context.Context, req *QueryAcceptedDomainRequest) (*QueryAcceptedDomainResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AcceptedDomain not implemented") +} +func (*UnimplementedQueryServer) Publisher(ctx context.Context, req *QueryPublisherRequest) (*QueryPublisherResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Publisher not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -212,6 +454,42 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_AcceptedDomain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAcceptedDomainRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AcceptedDomain(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bze.cointrunk.Query/AcceptedDomain", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AcceptedDomain(ctx, req.(*QueryAcceptedDomainRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Publisher_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPublisherRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Publisher(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bze.cointrunk.Query/Publisher", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Publisher(ctx, req.(*QueryPublisherRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "bze.cointrunk.Query", HandlerType: (*QueryServer)(nil), @@ -220,6 +498,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, + { + MethodName: "AcceptedDomain", + Handler: _Query_AcceptedDomain_Handler, + }, + { + MethodName: "Publisher", + Handler: _Query_Publisher_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cointrunk/query.proto", @@ -281,58 +567,290 @@ func (m *QueryParamsResponse) 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 *QueryAcceptedDomainRequest) 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 *QueryAcceptedDomainRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAcceptedDomainRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + 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 *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryAcceptedDomainResponse) 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 *QueryAcceptedDomainResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAcceptedDomainResponse) 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 + 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.AcceptedDomain) > 0 { + for iNdEx := len(m.AcceptedDomain) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AcceptedDomain[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 sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *QueryPublisherRequest) 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 sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *QueryPublisherRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -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 + +func (m *QueryPublisherRequest) 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 } - b := dAtA[iNdEx] - iNdEx++ + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryPublisherResponse) 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 *QueryPublisherResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPublisherResponse) 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.Publisher) > 0 { + for iNdEx := len(m.Publisher) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Publisher[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 *QueryAcceptedDomainRequest) 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 *QueryAcceptedDomainResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AcceptedDomain) > 0 { + for _, e := range m.AcceptedDomain { + 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 *QueryPublisherRequest) 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 *QueryPublisherResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Publisher) > 0 { + for _, e := range m.Publisher { + 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 @@ -451,6 +969,418 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryAcceptedDomainRequest) 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: QueryAcceptedDomainRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAcceptedDomainRequest: 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 *QueryAcceptedDomainResponse) 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: QueryAcceptedDomainResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAcceptedDomainResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AcceptedDomain", 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.AcceptedDomain = append(m.AcceptedDomain, AcceptedDomain{}) + if err := m.AcceptedDomain[len(m.AcceptedDomain)-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 *QueryPublisherRequest) 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: QueryPublisherRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPublisherRequest: 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 *QueryPublisherResponse) 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: QueryPublisherResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPublisherResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Publisher", 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.Publisher = append(m.Publisher, Publisher{}) + if err := m.Publisher[len(m.Publisher)-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/cointrunk/types/query.pb.gw.go b/x/cointrunk/types/query.pb.gw.go index d4e4dda2..da2a8b45 100644 --- a/x/cointrunk/types/query.pb.gw.go +++ b/x/cointrunk/types/query.pb.gw.go @@ -51,6 +51,78 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } +var ( + filter_Query_AcceptedDomain_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AcceptedDomain_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAcceptedDomainRequest + 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_AcceptedDomain_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AcceptedDomain(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AcceptedDomain_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAcceptedDomainRequest + 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_AcceptedDomain_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AcceptedDomain(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Publisher_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Publisher_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryPublisherRequest + 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_Publisher_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Publisher(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Publisher_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryPublisherRequest + 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_Publisher_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Publisher(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 +152,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_AcceptedDomain_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_AcceptedDomain_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_AcceptedDomain_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Publisher_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_Publisher_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_Publisher_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -141,13 +259,61 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_AcceptedDomain_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_AcceptedDomain_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_AcceptedDomain_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Publisher_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_Publisher_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_Publisher_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{"bzealphateam", "bze", "cointrunk", "params"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_AcceptedDomain_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze-alphateam", "bze", "cointrunk", "accepted_domain"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Publisher_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze-alphateam", "bze", "cointrunk", "publisher"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_AcceptedDomain_0 = runtime.ForwardResponseMessage + + forward_Query_Publisher_0 = runtime.ForwardResponseMessage ) From be58829486a964e034f0512e00c21b486a482166 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Wed, 23 Nov 2022 00:51:42 +0200 Subject: [PATCH 07/54] added publisher and accepted domain to genesis state import and export --- proto/cointrunk/genesis.proto | 4 + .../module/types/cointrunk/genesis.ts | 66 +++++++- .../bze-alphateam/bze/bze.scavenge/index.ts | 40 ++--- .../bze/bze.scavenge/module/index.ts | 6 +- x/cointrunk/genesis.go | 9 +- x/cointrunk/types/genesis.go | 4 +- x/cointrunk/types/genesis.pb.go | 151 ++++++++++++++++-- 7 files changed, 243 insertions(+), 37 deletions(-) diff --git a/proto/cointrunk/genesis.proto b/proto/cointrunk/genesis.proto index a6bdb660..57ff3b71 100644 --- a/proto/cointrunk/genesis.proto +++ b/proto/cointrunk/genesis.proto @@ -3,6 +3,8 @@ package bze.cointrunk; import "gogoproto/gogo.proto"; import "cointrunk/params.proto"; +import "cointrunk/publisher.proto"; +import "cointrunk/accepted_domain.proto"; // this line is used by starport scaffolding # genesis/proto/import option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; @@ -10,5 +12,7 @@ option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; // GenesisState defines the cointrunk module's genesis state. message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; + repeated Publisher PublisherList = 2 [(gogoproto.nullable) = false]; + repeated AcceptedDomain AcceptedDomainList = 3 [(gogoproto.nullable) = false]; // this line is used by starport scaffolding # genesis/proto/state } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts index 62782e44..a7fc7a97 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts @@ -1,13 +1,17 @@ /* eslint-disable */ import { Params } from "../cointrunk/params"; +import { Publisher } from "../cointrunk/publisher"; +import { AcceptedDomain } from "../cointrunk/accepted_domain"; import { Writer, Reader } from "protobufjs/minimal"; export const protobufPackage = "bze.cointrunk"; /** GenesisState defines the cointrunk module's genesis state. */ export interface GenesisState { - /** this line is used by starport scaffolding # genesis/proto/state */ params: Params | undefined; + PublisherList: Publisher[]; + /** this line is used by starport scaffolding # genesis/proto/state */ + AcceptedDomainList: AcceptedDomain[]; } const baseGenesisState: object = {}; @@ -17,6 +21,12 @@ export const GenesisState = { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } + for (const v of message.PublisherList) { + Publisher.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.AcceptedDomainList) { + AcceptedDomain.encode(v!, writer.uint32(26).fork()).ldelim(); + } return writer; }, @@ -24,12 +34,22 @@ export const GenesisState = { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseGenesisState } as GenesisState; + message.PublisherList = []; + message.AcceptedDomainList = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.params = Params.decode(reader, reader.uint32()); break; + case 2: + message.PublisherList.push(Publisher.decode(reader, reader.uint32())); + break; + case 3: + message.AcceptedDomainList.push( + AcceptedDomain.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -40,11 +60,26 @@ export const GenesisState = { fromJSON(object: any): GenesisState { const message = { ...baseGenesisState } as GenesisState; + message.PublisherList = []; + message.AcceptedDomainList = []; if (object.params !== undefined && object.params !== null) { message.params = Params.fromJSON(object.params); } else { message.params = undefined; } + if (object.PublisherList !== undefined && object.PublisherList !== null) { + for (const e of object.PublisherList) { + message.PublisherList.push(Publisher.fromJSON(e)); + } + } + if ( + object.AcceptedDomainList !== undefined && + object.AcceptedDomainList !== null + ) { + for (const e of object.AcceptedDomainList) { + message.AcceptedDomainList.push(AcceptedDomain.fromJSON(e)); + } + } return message; }, @@ -52,16 +87,45 @@ export const GenesisState = { const obj: any = {}; message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.PublisherList) { + obj.PublisherList = message.PublisherList.map((e) => + e ? Publisher.toJSON(e) : undefined + ); + } else { + obj.PublisherList = []; + } + if (message.AcceptedDomainList) { + obj.AcceptedDomainList = message.AcceptedDomainList.map((e) => + e ? AcceptedDomain.toJSON(e) : undefined + ); + } else { + obj.AcceptedDomainList = []; + } return obj; }, fromPartial(object: DeepPartial): GenesisState { const message = { ...baseGenesisState } as GenesisState; + message.PublisherList = []; + message.AcceptedDomainList = []; if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); } else { message.params = undefined; } + if (object.PublisherList !== undefined && object.PublisherList !== null) { + for (const e of object.PublisherList) { + message.PublisherList.push(Publisher.fromPartial(e)); + } + } + if ( + object.AcceptedDomainList !== undefined && + object.AcceptedDomainList !== null + ) { + for (const e of object.AcceptedDomainList) { + message.AcceptedDomainList.push(AcceptedDomain.fromPartial(e)); + } + } return message; }, }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 0b1e1ca7..40cc1ba4 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,6 +232,21 @@ export default { }, + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgCommitSolution(value) + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + }else{ + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + } + } + }, async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -262,22 +277,20 @@ export default { } } }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) const msg = await txClient.msgCommitSolution(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result + return msg } catch (e) { if (e == MissingWalletError) { throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + } else{ + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) @@ -304,19 +317,6 @@ export default { } } }, - async MsgCommitSolution({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) - } - } - }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 0e8c4c98..c023b54d 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; +import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; -import { MsgCommitSolution } from "./types/scavenge/tx"; const types = [ + ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], - ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), - msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/genesis.go b/x/cointrunk/genesis.go index ae08b8f6..4b85532c 100644 --- a/x/cointrunk/genesis.go +++ b/x/cointrunk/genesis.go @@ -9,7 +9,13 @@ import ( // InitGenesis initializes the capability module's state from a provided genesis // state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + for _, publisher := range genState.PublisherList { + k.SetPublisher(ctx, publisher) + } + for _, acceptedDomain := range genState.AcceptedDomainList { + k.SetAcceptedDomain(ctx, acceptedDomain) + } // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) } @@ -18,7 +24,8 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - + genesis.PublisherList = k.GetAllPublisher(ctx) + genesis.AcceptedDomainList = k.GetAllAcceptedDomain(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/cointrunk/types/genesis.go b/x/cointrunk/types/genesis.go index 56921182..bd0e07cc 100644 --- a/x/cointrunk/types/genesis.go +++ b/x/cointrunk/types/genesis.go @@ -7,7 +7,9 @@ const DefaultIndex uint64 = 1 func DefaultGenesis() *GenesisState { return &GenesisState{ // this line is used by starport scaffolding # genesis/types/default - Params: DefaultParams(), + Params: DefaultParams(), + PublisherList: []Publisher{}, + AcceptedDomainList: []AcceptedDomain{}, } } diff --git a/x/cointrunk/types/genesis.pb.go b/x/cointrunk/types/genesis.pb.go index 56386aaf..c342a702 100644 --- a/x/cointrunk/types/genesis.pb.go +++ b/x/cointrunk/types/genesis.pb.go @@ -25,7 +25,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the cointrunk 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"` + PublisherList []Publisher `protobuf:"bytes,2,rep,name=PublisherList,proto3" json:"PublisherList"` + AcceptedDomainList []AcceptedDomain `protobuf:"bytes,3,rep,name=AcceptedDomainList,proto3" json:"AcceptedDomainList"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -68,6 +70,20 @@ func (m *GenesisState) GetParams() Params { return Params{} } +func (m *GenesisState) GetPublisherList() []Publisher { + if m != nil { + return m.PublisherList + } + return nil +} + +func (m *GenesisState) GetAcceptedDomainList() []AcceptedDomain { + if m != nil { + return m.AcceptedDomainList + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "bze.cointrunk.GenesisState") } @@ -75,20 +91,25 @@ func init() { func init() { proto.RegisterFile("cointrunk/genesis.proto", fileDescriptor_20104b77ac07c6a4) } var fileDescriptor_20104b77ac07c6a4 = []byte{ - // 193 bytes of a gzipped FileDescriptorProto + // 281 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xce, 0xcf, 0xcc, 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x4b, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x65, 0xf4, 0x41, 0x2c, 0x88, 0x22, 0x29, 0x31, 0x84, 0xee, 0x82, 0xc4, 0xa2, 0xc4, - 0x5c, 0xa8, 0x66, 0x25, 0x67, 0x2e, 0x1e, 0x77, 0x88, 0x69, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x42, - 0xc6, 0x5c, 0x6c, 0x10, 0x79, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x51, 0x3d, 0x14, 0xd3, - 0xf5, 0x02, 0xc0, 0x92, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0x95, 0x3a, 0x79, 0x9c, - 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, 0x5e, 0x7a, 0x66, 0x49, 0x46, 0x69, - 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x52, 0x55, 0xaa, 0x6e, 0x62, 0x4e, 0x41, 0x46, 0x62, 0x49, - 0x6a, 0x22, 0x98, 0xa7, 0x5f, 0xa1, 0x8f, 0x70, 0x55, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, - 0xd8, 0x55, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x89, 0xab, 0x2d, 0xed, 0x00, 0x00, - 0x00, + 0x5c, 0xa8, 0x66, 0x29, 0x49, 0x24, 0xf1, 0xd2, 0xa4, 0x9c, 0xcc, 0xe2, 0x8c, 0xd4, 0x22, 0xa8, + 0x94, 0x3c, 0x42, 0x2a, 0x31, 0x39, 0x39, 0xb5, 0xa0, 0x24, 0x35, 0x25, 0x3e, 0x25, 0x3f, 0x37, + 0x31, 0x33, 0x0f, 0xa2, 0x40, 0xe9, 0x1e, 0x23, 0x17, 0x8f, 0x3b, 0xc4, 0x29, 0xc1, 0x25, 0x89, + 0x25, 0xa9, 0x42, 0xc6, 0x5c, 0x6c, 0x10, 0xc3, 0x25, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0x44, + 0xf5, 0x50, 0x9c, 0xa6, 0x17, 0x00, 0x96, 0x74, 0x62, 0x39, 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xaa, + 0x54, 0xc8, 0x85, 0x8b, 0x37, 0x00, 0x66, 0xb3, 0x4f, 0x66, 0x71, 0x89, 0x04, 0x93, 0x02, 0xb3, + 0x06, 0xb7, 0x91, 0x04, 0xba, 0x5e, 0x98, 0x1a, 0xa8, 0x76, 0x54, 0x4d, 0x42, 0xc1, 0x5c, 0x42, + 0x8e, 0x50, 0x47, 0xba, 0x80, 0xdd, 0x08, 0x36, 0x8a, 0x19, 0x6c, 0x94, 0x2c, 0x9a, 0x51, 0xa8, + 0x0a, 0xa1, 0xe6, 0x61, 0xd1, 0xee, 0xe4, 0x71, 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, 0x7a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x49, 0x55, + 0xa9, 0xba, 0x89, 0x39, 0x05, 0x19, 0x89, 0x25, 0xa9, 0x89, 0x60, 0x9e, 0x7e, 0x85, 0x3e, 0x22, + 0xe8, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x21, 0x66, 0x0c, 0x08, 0x00, 0x00, 0xff, + 0xff, 0xbf, 0xf4, 0x58, 0xab, 0xc5, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -111,6 +132,34 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.AcceptedDomainList) > 0 { + for iNdEx := len(m.AcceptedDomainList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AcceptedDomainList[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.PublisherList) > 0 { + for iNdEx := len(m.PublisherList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PublisherList[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 +192,18 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) + if len(m.PublisherList) > 0 { + for _, e := range m.PublisherList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.AcceptedDomainList) > 0 { + for _, e := range m.AcceptedDomainList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -214,6 +275,74 @@ 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 PublisherList", 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.PublisherList = append(m.PublisherList, Publisher{}) + if err := m.PublisherList[len(m.PublisherList)-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 AcceptedDomainList", 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.AcceptedDomainList = append(m.AcceptedDomainList, AcceptedDomain{}) + if err := m.AcceptedDomainList[len(m.AcceptedDomainList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) From bc591da37546577b7b9590ee1a44fc826a24c896 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Wed, 23 Nov 2022 23:56:47 +0200 Subject: [PATCH 08/54] added query for publisher by index --- docs/static/openapi.yml | 56 +++ proto/cointrunk/query.proto | 13 + .../bze-alphateam/bze/bze.cointrunk/index.ts | 33 ++ .../bze/bze.cointrunk/module/rest.ts | 21 + .../module/types/cointrunk/query.ts | 167 +++++++ .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +- .../bze/bze.scavenge/module/index.ts | 6 +- x/cointrunk/client/cli/query.go | 2 +- x/cointrunk/client/cli/query_publisher.go | 2 +- .../client/cli/query_publisher_by_index.go | 45 ++ .../keeper/grpc_query_publisher_by_index.go | 27 ++ x/cointrunk/types/query.pb.go | 453 ++++++++++++++++-- x/cointrunk/types/query.pb.gw.go | 83 ++++ 13 files changed, 885 insertions(+), 55 deletions(-) create mode 100644 x/cointrunk/client/cli/query_publisher_by_index.go create mode 100644 x/cointrunk/keeper/grpc_query_publisher_by_index.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 8a96f282..82659711 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -252,6 +252,50 @@ paths: type: boolean tags: - Query + /bze-alphateam/bze/cointrunk/publisher_by_index: + get: + summary: Queries a list of PublisherByIndex items. + operationId: BzeCointrunkPublisherByIndex + responses: + '200': + description: A successful response. + schema: + type: object + properties: + publisher: + type: object + properties: + name: + type: string + address: + type: string + active: + type: boolean + default: + description: An unexpected 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: index + in: query + required: false + type: string + tags: + - Query /bzealphateam/bze/cointrunk/params: get: summary: Parameters queries the parameters of the module. @@ -30369,6 +30413,18 @@ definitions: anonArticleCost: type: string description: QueryParamsResponse is response type for the Query/Params RPC method. + bze.cointrunk.QueryPublisherByIndexResponse: + type: object + properties: + publisher: + type: object + properties: + name: + type: string + address: + type: string + active: + type: boolean bze.cointrunk.QueryPublisherResponse: type: object properties: diff --git a/proto/cointrunk/query.proto b/proto/cointrunk/query.proto index 7f081ef0..0dceb5e2 100644 --- a/proto/cointrunk/query.proto +++ b/proto/cointrunk/query.proto @@ -27,6 +27,11 @@ service Query { option (google.api.http).get = "/bze-alphateam/bze/cointrunk/publisher"; } +// Queries a list of PublisherByIndex items. + rpc PublisherByIndex(QueryPublisherByIndexRequest) returns (QueryPublisherByIndexResponse) { + option (google.api.http).get = "/bze-alphateam/bze/cointrunk/publisher_by_index"; + } + // this line is used by starport scaffolding # 2 } @@ -57,4 +62,12 @@ repeated Publisher publisher = 1 [(gogoproto.nullable) = false]; cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message QueryPublisherByIndexRequest { + string index = 1; +} + +message QueryPublisherByIndexResponse { + Publisher publisher = 1 [(gogoproto.nullable) = false]; +} + // this line is used by starport scaffolding # 3 diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts index fe3fe265..8acd5088 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts @@ -48,6 +48,7 @@ const getDefaultState = () => { Params: {}, AcceptedDomain: {}, Publisher: {}, + PublisherByIndex: {}, _Structure: { AcceptedDomain: getStructure(AcceptedDomain.fromPartial({})), @@ -101,6 +102,12 @@ export default { } return state.Publisher[JSON.stringify(params)] ?? {} }, + getPublisherByIndex: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.PublisherByIndex[JSON.stringify(params)] ?? {} + }, getTypeStructure: (state) => (type) => { return state._Structure[type].fields @@ -211,5 +218,31 @@ export default { + + + + async QueryPublisherByIndex({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryPublisherByIndex(query)).data + + + while (all && ( value).pagination && ( value).pagination.next_key!=null) { + let next_values=(await queryClient.queryPublisherByIndex({...query, 'pagination.key':( value).pagination.next_key})).data + value = mergeResults(value, next_values); + } + commit('QUERY', { query: 'PublisherByIndex', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryPublisherByIndex', payload: { options: { all }, params: {...key},query }}) + return getters['getPublisherByIndex']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryPublisherByIndex API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + + + } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts index ca15079b..108a3a10 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts @@ -52,6 +52,10 @@ export interface CointrunkQueryParamsResponse { params?: CointrunkParams; } +export interface CointrunkQueryPublisherByIndexResponse { + publisher?: CointrunkPublisher; +} + export interface CointrunkQueryPublisherResponse { publisher?: CointrunkPublisher[]; @@ -389,6 +393,23 @@ export class Api extends HttpClient + this.request({ + path: `/bze-alphateam/bze/cointrunk/publisher_by_index`, + method: "GET", + query: query, + format: "json", + ...params, + }); + /** * No description * diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts index 659f7635..8fdab431 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts @@ -37,6 +37,14 @@ export interface QueryPublisherResponse { pagination: PageResponse | undefined; } +export interface QueryPublisherByIndexRequest { + index: string; +} + +export interface QueryPublisherByIndexResponse { + publisher: Publisher | undefined; +} + const baseQueryParamsRequest: object = {}; export const QueryParamsRequest = { @@ -464,6 +472,147 @@ export const QueryPublisherResponse = { }, }; +const baseQueryPublisherByIndexRequest: object = { index: "" }; + +export const QueryPublisherByIndexRequest = { + encode( + message: QueryPublisherByIndexRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.index !== "") { + writer.uint32(10).string(message.index); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryPublisherByIndexRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryPublisherByIndexRequest, + } as QueryPublisherByIndexRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPublisherByIndexRequest { + const message = { + ...baseQueryPublisherByIndexRequest, + } as QueryPublisherByIndexRequest; + if (object.index !== undefined && object.index !== null) { + message.index = String(object.index); + } else { + message.index = ""; + } + return message; + }, + + toJSON(message: QueryPublisherByIndexRequest): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = message.index); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryPublisherByIndexRequest { + const message = { + ...baseQueryPublisherByIndexRequest, + } as QueryPublisherByIndexRequest; + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } else { + message.index = ""; + } + return message; + }, +}; + +const baseQueryPublisherByIndexResponse: object = {}; + +export const QueryPublisherByIndexResponse = { + encode( + message: QueryPublisherByIndexResponse, + writer: Writer = Writer.create() + ): Writer { + if (message.publisher !== undefined) { + Publisher.encode(message.publisher, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryPublisherByIndexResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryPublisherByIndexResponse, + } as QueryPublisherByIndexResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publisher = Publisher.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPublisherByIndexResponse { + const message = { + ...baseQueryPublisherByIndexResponse, + } as QueryPublisherByIndexResponse; + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = Publisher.fromJSON(object.publisher); + } else { + message.publisher = undefined; + } + return message; + }, + + toJSON(message: QueryPublisherByIndexResponse): unknown { + const obj: any = {}; + message.publisher !== undefined && + (obj.publisher = message.publisher + ? Publisher.toJSON(message.publisher) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryPublisherByIndexResponse { + const message = { + ...baseQueryPublisherByIndexResponse, + } as QueryPublisherByIndexResponse; + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = Publisher.fromPartial(object.publisher); + } else { + message.publisher = undefined; + } + return message; + }, +}; + /** Query defines the gRPC querier service. */ export interface Query { /** Parameters queries the parameters of the module. */ @@ -474,6 +623,10 @@ export interface Query { ): Promise; /** Queries a list of Publisher items. */ Publisher(request: QueryPublisherRequest): Promise; + /** Queries a list of PublisherByIndex items. */ + PublisherByIndex( + request: QueryPublisherByIndexRequest + ): Promise; } export class QueryClientImpl implements Query { @@ -508,6 +661,20 @@ export class QueryClientImpl implements Query { QueryPublisherResponse.decode(new Reader(data)) ); } + + PublisherByIndex( + request: QueryPublisherByIndexRequest + ): Promise { + const data = QueryPublisherByIndexRequest.encode(request).finish(); + const promise = this.rpc.request( + "bze.cointrunk.Query", + "PublisherByIndex", + data + ); + return promise.then((data) => + QueryPublisherByIndexResponse.decode(new Reader(data)) + ); + } } interface Rpc { diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 40cc1ba4..36486b56 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,33 +232,33 @@ export default { }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgSubmitScavenge(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -278,29 +278,29 @@ export default { } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgSubmitScavenge(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index c023b54d..27b7f752 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,14 +4,14 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; +import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], + ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; @@ -45,8 +45,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), + msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; diff --git a/x/cointrunk/client/cli/query.go b/x/cointrunk/client/cli/query.go index 8db7c8da..93e987f8 100644 --- a/x/cointrunk/client/cli/query.go +++ b/x/cointrunk/client/cli/query.go @@ -26,8 +26,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryParams()) cmd.AddCommand(CmdAcceptedDomain()) - cmd.AddCommand(CmdPublisher()) + cmd.AddCommand(CmdPublisherByIndex()) // this line is used by starport scaffolding # 1 diff --git a/x/cointrunk/client/cli/query_publisher.go b/x/cointrunk/client/cli/query_publisher.go index 4a566564..069148c5 100644 --- a/x/cointrunk/client/cli/query_publisher.go +++ b/x/cointrunk/client/cli/query_publisher.go @@ -13,7 +13,7 @@ var _ = strconv.Itoa(0) func CmdPublisher() *cobra.Command { cmd := &cobra.Command{ - Use: "publisher", + Use: "publishers", Short: "Query publisher", Args: cobra.ExactArgs(0), RunE: func(cmd *cobra.Command, args []string) (err error) { diff --git a/x/cointrunk/client/cli/query_publisher_by_index.go b/x/cointrunk/client/cli/query_publisher_by_index.go new file mode 100644 index 00000000..96982216 --- /dev/null +++ b/x/cointrunk/client/cli/query_publisher_by_index.go @@ -0,0 +1,45 @@ +package cli + +import ( + "strconv" + + "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdPublisherByIndex() *cobra.Command { + cmd := &cobra.Command{ + Use: "publisher [address]", + Short: "Query publisher by address", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + index := args[0] + params := &types.QueryPublisherByIndexRequest{ + Index: index, + } + + res, err := queryClient.PublisherByIndex(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/cointrunk/keeper/grpc_query_publisher_by_index.go b/x/cointrunk/keeper/grpc_query_publisher_by_index.go new file mode 100644 index 00000000..68dbc0e4 --- /dev/null +++ b/x/cointrunk/keeper/grpc_query_publisher_by_index.go @@ -0,0 +1,27 @@ +package keeper + +import ( + "context" + + "github.com/bze-alphateam/bze/x/cointrunk/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) PublisherByIndex(goCtx context.Context, req *types.QueryPublisherByIndexRequest) (*types.QueryPublisherByIndexResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + publisher, found := k.GetPublisher(ctx, req.Index) + if !found { + return nil, status.Error(codes.InvalidArgument, "not found") + } + + _ = ctx + + return &types.QueryPublisherByIndexResponse{Publisher: publisher}, nil +} diff --git a/x/cointrunk/types/query.pb.go b/x/cointrunk/types/query.pb.go index a29518f7..875b2897 100644 --- a/x/cointrunk/types/query.pb.go +++ b/x/cointrunk/types/query.pb.go @@ -305,6 +305,94 @@ func (m *QueryPublisherResponse) GetPagination() *query.PageResponse { return nil } +type QueryPublisherByIndexRequest struct { + Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` +} + +func (m *QueryPublisherByIndexRequest) Reset() { *m = QueryPublisherByIndexRequest{} } +func (m *QueryPublisherByIndexRequest) String() string { return proto.CompactTextString(m) } +func (*QueryPublisherByIndexRequest) ProtoMessage() {} +func (*QueryPublisherByIndexRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_12b6eb50b0e9fa00, []int{6} +} +func (m *QueryPublisherByIndexRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPublisherByIndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPublisherByIndexRequest.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 *QueryPublisherByIndexRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPublisherByIndexRequest.Merge(m, src) +} +func (m *QueryPublisherByIndexRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryPublisherByIndexRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPublisherByIndexRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPublisherByIndexRequest proto.InternalMessageInfo + +func (m *QueryPublisherByIndexRequest) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +type QueryPublisherByIndexResponse struct { + Publisher Publisher `protobuf:"bytes,1,opt,name=publisher,proto3" json:"publisher"` +} + +func (m *QueryPublisherByIndexResponse) Reset() { *m = QueryPublisherByIndexResponse{} } +func (m *QueryPublisherByIndexResponse) String() string { return proto.CompactTextString(m) } +func (*QueryPublisherByIndexResponse) ProtoMessage() {} +func (*QueryPublisherByIndexResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_12b6eb50b0e9fa00, []int{7} +} +func (m *QueryPublisherByIndexResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPublisherByIndexResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPublisherByIndexResponse.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 *QueryPublisherByIndexResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPublisherByIndexResponse.Merge(m, src) +} +func (m *QueryPublisherByIndexResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryPublisherByIndexResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPublisherByIndexResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPublisherByIndexResponse proto.InternalMessageInfo + +func (m *QueryPublisherByIndexResponse) GetPublisher() Publisher { + if m != nil { + return m.Publisher + } + return Publisher{} +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "bze.cointrunk.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "bze.cointrunk.QueryParamsResponse") @@ -312,45 +400,52 @@ func init() { proto.RegisterType((*QueryAcceptedDomainResponse)(nil), "bze.cointrunk.QueryAcceptedDomainResponse") proto.RegisterType((*QueryPublisherRequest)(nil), "bze.cointrunk.QueryPublisherRequest") proto.RegisterType((*QueryPublisherResponse)(nil), "bze.cointrunk.QueryPublisherResponse") + proto.RegisterType((*QueryPublisherByIndexRequest)(nil), "bze.cointrunk.QueryPublisherByIndexRequest") + proto.RegisterType((*QueryPublisherByIndexResponse)(nil), "bze.cointrunk.QueryPublisherByIndexResponse") } func init() { proto.RegisterFile("cointrunk/query.proto", fileDescriptor_12b6eb50b0e9fa00) } var fileDescriptor_12b6eb50b0e9fa00 = []byte{ - // 528 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0x73, 0x2d, 0x44, 0xea, 0x55, 0x74, 0x38, 0x9a, 0x2a, 0x18, 0x70, 0x8b, 0x55, 0x4a, - 0x88, 0xe0, 0x4e, 0x4d, 0x19, 0x59, 0xa8, 0x10, 0x20, 0x58, 0x4a, 0x46, 0x96, 0xea, 0xec, 0x9c, - 0x1c, 0x8b, 0xd8, 0xe7, 0xfa, 0xce, 0x88, 0x96, 0x8d, 0x89, 0x11, 0x89, 0x19, 0xf1, 0x11, 0x18, - 0xf8, 0x12, 0x1d, 0x2b, 0xb1, 0x30, 0x21, 0x94, 0xf0, 0x41, 0x90, 0xef, 0x2e, 0x71, 0x7c, 0x98, - 0x96, 0x21, 0x5b, 0xe2, 0xf7, 0x7f, 0xef, 0xfd, 0xde, 0xff, 0x3d, 0x1b, 0xb6, 0x02, 0x1e, 0x25, - 0x32, 0xcb, 0x93, 0xd7, 0xe4, 0x28, 0x67, 0xd9, 0x31, 0x4e, 0x33, 0x2e, 0x39, 0xba, 0xe2, 0x9f, - 0x30, 0x3c, 0x0b, 0x39, 0xeb, 0x21, 0x0f, 0xb9, 0x8a, 0x90, 0xe2, 0x97, 0x16, 0x39, 0x37, 0x42, - 0xce, 0xc3, 0x11, 0x23, 0x34, 0x8d, 0x08, 0x4d, 0x12, 0x2e, 0xa9, 0x8c, 0x78, 0x22, 0x4c, 0xb4, - 0x1b, 0x70, 0x11, 0x73, 0x41, 0x7c, 0x2a, 0x98, 0xae, 0x4d, 0xde, 0xec, 0xfa, 0x4c, 0xd2, 0x5d, - 0x92, 0xd2, 0x30, 0x4a, 0x94, 0xd8, 0x68, 0x37, 0x4a, 0x8a, 0x94, 0x66, 0x34, 0x9e, 0xd6, 0xd8, - 0x2c, 0x9f, 0xd3, 0x20, 0x60, 0xa9, 0x64, 0x83, 0xc3, 0x01, 0x8f, 0x69, 0x34, 0x4d, 0xbc, 0x36, - 0x97, 0x98, 0xfb, 0xa3, 0x48, 0x0c, 0x59, 0xa6, 0x43, 0xde, 0x3a, 0x44, 0x2f, 0x8b, 0xae, 0x07, - 0xaa, 0x60, 0x9f, 0x1d, 0xe5, 0x4c, 0x48, 0xef, 0x39, 0xbc, 0x5a, 0x79, 0x2a, 0x52, 0x9e, 0x08, - 0x86, 0xf6, 0x60, 0x53, 0x37, 0x6e, 0x83, 0x2d, 0xd0, 0x59, 0xed, 0xb5, 0x70, 0xc5, 0x00, 0xac, - 0xe5, 0xfb, 0x97, 0x4e, 0x7f, 0x6e, 0x36, 0xfa, 0x46, 0xea, 0x0d, 0xa0, 0xa3, 0x6a, 0x3d, 0x32, - 0x68, 0x8f, 0x15, 0x99, 0xe9, 0x84, 0x9e, 0x40, 0x58, 0xce, 0x69, 0xca, 0xee, 0x60, 0x6d, 0x0a, - 0x2e, 0x4c, 0xc1, 0xda, 0x70, 0x63, 0x0a, 0x3e, 0xa0, 0x21, 0x33, 0xb9, 0xfd, 0xb9, 0x4c, 0xef, - 0x1b, 0x80, 0xd7, 0x6b, 0xdb, 0x18, 0xf4, 0x17, 0x70, 0x8d, 0x56, 0x22, 0x6d, 0xb0, 0xb5, 0xdc, - 0x59, 0xed, 0xdd, 0xb4, 0x46, 0xa8, 0xa6, 0x9b, 0x51, 0xac, 0x54, 0xf4, 0xb4, 0x02, 0xbd, 0xa4, - 0xa0, 0xef, 0x5c, 0x08, 0xad, 0x49, 0x2a, 0xd4, 0x87, 0xb0, 0xa5, 0x7d, 0x9e, 0x6e, 0x65, 0xd1, - 0xb6, 0x7c, 0x01, 0x70, 0xc3, 0xee, 0x60, 0x1c, 0x79, 0x08, 0x57, 0x66, 0xc7, 0x60, 0xcc, 0x68, - 0xdb, 0xfb, 0x9c, 0xc6, 0x8d, 0x0f, 0x65, 0xc2, 0xc2, 0x2c, 0xe8, 0x7d, 0x5d, 0x86, 0x97, 0x15, - 0x21, 0x7a, 0x07, 0x9b, 0xfa, 0x80, 0xd0, 0x2d, 0x8b, 0xe3, 0xef, 0x0b, 0x75, 0xbc, 0xf3, 0x24, - 0xba, 0x8d, 0xd7, 0x7d, 0xff, 0xfd, 0xf7, 0xa7, 0xa5, 0x6d, 0xe4, 0x11, 0xff, 0x84, 0xd1, 0x51, - 0x3a, 0xa4, 0x92, 0xd1, 0xb8, 0xf8, 0x43, 0xec, 0x37, 0x09, 0x7d, 0x06, 0x70, 0xad, 0xba, 0x7b, - 0x74, 0xb7, 0xae, 0x45, 0xed, 0x15, 0x3b, 0xdd, 0xff, 0x91, 0x1a, 0xaa, 0x07, 0x8a, 0x0a, 0xa3, - 0x7b, 0x05, 0xc8, 0xfd, 0x7f, 0x61, 0x59, 0x2f, 0x32, 0xfa, 0x00, 0xe0, 0xca, 0x6c, 0x1d, 0x68, - 0xbb, 0x76, 0x7a, 0xeb, 0x88, 0x9c, 0xdb, 0x17, 0xa8, 0x0c, 0x10, 0x56, 0x40, 0x1d, 0xb4, 0x73, - 0x2e, 0xd0, 0x6c, 0xf5, 0xfb, 0xcf, 0x4e, 0xc7, 0x2e, 0x38, 0x1b, 0xbb, 0xe0, 0xd7, 0xd8, 0x05, - 0x1f, 0x27, 0x6e, 0xe3, 0x6c, 0xe2, 0x36, 0x7e, 0x4c, 0xdc, 0xc6, 0x2b, 0x1c, 0x46, 0x72, 0x98, - 0xfb, 0x38, 0xe0, 0x71, 0x4d, 0xad, 0xb7, 0x73, 0xd5, 0xe4, 0x71, 0xca, 0x84, 0xdf, 0x54, 0xdf, - 0xa0, 0xbd, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x40, 0x3b, 0xc0, 0x8f, 0x5f, 0x05, 0x00, 0x00, + // 598 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4d, 0x6f, 0xd3, 0x4c, + 0x10, 0xc7, 0xb3, 0x7d, 0xda, 0x48, 0x99, 0xea, 0xa9, 0xd0, 0x92, 0x54, 0xc1, 0xb4, 0x6e, 0xb1, + 0x4a, 0x09, 0xa1, 0xac, 0x95, 0xb4, 0x12, 0x17, 0x2e, 0x44, 0x88, 0xd7, 0x4b, 0xc9, 0x11, 0x09, + 0x45, 0xeb, 0x64, 0xe5, 0x58, 0x24, 0x5e, 0x37, 0xde, 0xa0, 0xa6, 0xdc, 0x38, 0x71, 0x44, 0xe2, + 0x8c, 0xb8, 0xf1, 0x05, 0xf8, 0x12, 0x3d, 0x56, 0xe2, 0xd2, 0x13, 0x42, 0x09, 0x1f, 0x04, 0x79, + 0x77, 0xf3, 0x62, 0xe3, 0xa6, 0x41, 0xea, 0xcd, 0xeb, 0x99, 0xff, 0xcc, 0x6f, 0xfe, 0x9e, 0x35, + 0x14, 0x9a, 0xdc, 0xf3, 0x45, 0xaf, 0xef, 0xbf, 0xb5, 0x8f, 0xfa, 0xac, 0x37, 0x20, 0x41, 0x8f, + 0x0b, 0x8e, 0xff, 0x77, 0x4e, 0x18, 0x99, 0x84, 0x8c, 0xbc, 0xcb, 0x5d, 0x2e, 0x23, 0x76, 0xf4, + 0xa4, 0x92, 0x8c, 0x0d, 0x97, 0x73, 0xb7, 0xc3, 0x6c, 0x1a, 0x78, 0x36, 0xf5, 0x7d, 0x2e, 0xa8, + 0xf0, 0xb8, 0x1f, 0xea, 0x68, 0xb9, 0xc9, 0xc3, 0x2e, 0x0f, 0x6d, 0x87, 0x86, 0x4c, 0xd5, 0xb6, + 0xdf, 0x55, 0x1c, 0x26, 0x68, 0xc5, 0x0e, 0xa8, 0xeb, 0xf9, 0x32, 0x59, 0xe7, 0xae, 0x4f, 0x29, + 0x02, 0xda, 0xa3, 0xdd, 0x71, 0x8d, 0xad, 0xe9, 0x7b, 0xda, 0x6c, 0xb2, 0x40, 0xb0, 0x56, 0xa3, + 0xc5, 0xbb, 0xd4, 0x1b, 0x0b, 0x6f, 0xcc, 0x08, 0xfb, 0x4e, 0xc7, 0x0b, 0xdb, 0xac, 0xa7, 0x42, + 0x56, 0x1e, 0xf0, 0xab, 0xa8, 0xeb, 0xa1, 0x2c, 0x58, 0x67, 0x47, 0x7d, 0x16, 0x0a, 0xeb, 0x05, + 0x5c, 0x8f, 0xbd, 0x0d, 0x03, 0xee, 0x87, 0x0c, 0xef, 0x43, 0x56, 0x35, 0x2e, 0xa2, 0x6d, 0x54, + 0x5a, 0xad, 0x16, 0x48, 0xcc, 0x00, 0xa2, 0xd2, 0x6b, 0xcb, 0xa7, 0x3f, 0xb7, 0x32, 0x75, 0x9d, + 0x6a, 0xb5, 0xc0, 0x90, 0xb5, 0x1e, 0x69, 0xb4, 0xc7, 0x92, 0x4c, 0x77, 0xc2, 0x4f, 0x00, 0xa6, + 0x73, 0xea, 0xb2, 0xbb, 0x44, 0x99, 0x42, 0x22, 0x53, 0x88, 0x32, 0x5c, 0x9b, 0x42, 0x0e, 0xa9, + 0xcb, 0xb4, 0xb6, 0x3e, 0xa3, 0xb4, 0xbe, 0x23, 0xb8, 0x99, 0xda, 0x46, 0xa3, 0xbf, 0x84, 0x35, + 0x1a, 0x8b, 0x14, 0xd1, 0xf6, 0x7f, 0xa5, 0xd5, 0xea, 0x66, 0x62, 0x84, 0xb8, 0x5c, 0x8f, 0x92, + 0x90, 0xe2, 0xa7, 0x31, 0xe8, 0x25, 0x09, 0x7d, 0xe7, 0x52, 0x68, 0x45, 0x12, 0xa3, 0x6e, 0x40, + 0x41, 0xf9, 0x3c, 0xfe, 0x2a, 0x57, 0x6d, 0xcb, 0x57, 0x04, 0xeb, 0xc9, 0x0e, 0xda, 0x91, 0x87, + 0x90, 0x9b, 0x2c, 0x83, 0x36, 0xa3, 0x98, 0xfc, 0x9e, 0xe3, 0xb8, 0xf6, 0x61, 0x2a, 0xb8, 0x3a, + 0x0b, 0x0e, 0x60, 0x23, 0x0e, 0x58, 0x1b, 0x3c, 0xf7, 0x5b, 0xec, 0x78, 0xec, 0x44, 0x1e, 0x56, + 0xbc, 0xe8, 0x2c, 0x4d, 0xc8, 0xd5, 0xd5, 0xc1, 0x7a, 0x03, 0x9b, 0x17, 0xa8, 0xd2, 0xa7, 0x43, + 0xff, 0x34, 0x5d, 0xf5, 0x7c, 0x19, 0x56, 0x64, 0x7d, 0xfc, 0x1e, 0xb2, 0x6a, 0xab, 0xf1, 0xad, + 0x84, 0xfc, 0xef, 0x6b, 0x63, 0x58, 0xf3, 0x52, 0x14, 0x98, 0x55, 0xfe, 0xf0, 0xe3, 0xf7, 0xe7, + 0xa5, 0x1d, 0x6c, 0xd9, 0xce, 0x09, 0xa3, 0x9d, 0xa0, 0x4d, 0x05, 0xa3, 0xdd, 0xe8, 0x60, 0x27, + 0xaf, 0x37, 0xfe, 0x82, 0x60, 0x2d, 0xbe, 0x90, 0xf8, 0x6e, 0x5a, 0x8b, 0xd4, 0xab, 0x65, 0x94, + 0x17, 0x49, 0xd5, 0x54, 0x07, 0x92, 0x8a, 0xe0, 0xbd, 0x08, 0xe4, 0xfe, 0x45, 0x58, 0x89, 0xbf, + 0x0b, 0xfe, 0x88, 0x20, 0x37, 0x71, 0x11, 0xef, 0xa4, 0x4e, 0x9f, 0xd8, 0x6c, 0xe3, 0xf6, 0x25, + 0x59, 0x1a, 0x88, 0x48, 0xa0, 0x12, 0xde, 0x9d, 0x0b, 0x34, 0xdd, 0xc7, 0x6f, 0x08, 0xae, 0x25, + 0x97, 0x01, 0xdf, 0x9b, 0xdb, 0x2b, 0xbe, 0x68, 0xc6, 0xde, 0x62, 0xc9, 0x9a, 0xef, 0x81, 0xe4, + 0xab, 0x60, 0x7b, 0x31, 0xbe, 0x86, 0x33, 0x68, 0xc8, 0xcd, 0xad, 0x3d, 0x3b, 0x1d, 0x9a, 0xe8, + 0x6c, 0x68, 0xa2, 0x5f, 0x43, 0x13, 0x7d, 0x1a, 0x99, 0x99, 0xb3, 0x91, 0x99, 0x39, 0x1f, 0x99, + 0x99, 0xd7, 0xc4, 0xf5, 0x44, 0xbb, 0xef, 0x90, 0x26, 0xef, 0xa6, 0x14, 0x3d, 0x9e, 0x29, 0x2b, + 0x06, 0x01, 0x0b, 0x9d, 0xac, 0xfc, 0x83, 0xef, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x1e, 0x28, + 0x40, 0xcd, 0x9d, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -371,6 +466,8 @@ type QueryClient interface { AcceptedDomain(ctx context.Context, in *QueryAcceptedDomainRequest, opts ...grpc.CallOption) (*QueryAcceptedDomainResponse, error) // Queries a list of Publisher items. Publisher(ctx context.Context, in *QueryPublisherRequest, opts ...grpc.CallOption) (*QueryPublisherResponse, error) + // Queries a list of PublisherByIndex items. + PublisherByIndex(ctx context.Context, in *QueryPublisherByIndexRequest, opts ...grpc.CallOption) (*QueryPublisherByIndexResponse, error) } type queryClient struct { @@ -408,6 +505,15 @@ func (c *queryClient) Publisher(ctx context.Context, in *QueryPublisherRequest, return out, nil } +func (c *queryClient) PublisherByIndex(ctx context.Context, in *QueryPublisherByIndexRequest, opts ...grpc.CallOption) (*QueryPublisherByIndexResponse, error) { + out := new(QueryPublisherByIndexResponse) + err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/PublisherByIndex", 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. @@ -416,6 +522,8 @@ type QueryServer interface { AcceptedDomain(context.Context, *QueryAcceptedDomainRequest) (*QueryAcceptedDomainResponse, error) // Queries a list of Publisher items. Publisher(context.Context, *QueryPublisherRequest) (*QueryPublisherResponse, error) + // Queries a list of PublisherByIndex items. + PublisherByIndex(context.Context, *QueryPublisherByIndexRequest) (*QueryPublisherByIndexResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -431,6 +539,9 @@ func (*UnimplementedQueryServer) AcceptedDomain(ctx context.Context, req *QueryA func (*UnimplementedQueryServer) Publisher(ctx context.Context, req *QueryPublisherRequest) (*QueryPublisherResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Publisher not implemented") } +func (*UnimplementedQueryServer) PublisherByIndex(ctx context.Context, req *QueryPublisherByIndexRequest) (*QueryPublisherByIndexResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PublisherByIndex not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -490,6 +601,24 @@ func _Query_Publisher_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Query_PublisherByIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPublisherByIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PublisherByIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bze.cointrunk.Query/PublisherByIndex", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PublisherByIndex(ctx, req.(*QueryPublisherByIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "bze.cointrunk.Query", HandlerType: (*QueryServer)(nil), @@ -506,6 +635,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Publisher", Handler: _Query_Publisher_Handler, }, + { + MethodName: "PublisherByIndex", + Handler: _Query_PublisherByIndex_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cointrunk/query.proto", @@ -735,6 +868,69 @@ func (m *QueryPublisherResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *QueryPublisherByIndexRequest) 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 *QueryPublisherByIndexRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPublisherByIndexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Index) > 0 { + i -= len(m.Index) + copy(dAtA[i:], m.Index) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Index))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryPublisherByIndexResponse) 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 *QueryPublisherByIndexResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPublisherByIndexResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Publisher.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 @@ -830,6 +1026,30 @@ func (m *QueryPublisherResponse) Size() (n int) { return n } +func (m *QueryPublisherByIndexRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Index) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryPublisherByIndexResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Publisher.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1381,6 +1601,171 @@ func (m *QueryPublisherResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryPublisherByIndexRequest) 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: QueryPublisherByIndexRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPublisherByIndexRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + 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 *QueryPublisherByIndexResponse) 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: QueryPublisherByIndexResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPublisherByIndexResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Publisher", 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.Publisher.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/cointrunk/types/query.pb.gw.go b/x/cointrunk/types/query.pb.gw.go index da2a8b45..986f0662 100644 --- a/x/cointrunk/types/query.pb.gw.go +++ b/x/cointrunk/types/query.pb.gw.go @@ -123,6 +123,42 @@ func local_request_Query_Publisher_0(ctx context.Context, marshaler runtime.Mars } +var ( + filter_Query_PublisherByIndex_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_PublisherByIndex_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryPublisherByIndexRequest + 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_PublisherByIndex_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.PublisherByIndex(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_PublisherByIndex_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryPublisherByIndexRequest + 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_PublisherByIndex_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.PublisherByIndex(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. @@ -198,6 +234,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_PublisherByIndex_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_PublisherByIndex_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_PublisherByIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -299,6 +358,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_PublisherByIndex_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_PublisherByIndex_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_PublisherByIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -308,6 +387,8 @@ var ( pattern_Query_AcceptedDomain_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze-alphateam", "bze", "cointrunk", "accepted_domain"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_Publisher_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze-alphateam", "bze", "cointrunk", "publisher"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_PublisherByIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze-alphateam", "bze", "cointrunk", "publisher_by_index"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -316,4 +397,6 @@ var ( forward_Query_AcceptedDomain_0 = runtime.ForwardResponseMessage forward_Query_Publisher_0 = runtime.ForwardResponseMessage + + forward_Query_PublisherByIndex_0 = runtime.ForwardResponseMessage ) From 689a2cf1b3d7f129d3670254670bab637642df16 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 24 Nov 2022 00:30:50 +0200 Subject: [PATCH 09/54] expose cointrunk queries on rest server --- docs/static/openapi.yml | 176 +++++++++--------- proto/cointrunk/query.proto | 10 +- .../bze-alphateam/bze/bze.cointrunk/index.ts | 6 +- .../bze/bze.cointrunk/module/rest.ts | 57 +++--- .../module/types/cointrunk/query.ts | 2 +- .../bze-alphateam/bze/bze.scavenge/index.ts | 40 ++-- .../bze/bze.scavenge/module/index.ts | 6 +- x/cointrunk/module.go | 3 +- x/cointrunk/types/query.pb.go | 82 ++++---- x/cointrunk/types/query.pb.gw.go | 50 +++-- 10 files changed, 223 insertions(+), 209 deletions(-) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 82659711..224126c3 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -4,7 +4,7 @@ info: name: '' description: '' paths: - /bze-alphateam/bze/cointrunk/accepted_domain: + /bze/cointrunk/accepted_domain: get: summary: Queries a list of AcceptedDomain items. operationId: BzeCointrunkAcceptedDomain @@ -127,7 +127,93 @@ paths: type: boolean tags: - Query - /bze-alphateam/bze/cointrunk/publisher: + /bze/cointrunk/params: + get: + summary: Parameters queries the parameters of the module. + operationId: BzeCointrunkParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + anonArticleLimit: + type: string + format: uint64 + anonArticleCost: + 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 + '/bze/cointrunk/publisher/{index}': + get: + summary: Queries publisher by index/address. + operationId: BzeCointrunkPublisherByIndex + responses: + '200': + description: A successful response. + schema: + type: object + properties: + publisher: + type: object + properties: + name: + type: string + address: + type: string + active: + type: boolean + default: + description: An unexpected 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: index + in: path + required: true + type: string + tags: + - Query + /bze/cointrunk/publishers: get: summary: Queries a list of Publisher items. operationId: BzeCointrunkPublisher @@ -252,92 +338,6 @@ paths: type: boolean tags: - Query - /bze-alphateam/bze/cointrunk/publisher_by_index: - get: - summary: Queries a list of PublisherByIndex items. - operationId: BzeCointrunkPublisherByIndex - responses: - '200': - description: A successful response. - schema: - type: object - properties: - publisher: - type: object - properties: - name: - type: string - address: - type: string - active: - type: boolean - default: - description: An unexpected 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: index - in: query - required: false - type: string - tags: - - Query - /bzealphateam/bze/cointrunk/params: - get: - summary: Parameters queries the parameters of the module. - operationId: BzeCointrunkParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - anonArticleLimit: - type: string - format: uint64 - anonArticleCost: - 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 /bze/scavenge/commit: get: summary: Queries a list of commit items. diff --git a/proto/cointrunk/query.proto b/proto/cointrunk/query.proto index 0dceb5e2..acab95de 100644 --- a/proto/cointrunk/query.proto +++ b/proto/cointrunk/query.proto @@ -15,21 +15,21 @@ option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; service Query { // Parameters queries the parameters of the module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/bzealphateam/bze/cointrunk/params"; + option (google.api.http).get = "/bze/cointrunk/params"; } // Queries a list of AcceptedDomain items. rpc AcceptedDomain(QueryAcceptedDomainRequest) returns (QueryAcceptedDomainResponse) { - option (google.api.http).get = "/bze-alphateam/bze/cointrunk/accepted_domain"; + option (google.api.http).get = "/bze/cointrunk/accepted_domain"; } // Queries a list of Publisher items. rpc Publisher(QueryPublisherRequest) returns (QueryPublisherResponse) { - option (google.api.http).get = "/bze-alphateam/bze/cointrunk/publisher"; + option (google.api.http).get = "/bze/cointrunk/publishers"; } -// Queries a list of PublisherByIndex items. +// Queries publisher by index/address. rpc PublisherByIndex(QueryPublisherByIndexRequest) returns (QueryPublisherByIndexResponse) { - option (google.api.http).get = "/bze-alphateam/bze/cointrunk/publisher_by_index"; + option (google.api.http).get = "/bze/cointrunk/publisher/{index}"; } // this line is used by starport scaffolding # 2 diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts index 8acd5088..f8f209ea 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts @@ -225,13 +225,9 @@ export default { try { const key = params ?? {}; const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryPublisherByIndex(query)).data + let value= (await queryClient.queryPublisherByIndex( key.index)).data - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryPublisherByIndex({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } commit('QUERY', { query: 'PublisherByIndex', key: { params: {...key}, query}, value }) if (subscribe) commit('SUBSCRIBE', { action: 'QueryPublisherByIndex', payload: { options: { all }, params: {...key},query }}) return getters['getPublisherByIndex']( { params: {...key}, query}) ?? {} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts index 108a3a10..b96f187f 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts @@ -347,7 +347,7 @@ export class Api extends HttpClient extends HttpClient this.request({ - path: `/bze-alphateam/bze/cointrunk/accepted_domain`, + path: `/bze/cointrunk/accepted_domain`, method: "GET", query: query, format: "json", @@ -371,24 +371,14 @@ export class Api extends HttpClient - this.request({ - path: `/bze-alphateam/bze/cointrunk/publisher`, + queryParams = (params: RequestParams = {}) => + this.request({ + path: `/bze/cointrunk/params`, method: "GET", - query: query, format: "json", ...params, }); @@ -398,14 +388,13 @@ export class Api extends HttpClient + queryPublisherByIndex = (index: string, params: RequestParams = {}) => this.request({ - path: `/bze-alphateam/bze/cointrunk/publisher_by_index`, + path: `/bze/cointrunk/publisher/${index}`, method: "GET", - query: query, format: "json", ...params, }); @@ -414,14 +403,24 @@ export class Api extends HttpClient - this.request({ - path: `/bzealphateam/bze/cointrunk/params`, + queryPublisher = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/bze/cointrunk/publishers`, method: "GET", + query: query, format: "json", ...params, }); diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts index 8fdab431..f2300da8 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts @@ -623,7 +623,7 @@ export interface Query { ): Promise; /** Queries a list of Publisher items. */ Publisher(request: QueryPublisherRequest): Promise; - /** Queries a list of PublisherByIndex items. */ + /** Queries publisher by index/address. */ PublisherByIndex( request: QueryPublisherByIndexRequest ): Promise; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 36486b56..474b327f 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,6 +232,21 @@ export default { }, + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgRevealSolution(value) + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + }else{ + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + } + } + }, async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -262,22 +277,20 @@ export default { } } }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) const msg = await txClient.msgRevealSolution(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result + return msg } catch (e) { if (e == MissingWalletError) { throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + } else{ + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) @@ -304,19 +317,6 @@ export default { } } }, - async MsgRevealSolution({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) - } - } - }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 27b7f752..5f72a96b 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; +import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; -import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/module.go b/x/cointrunk/module.go index f6afd898..1b21392e 100644 --- a/x/cointrunk/module.go +++ b/x/cointrunk/module.go @@ -1,6 +1,7 @@ package cointrunk import ( + "context" "encoding/json" "fmt" // this line is used by starport scaffolding # 1 @@ -77,7 +78,7 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - // this line is used by starport scaffolding # 2 + types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } // GetTxCmd returns the capability module's root tx command. diff --git a/x/cointrunk/types/query.pb.go b/x/cointrunk/types/query.pb.go index 875b2897..9f8b8ec0 100644 --- a/x/cointrunk/types/query.pb.go +++ b/x/cointrunk/types/query.pb.go @@ -407,45 +407,45 @@ func init() { func init() { proto.RegisterFile("cointrunk/query.proto", fileDescriptor_12b6eb50b0e9fa00) } var fileDescriptor_12b6eb50b0e9fa00 = []byte{ - // 598 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4d, 0x6f, 0xd3, 0x4c, - 0x10, 0xc7, 0xb3, 0x7d, 0xda, 0x48, 0x99, 0xea, 0xa9, 0xd0, 0x92, 0x54, 0xc1, 0xb4, 0x6e, 0xb1, - 0x4a, 0x09, 0xa1, 0xac, 0x95, 0xb4, 0x12, 0x17, 0x2e, 0x44, 0x88, 0xd7, 0x4b, 0xc9, 0x11, 0x09, - 0x45, 0xeb, 0x64, 0xe5, 0x58, 0x24, 0x5e, 0x37, 0xde, 0xa0, 0xa6, 0xdc, 0x38, 0x71, 0x44, 0xe2, - 0x8c, 0xb8, 0xf1, 0x05, 0xf8, 0x12, 0x3d, 0x56, 0xe2, 0xd2, 0x13, 0x42, 0x09, 0x1f, 0x04, 0x79, - 0x77, 0xf3, 0x62, 0xe3, 0xa6, 0x41, 0xea, 0xcd, 0xeb, 0x99, 0xff, 0xcc, 0x6f, 0xfe, 0x9e, 0x35, - 0x14, 0x9a, 0xdc, 0xf3, 0x45, 0xaf, 0xef, 0xbf, 0xb5, 0x8f, 0xfa, 0xac, 0x37, 0x20, 0x41, 0x8f, - 0x0b, 0x8e, 0xff, 0x77, 0x4e, 0x18, 0x99, 0x84, 0x8c, 0xbc, 0xcb, 0x5d, 0x2e, 0x23, 0x76, 0xf4, - 0xa4, 0x92, 0x8c, 0x0d, 0x97, 0x73, 0xb7, 0xc3, 0x6c, 0x1a, 0x78, 0x36, 0xf5, 0x7d, 0x2e, 0xa8, - 0xf0, 0xb8, 0x1f, 0xea, 0x68, 0xb9, 0xc9, 0xc3, 0x2e, 0x0f, 0x6d, 0x87, 0x86, 0x4c, 0xd5, 0xb6, - 0xdf, 0x55, 0x1c, 0x26, 0x68, 0xc5, 0x0e, 0xa8, 0xeb, 0xf9, 0x32, 0x59, 0xe7, 0xae, 0x4f, 0x29, - 0x02, 0xda, 0xa3, 0xdd, 0x71, 0x8d, 0xad, 0xe9, 0x7b, 0xda, 0x6c, 0xb2, 0x40, 0xb0, 0x56, 0xa3, - 0xc5, 0xbb, 0xd4, 0x1b, 0x0b, 0x6f, 0xcc, 0x08, 0xfb, 0x4e, 0xc7, 0x0b, 0xdb, 0xac, 0xa7, 0x42, - 0x56, 0x1e, 0xf0, 0xab, 0xa8, 0xeb, 0xa1, 0x2c, 0x58, 0x67, 0x47, 0x7d, 0x16, 0x0a, 0xeb, 0x05, - 0x5c, 0x8f, 0xbd, 0x0d, 0x03, 0xee, 0x87, 0x0c, 0xef, 0x43, 0x56, 0x35, 0x2e, 0xa2, 0x6d, 0x54, - 0x5a, 0xad, 0x16, 0x48, 0xcc, 0x00, 0xa2, 0xd2, 0x6b, 0xcb, 0xa7, 0x3f, 0xb7, 0x32, 0x75, 0x9d, - 0x6a, 0xb5, 0xc0, 0x90, 0xb5, 0x1e, 0x69, 0xb4, 0xc7, 0x92, 0x4c, 0x77, 0xc2, 0x4f, 0x00, 0xa6, - 0x73, 0xea, 0xb2, 0xbb, 0x44, 0x99, 0x42, 0x22, 0x53, 0x88, 0x32, 0x5c, 0x9b, 0x42, 0x0e, 0xa9, - 0xcb, 0xb4, 0xb6, 0x3e, 0xa3, 0xb4, 0xbe, 0x23, 0xb8, 0x99, 0xda, 0x46, 0xa3, 0xbf, 0x84, 0x35, - 0x1a, 0x8b, 0x14, 0xd1, 0xf6, 0x7f, 0xa5, 0xd5, 0xea, 0x66, 0x62, 0x84, 0xb8, 0x5c, 0x8f, 0x92, - 0x90, 0xe2, 0xa7, 0x31, 0xe8, 0x25, 0x09, 0x7d, 0xe7, 0x52, 0x68, 0x45, 0x12, 0xa3, 0x6e, 0x40, - 0x41, 0xf9, 0x3c, 0xfe, 0x2a, 0x57, 0x6d, 0xcb, 0x57, 0x04, 0xeb, 0xc9, 0x0e, 0xda, 0x91, 0x87, - 0x90, 0x9b, 0x2c, 0x83, 0x36, 0xa3, 0x98, 0xfc, 0x9e, 0xe3, 0xb8, 0xf6, 0x61, 0x2a, 0xb8, 0x3a, - 0x0b, 0x0e, 0x60, 0x23, 0x0e, 0x58, 0x1b, 0x3c, 0xf7, 0x5b, 0xec, 0x78, 0xec, 0x44, 0x1e, 0x56, - 0xbc, 0xe8, 0x2c, 0x4d, 0xc8, 0xd5, 0xd5, 0xc1, 0x7a, 0x03, 0x9b, 0x17, 0xa8, 0xd2, 0xa7, 0x43, - 0xff, 0x34, 0x5d, 0xf5, 0x7c, 0x19, 0x56, 0x64, 0x7d, 0xfc, 0x1e, 0xb2, 0x6a, 0xab, 0xf1, 0xad, - 0x84, 0xfc, 0xef, 0x6b, 0x63, 0x58, 0xf3, 0x52, 0x14, 0x98, 0x55, 0xfe, 0xf0, 0xe3, 0xf7, 0xe7, - 0xa5, 0x1d, 0x6c, 0xd9, 0xce, 0x09, 0xa3, 0x9d, 0xa0, 0x4d, 0x05, 0xa3, 0xdd, 0xe8, 0x60, 0x27, - 0xaf, 0x37, 0xfe, 0x82, 0x60, 0x2d, 0xbe, 0x90, 0xf8, 0x6e, 0x5a, 0x8b, 0xd4, 0xab, 0x65, 0x94, - 0x17, 0x49, 0xd5, 0x54, 0x07, 0x92, 0x8a, 0xe0, 0xbd, 0x08, 0xe4, 0xfe, 0x45, 0x58, 0x89, 0xbf, - 0x0b, 0xfe, 0x88, 0x20, 0x37, 0x71, 0x11, 0xef, 0xa4, 0x4e, 0x9f, 0xd8, 0x6c, 0xe3, 0xf6, 0x25, - 0x59, 0x1a, 0x88, 0x48, 0xa0, 0x12, 0xde, 0x9d, 0x0b, 0x34, 0xdd, 0xc7, 0x6f, 0x08, 0xae, 0x25, - 0x97, 0x01, 0xdf, 0x9b, 0xdb, 0x2b, 0xbe, 0x68, 0xc6, 0xde, 0x62, 0xc9, 0x9a, 0xef, 0x81, 0xe4, - 0xab, 0x60, 0x7b, 0x31, 0xbe, 0x86, 0x33, 0x68, 0xc8, 0xcd, 0xad, 0x3d, 0x3b, 0x1d, 0x9a, 0xe8, - 0x6c, 0x68, 0xa2, 0x5f, 0x43, 0x13, 0x7d, 0x1a, 0x99, 0x99, 0xb3, 0x91, 0x99, 0x39, 0x1f, 0x99, - 0x99, 0xd7, 0xc4, 0xf5, 0x44, 0xbb, 0xef, 0x90, 0x26, 0xef, 0xa6, 0x14, 0x3d, 0x9e, 0x29, 0x2b, - 0x06, 0x01, 0x0b, 0x9d, 0xac, 0xfc, 0x83, 0xef, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x1e, 0x28, - 0x40, 0xcd, 0x9d, 0x06, 0x00, 0x00, + // 593 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xcd, 0x6e, 0x13, 0x31, + 0x10, 0xc7, 0xe3, 0xd2, 0x46, 0xca, 0x54, 0x54, 0xc8, 0x24, 0x25, 0xdd, 0x36, 0xdb, 0x74, 0x05, + 0x25, 0x14, 0x58, 0xab, 0x29, 0x47, 0x2e, 0x44, 0x88, 0xcf, 0x4b, 0xc9, 0x11, 0x09, 0x55, 0xde, + 0xc4, 0xda, 0xac, 0x48, 0xd6, 0xdb, 0xac, 0x83, 0x9a, 0x56, 0x5c, 0x78, 0x01, 0x90, 0x38, 0x70, + 0x84, 0x77, 0xe0, 0x25, 0x7a, 0xac, 0xc4, 0x85, 0x13, 0x42, 0x09, 0x0f, 0x82, 0x62, 0x7b, 0x93, + 0xac, 0x49, 0x3f, 0x90, 0x7a, 0x8b, 0x33, 0x33, 0xff, 0xf9, 0xcd, 0xdf, 0xe3, 0x85, 0x42, 0x83, + 0x07, 0xa1, 0xe8, 0xf6, 0xc2, 0xb7, 0x64, 0xbf, 0xc7, 0xba, 0x7d, 0x37, 0xea, 0x72, 0xc1, 0xf1, + 0x55, 0xef, 0x90, 0xb9, 0xe3, 0x90, 0x95, 0xf7, 0xb9, 0xcf, 0x65, 0x84, 0x8c, 0x7e, 0xa9, 0x24, + 0x6b, 0xcd, 0xe7, 0xdc, 0x6f, 0x33, 0x42, 0xa3, 0x80, 0xd0, 0x30, 0xe4, 0x82, 0x8a, 0x80, 0x87, + 0xb1, 0x8e, 0x6e, 0x35, 0x78, 0xdc, 0xe1, 0x31, 0xf1, 0x68, 0xcc, 0x94, 0x36, 0x79, 0xb7, 0xed, + 0x31, 0x41, 0xb7, 0x49, 0x44, 0xfd, 0x20, 0x94, 0xc9, 0x3a, 0x77, 0x79, 0x42, 0x11, 0xd1, 0x2e, + 0xed, 0x24, 0x1a, 0xeb, 0x93, 0xff, 0x69, 0xa3, 0xc1, 0x22, 0xc1, 0x9a, 0x7b, 0x4d, 0xde, 0xa1, + 0x41, 0x52, 0xb8, 0x32, 0x55, 0xd8, 0xf3, 0xda, 0x41, 0xdc, 0x62, 0x5d, 0x15, 0x72, 0xf2, 0x80, + 0x5f, 0x8d, 0xba, 0xee, 0x4a, 0xc1, 0x3a, 0xdb, 0xef, 0xb1, 0x58, 0x38, 0x2f, 0xe0, 0x7a, 0xea, + 0xdf, 0x38, 0xe2, 0x61, 0xcc, 0xf0, 0x0e, 0x64, 0x55, 0xe3, 0x22, 0x2a, 0xa3, 0xca, 0x62, 0xb5, + 0xe0, 0xa6, 0x0c, 0x70, 0x55, 0x7a, 0x6d, 0xfe, 0xf8, 0xd7, 0x7a, 0xa6, 0xae, 0x53, 0x9d, 0x26, + 0x58, 0x52, 0xeb, 0x91, 0x46, 0x7b, 0x2c, 0xc9, 0x74, 0x27, 0xfc, 0x04, 0x60, 0x32, 0xa7, 0x96, + 0xdd, 0x74, 0x95, 0x29, 0xee, 0xc8, 0x14, 0x57, 0x19, 0xae, 0x4d, 0x71, 0x77, 0xa9, 0xcf, 0x74, + 0x6d, 0x7d, 0xaa, 0xd2, 0xf9, 0x8e, 0x60, 0x75, 0x66, 0x1b, 0x8d, 0xfe, 0x12, 0x96, 0x68, 0x2a, + 0x52, 0x44, 0xe5, 0x2b, 0x95, 0xc5, 0x6a, 0xc9, 0x18, 0x21, 0x5d, 0xae, 0x47, 0x31, 0x4a, 0xf1, + 0xd3, 0x14, 0xf4, 0x9c, 0x84, 0xbe, 0x7d, 0x2e, 0xb4, 0x22, 0x49, 0x51, 0xef, 0x41, 0x41, 0xf9, + 0x9c, 0xdc, 0xca, 0x65, 0xdb, 0xf2, 0x15, 0xc1, 0xb2, 0xd9, 0x41, 0x3b, 0xf2, 0x10, 0x72, 0xe3, + 0x65, 0xd0, 0x66, 0x14, 0xcd, 0xfb, 0x4c, 0xe2, 0xda, 0x87, 0x49, 0xc1, 0xe5, 0x59, 0xf0, 0x00, + 0xd6, 0xd2, 0x80, 0xb5, 0xfe, 0xf3, 0xb0, 0xc9, 0x0e, 0x12, 0x27, 0xf2, 0xb0, 0x10, 0x8c, 0xce, + 0xd2, 0x84, 0x5c, 0x5d, 0x1d, 0x9c, 0x37, 0x50, 0x3a, 0xa5, 0x6a, 0xf6, 0x74, 0xe8, 0xbf, 0xa6, + 0xab, 0x7e, 0x9b, 0x87, 0x05, 0xa9, 0x8f, 0x43, 0xc8, 0xaa, 0xad, 0xc6, 0x1b, 0x46, 0xf9, 0xbf, + 0xcf, 0xc6, 0x72, 0xce, 0x4a, 0x51, 0x60, 0x4e, 0xe9, 0xc3, 0x8f, 0x3f, 0x9f, 0xe7, 0x6e, 0xe0, + 0x02, 0xf1, 0x0e, 0x19, 0x31, 0x5f, 0x34, 0xfe, 0x88, 0x60, 0x29, 0xbd, 0x83, 0xf8, 0xce, 0x2c, + 0xd5, 0x99, 0xaf, 0xc9, 0xda, 0xba, 0x48, 0xaa, 0x06, 0xd9, 0x94, 0x20, 0x65, 0x6c, 0x1b, 0x20, + 0xc6, 0x27, 0x04, 0x1f, 0x41, 0x6e, 0xec, 0x14, 0xbe, 0x39, 0x73, 0x42, 0x63, 0x7b, 0xad, 0x5b, + 0xe7, 0x64, 0x69, 0x82, 0x0d, 0x49, 0xb0, 0x8a, 0x57, 0x4c, 0x2b, 0x92, 0xcc, 0x18, 0x7f, 0x41, + 0x70, 0xcd, 0xbc, 0x63, 0x7c, 0xf7, 0x4c, 0xf9, 0xf4, 0xfe, 0x58, 0xf7, 0x2e, 0x96, 0xac, 0x91, + 0x2a, 0x12, 0xc9, 0xc1, 0xe5, 0xd3, 0x90, 0xc8, 0x91, 0x5c, 0xc0, 0xf7, 0xb5, 0x67, 0xc7, 0x03, + 0x1b, 0x9d, 0x0c, 0x6c, 0xf4, 0x7b, 0x60, 0xa3, 0x4f, 0x43, 0x3b, 0x73, 0x32, 0xb4, 0x33, 0x3f, + 0x87, 0x76, 0xe6, 0xb5, 0xeb, 0x07, 0xa2, 0xd5, 0xf3, 0xdc, 0x06, 0xef, 0x8c, 0x54, 0xee, 0xd3, + 0x76, 0xd4, 0xa2, 0x82, 0x51, 0x79, 0x22, 0x07, 0x53, 0xaa, 0xa2, 0x1f, 0xb1, 0xd8, 0xcb, 0xca, + 0x2f, 0xf1, 0xce, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe8, 0xfc, 0xfe, 0xf5, 0x65, 0x06, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -466,7 +466,7 @@ type QueryClient interface { AcceptedDomain(ctx context.Context, in *QueryAcceptedDomainRequest, opts ...grpc.CallOption) (*QueryAcceptedDomainResponse, error) // Queries a list of Publisher items. Publisher(ctx context.Context, in *QueryPublisherRequest, opts ...grpc.CallOption) (*QueryPublisherResponse, error) - // Queries a list of PublisherByIndex items. + // Queries publisher by index/address. PublisherByIndex(ctx context.Context, in *QueryPublisherByIndexRequest, opts ...grpc.CallOption) (*QueryPublisherByIndexResponse, error) } @@ -522,7 +522,7 @@ type QueryServer interface { AcceptedDomain(context.Context, *QueryAcceptedDomainRequest) (*QueryAcceptedDomainResponse, error) // Queries a list of Publisher items. Publisher(context.Context, *QueryPublisherRequest) (*QueryPublisherResponse, error) - // Queries a list of PublisherByIndex items. + // Queries publisher by index/address. PublisherByIndex(context.Context, *QueryPublisherByIndexRequest) (*QueryPublisherByIndexResponse, error) } diff --git a/x/cointrunk/types/query.pb.gw.go b/x/cointrunk/types/query.pb.gw.go index 986f0662..7e7790c2 100644 --- a/x/cointrunk/types/query.pb.gw.go +++ b/x/cointrunk/types/query.pb.gw.go @@ -123,19 +123,26 @@ func local_request_Query_Publisher_0(ctx context.Context, marshaler runtime.Mars } -var ( - filter_Query_PublisherByIndex_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - func request_Query_PublisherByIndex_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryPublisherByIndexRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["index"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_PublisherByIndex_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + + protoReq.Index, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) } msg, err := client.PublisherByIndex(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -147,11 +154,22 @@ func local_request_Query_PublisherByIndex_0(ctx context.Context, marshaler runti var protoReq QueryPublisherByIndexRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["index"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_PublisherByIndex_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + + protoReq.Index, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) } msg, err := server.PublisherByIndex(ctx, &protoReq) @@ -382,13 +400,13 @@ 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{"bzealphateam", "bze", "cointrunk", "params"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "params"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_AcceptedDomain_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze-alphateam", "bze", "cointrunk", "accepted_domain"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_AcceptedDomain_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "accepted_domain"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_Publisher_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze-alphateam", "bze", "cointrunk", "publisher"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_Publisher_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "publishers"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_PublisherByIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze-alphateam", "bze", "cointrunk", "publisher_by_index"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_PublisherByIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"bze", "cointrunk", "publisher", "index"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( From 0f962f5cd06a18574e3782be79c99f4c9920b4b9 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 24 Nov 2022 02:46:29 +0200 Subject: [PATCH 10/54] added article submit --- docs/static/openapi.yml | 2 + go.mod | 1 + go.sum | 1 + proto/cointrunk/article.proto | 13 + proto/cointrunk/tx.proto | 13 +- .../bze-alphateam/bze/bze.cointrunk/index.ts | 32 +- .../bze/bze.cointrunk/module/index.ts | 3 + .../bze/bze.cointrunk/module/rest.ts | 2 + .../module/types/cointrunk/article.ts | 152 +++++ .../module/types/cointrunk/tx.ts | 183 +++++- .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +- .../bze/bze.scavenge/module/index.ts | 12 +- x/cointrunk/client/cli/tx.go | 1 + x/cointrunk/client/cli/tx_add_article.go | 53 ++ x/cointrunk/handler.go | 7 +- x/cointrunk/keeper/cointrunk.go | 43 ++ x/cointrunk/keeper/msg_server_add_article.go | 51 ++ x/cointrunk/module_simulation.go | 17 +- x/cointrunk/simulation/add_article.go | 29 + x/cointrunk/types/article.pb.go | 512 +++++++++++++++ x/cointrunk/types/codec.go | 6 +- x/cointrunk/types/expected_keepers.go | 2 + x/cointrunk/types/key_article.go | 34 + x/cointrunk/types/message_add_article.go | 48 ++ x/cointrunk/types/message_add_article_test.go | 40 ++ x/cointrunk/types/tx.pb.go | 617 +++++++++++++++++- 26 files changed, 1867 insertions(+), 39 deletions(-) create mode 100644 proto/cointrunk/article.proto create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/article.ts create mode 100644 x/cointrunk/client/cli/tx_add_article.go create mode 100644 x/cointrunk/keeper/msg_server_add_article.go create mode 100644 x/cointrunk/simulation/add_article.go create mode 100644 x/cointrunk/types/article.pb.go create mode 100644 x/cointrunk/types/key_article.go create mode 100644 x/cointrunk/types/message_add_article.go create mode 100644 x/cointrunk/types/message_add_article_test.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 224126c3..99ced40e 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -30345,6 +30345,8 @@ definitions: type: string active: type: boolean + bze.cointrunk.MsgAddArticleResponse: + type: object bze.cointrunk.Params: type: object properties: diff --git a/go.mod b/go.mod index a4f4b4cb..a64a0280 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.19 require ( github.com/cosmos/cosmos-sdk v0.45.10 github.com/cosmos/ibc-go/v2 v2.4.2 + github.com/gobuffalo/packr/v2 v2.7.1 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 github.com/gorilla/mux v1.8.0 diff --git a/go.sum b/go.sum index 4be8112d..b16e9ff0 100644 --- a/go.sum +++ b/go.sum @@ -603,6 +603,7 @@ github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PL github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/gobuffalo/logger v1.0.3/go.mod h1:SoeejUwldiS7ZsyCBphOGURmWdwUFXs0J7TCjEhjKxM= github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= +github.com/gobuffalo/packr/v2 v2.7.1 h1:n3CIW5T17T8v4GGK5sWXLVWJhCz7b5aNLSxW6gYim4o= github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= github.com/gobuffalo/plush v3.8.3+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= github.com/gobuffalo/plushgen v0.1.2/go.mod h1:3U71v6HWZpVER1nInTXeAwdoRNsRd4W8aeIa1Lyp+Bk= diff --git a/proto/cointrunk/article.proto b/proto/cointrunk/article.proto new file mode 100644 index 00000000..a99b9761 --- /dev/null +++ b/proto/cointrunk/article.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package bze.cointrunk; + +option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; + +message Article { + + string title = 1; + string url = 2; + string picture = 3; + string publisher = 4; + bool paid = 5; +} \ No newline at end of file diff --git a/proto/cointrunk/tx.proto b/proto/cointrunk/tx.proto index e1100ad1..5d28f4e1 100644 --- a/proto/cointrunk/tx.proto +++ b/proto/cointrunk/tx.proto @@ -7,7 +7,18 @@ option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; // Msg defines the Msg service. service Msg { - // this line is used by starport scaffolding # proto/tx/rpc + rpc AddArticle(MsgAddArticle) returns (MsgAddArticleResponse); +// this line is used by starport scaffolding # proto/tx/rpc +} + +message MsgAddArticle { + string publisher = 1; + string title = 2; + string url = 3; + string picture = 4; +} + +message MsgAddArticleResponse { } // this line is used by starport scaffolding # proto/tx/message \ No newline at end of file diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts index f8f209ea..11493e9c 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts @@ -2,12 +2,13 @@ import { txClient, queryClient, MissingWalletError , registry} from './module' import { AcceptedDomain } from "./module/types/cointrunk/accepted_domain" import { AcceptedDomainProposal } from "./module/types/cointrunk/accepted_domain_proposal" +import { Article } from "./module/types/cointrunk/article" import { Params } from "./module/types/cointrunk/params" import { Publisher } from "./module/types/cointrunk/publisher" import { PublisherProposal } from "./module/types/cointrunk/publisher_proposal" -export { AcceptedDomain, AcceptedDomainProposal, Params, Publisher, PublisherProposal }; +export { AcceptedDomain, AcceptedDomainProposal, Article, Params, Publisher, PublisherProposal }; async function initTxClient(vuexGetters) { return await txClient(vuexGetters['common/wallet/signer'], { @@ -53,6 +54,7 @@ const getDefaultState = () => { _Structure: { AcceptedDomain: getStructure(AcceptedDomain.fromPartial({})), AcceptedDomainProposal: getStructure(AcceptedDomainProposal.fromPartial({})), + Article: getStructure(Article.fromPartial({})), Params: getStructure(Params.fromPartial({})), Publisher: getStructure(Publisher.fromPartial({})), PublisherProposal: getStructure(PublisherProposal.fromPartial({})), @@ -238,7 +240,35 @@ export default { }, + async sendMsgAddArticle({ rootGetters }, { value, fee = [], memo = '' }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgAddArticle(value) + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') + }else{ + throw new Error('TxClient:MsgAddArticle:Send Could not broadcast Tx: '+ e.message) + } + } + }, + async MsgAddArticle({ rootGetters }, { value }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgAddArticle(value) + return msg + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') + } else{ + throw new Error('TxClient:MsgAddArticle:Create Could not create message: ' + e.message) + } + } + }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/index.ts index 67d4b093..f954a42c 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/index.ts @@ -4,9 +4,11 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; +import { MsgAddArticle } from "./types/cointrunk/tx"; const types = [ + ["/bze.cointrunk.MsgAddArticle", MsgAddArticle], ]; export const MissingWalletError = new Error("wallet is required"); @@ -39,6 +41,7 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + msgAddArticle: (data: MsgAddArticle): EncodeObject => ({ typeUrl: "/bze.cointrunk.MsgAddArticle", value: MsgAddArticle.fromPartial( data ) }), }; }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts index b96f187f..2087ab18 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts @@ -14,6 +14,8 @@ export interface CointrunkAcceptedDomain { active?: boolean; } +export type CointrunkMsgAddArticleResponse = object; + /** * Params defines the parameters for the module. */ diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/article.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/article.ts new file mode 100644 index 00000000..27538e17 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/article.ts @@ -0,0 +1,152 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk"; + +export interface Article { + title: string; + url: string; + picture: string; + publisher: string; + paid: boolean; +} + +const baseArticle: object = { + title: "", + url: "", + picture: "", + publisher: "", + paid: false, +}; + +export const Article = { + encode(message: Article, writer: Writer = Writer.create()): Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.url !== "") { + writer.uint32(18).string(message.url); + } + if (message.picture !== "") { + writer.uint32(26).string(message.picture); + } + if (message.publisher !== "") { + writer.uint32(34).string(message.publisher); + } + if (message.paid === true) { + writer.uint32(40).bool(message.paid); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Article { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseArticle } as Article; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.url = reader.string(); + break; + case 3: + message.picture = reader.string(); + break; + case 4: + message.publisher = reader.string(); + break; + case 5: + message.paid = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Article { + const message = { ...baseArticle } as Article; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = String(object.url); + } else { + message.url = ""; + } + if (object.picture !== undefined && object.picture !== null) { + message.picture = String(object.picture); + } else { + message.picture = ""; + } + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = String(object.publisher); + } else { + message.publisher = ""; + } + if (object.paid !== undefined && object.paid !== null) { + message.paid = Boolean(object.paid); + } else { + message.paid = false; + } + return message; + }, + + toJSON(message: Article): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.url !== undefined && (obj.url = message.url); + message.picture !== undefined && (obj.picture = message.picture); + message.publisher !== undefined && (obj.publisher = message.publisher); + message.paid !== undefined && (obj.paid = message.paid); + return obj; + }, + + fromPartial(object: DeepPartial
): Article { + const message = { ...baseArticle } as Article; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = object.url; + } else { + message.url = ""; + } + if (object.picture !== undefined && object.picture !== null) { + message.picture = object.picture; + } else { + message.picture = ""; + } + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = object.publisher; + } else { + message.publisher = ""; + } + if (object.paid !== undefined && object.paid !== null) { + message.paid = object.paid; + } else { + message.paid = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/tx.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/tx.ts index aa7e3e92..a0fab7da 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/tx.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/tx.ts @@ -1,14 +1,184 @@ /* eslint-disable */ +import { Reader, Writer } from "protobufjs/minimal"; + export const protobufPackage = "bze.cointrunk"; +export interface MsgAddArticle { + publisher: string; + title: string; + url: string; + picture: string; +} + +export interface MsgAddArticleResponse {} + +const baseMsgAddArticle: object = { + publisher: "", + title: "", + url: "", + picture: "", +}; + +export const MsgAddArticle = { + encode(message: MsgAddArticle, writer: Writer = Writer.create()): Writer { + if (message.publisher !== "") { + writer.uint32(10).string(message.publisher); + } + if (message.title !== "") { + writer.uint32(18).string(message.title); + } + if (message.url !== "") { + writer.uint32(26).string(message.url); + } + if (message.picture !== "") { + writer.uint32(34).string(message.picture); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MsgAddArticle { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgAddArticle } as MsgAddArticle; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publisher = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.url = reader.string(); + break; + case 4: + message.picture = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgAddArticle { + const message = { ...baseMsgAddArticle } as MsgAddArticle; + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = String(object.publisher); + } else { + message.publisher = ""; + } + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = String(object.url); + } else { + message.url = ""; + } + if (object.picture !== undefined && object.picture !== null) { + message.picture = String(object.picture); + } else { + message.picture = ""; + } + return message; + }, + + toJSON(message: MsgAddArticle): unknown { + const obj: any = {}; + message.publisher !== undefined && (obj.publisher = message.publisher); + message.title !== undefined && (obj.title = message.title); + message.url !== undefined && (obj.url = message.url); + message.picture !== undefined && (obj.picture = message.picture); + return obj; + }, + + fromPartial(object: DeepPartial): MsgAddArticle { + const message = { ...baseMsgAddArticle } as MsgAddArticle; + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = object.publisher; + } else { + message.publisher = ""; + } + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = object.url; + } else { + message.url = ""; + } + if (object.picture !== undefined && object.picture !== null) { + message.picture = object.picture; + } else { + message.picture = ""; + } + return message; + }, +}; + +const baseMsgAddArticleResponse: object = {}; + +export const MsgAddArticleResponse = { + encode(_: MsgAddArticleResponse, writer: Writer = Writer.create()): Writer { + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MsgAddArticleResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgAddArticleResponse } as MsgAddArticleResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgAddArticleResponse { + const message = { ...baseMsgAddArticleResponse } as MsgAddArticleResponse; + return message; + }, + + toJSON(_: MsgAddArticleResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgAddArticleResponse { + const message = { ...baseMsgAddArticleResponse } as MsgAddArticleResponse; + return message; + }, +}; + /** Msg defines the Msg service. */ -export interface Msg {} +export interface Msg { + /** this line is used by starport scaffolding # proto/tx/rpc */ + AddArticle(request: MsgAddArticle): Promise; +} export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; } + AddArticle(request: MsgAddArticle): Promise { + const data = MsgAddArticle.encode(request).finish(); + const promise = this.rpc.request("bze.cointrunk.Msg", "AddArticle", data); + return promise.then((data) => + MsgAddArticleResponse.decode(new Reader(data)) + ); + } } interface Rpc { @@ -18,3 +188,14 @@ interface Rpc { data: Uint8Array ): Promise; } + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 474b327f..40cc1ba4 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,18 +232,18 @@ export default { }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -262,32 +262,32 @@ export default { } } }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgRevealSolution({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, @@ -304,16 +304,16 @@ export default { } } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 5f72a96b..c023b54d 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgRevealSolution } from "./types/scavenge/tx"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; +import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/client/cli/tx.go b/x/cointrunk/client/cli/tx.go index 2c84e346..8afc917c 100644 --- a/x/cointrunk/client/cli/tx.go +++ b/x/cointrunk/client/cli/tx.go @@ -35,6 +35,7 @@ func GetTxCmd() *cobra.Command { RunE: client.ValidateCmd, } + cmd.AddCommand(CmdAddArticle()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/cointrunk/client/cli/tx_add_article.go b/x/cointrunk/client/cli/tx_add_article.go new file mode 100644 index 00000000..fc5765da --- /dev/null +++ b/x/cointrunk/client/cli/tx_add_article.go @@ -0,0 +1,53 @@ +package cli + +import ( + "strconv" + + "github.com/bze-alphateam/bze/x/cointrunk/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" +) + +const ( + FlagPicture = "picture" +) + +var _ = strconv.Itoa(0) + +func CmdAddArticle() *cobra.Command { + cmd := &cobra.Command{ + Use: "add-article [title] [url]", + Short: "Broadcast message add-article", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argTitle := args[0] + argUrl := args[1] + argPicture, err := cmd.Flags().GetString(FlagPicture) + if err != nil { + return err + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgAddArticle( + clientCtx.GetFromAddress().String(), + argTitle, + argUrl, + argPicture, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + cmd.Flags().String(FlagPicture, "", "Picture of the article") + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/cointrunk/handler.go b/x/cointrunk/handler.go index c81f7e3c..34d2cc38 100644 --- a/x/cointrunk/handler.go +++ b/x/cointrunk/handler.go @@ -11,13 +11,16 @@ import ( // NewHandler ... func NewHandler(k keeper.Keeper) sdk.Handler { - // this line is used by starport scaffolding # handler/msgServer + msgServer := keeper.NewMsgServerImpl(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { - // this line is used by starport scaffolding # 1 + case *types.MsgAddArticle: + res, err := msgServer.AddArticle(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + // this line is used by starport scaffolding # 1 default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) diff --git a/x/cointrunk/keeper/cointrunk.go b/x/cointrunk/keeper/cointrunk.go index 87a22017..57245b1d 100644 --- a/x/cointrunk/keeper/cointrunk.go +++ b/x/cointrunk/keeper/cointrunk.go @@ -1,9 +1,16 @@ package keeper import ( + "crypto/md5" + "encoding/binary" "github.com/bze-alphateam/bze/x/cointrunk/types" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/gobuffalo/packr/v2/file/resolver/encoding/hex" +) + +const ( + CounterKey = "counter" ) func (k Keeper) GetPublisher(ctx sdk.Context, index string) (publisher types.Publisher, found bool) { @@ -75,3 +82,39 @@ func (k Keeper) SetAcceptedDomain(ctx sdk.Context, acceptedDomain types.Accepted record, ) } + +func (k Keeper) SetArticle(ctx sdk.Context, article types.Article) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.GenerateArticlePrefix(ctx))) + hash := md5.Sum([]byte(article.Url)) + keyString := hex.EncodeToString(hash[:]) + record := k.cdc.MustMarshal(&article) + store.Set( + types.ArticleKey(keyString), + record, + ) + + k.incrementCounter(ctx) +} + +func (k Keeper) GetCounter(ctx sdk.Context) (no uint64) { + counterStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.GenerateArticleCountPrefix(ctx))) + counter := counterStore.Get(types.ArticleKey(CounterKey)) + if counter == nil { + return 0 + } + + return binary.BigEndian.Uint64(counter) +} + +func (k Keeper) incrementCounter(ctx sdk.Context) { + no := k.GetCounter(ctx) + no++ + counterStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.GenerateArticleCountPrefix(ctx))) + record := make([]byte, 8) + binary.BigEndian.PutUint64(record, no) + + counterStore.Set( + types.ArticleKey(CounterKey), + record, + ) +} diff --git a/x/cointrunk/keeper/msg_server_add_article.go b/x/cointrunk/keeper/msg_server_add_article.go new file mode 100644 index 00000000..ebdac89e --- /dev/null +++ b/x/cointrunk/keeper/msg_server_add_article.go @@ -0,0 +1,51 @@ +package keeper + +import ( + "context" + "github.com/bze-alphateam/bze/x/cointrunk/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +func (k msgServer) AddArticle(goCtx context.Context, msg *types.MsgAddArticle) (*types.MsgAddArticleResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + publisher, found := k.GetPublisher(ctx, msg.Publisher) + paid := !found || publisher.Active != true + if paid { + articleLimit := k.AnonArticleLimit(ctx) + existingArticlesCount := k.GetCounter(ctx) + if existingArticlesCount >= articleLimit { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Paid article limit reached for current period") + } + + articleCost, err := sdk.ParseCoinsNormalized(k.AnonArticleCost(ctx)) + if err != nil { + panic(err) + } + + publisherAcc, err := sdk.AccAddressFromBech32(msg.Publisher) + if err != nil { + panic(err) + } + + sdkErr := k.bankKeeper.SendCoinsFromAccountToModule(ctx, publisherAcc, types.ModuleName, articleCost) + if sdkErr != nil { + return nil, sdkErr + } + } + + var article = types.Article{ + Title: msg.Title, + Url: msg.Url, + Picture: msg.Picture, + Publisher: msg.Publisher, + Paid: paid, + } + + k.SetArticle(ctx, article) + + _ = ctx + + return &types.MsgAddArticleResponse{}, nil +} diff --git a/x/cointrunk/module_simulation.go b/x/cointrunk/module_simulation.go index f47a8880..4d93d969 100644 --- a/x/cointrunk/module_simulation.go +++ b/x/cointrunk/module_simulation.go @@ -24,7 +24,11 @@ var ( ) const ( -// this line is used by starport scaffolding # simapp/module/const + opWeightMsgAddArticle = "op_weight_msg_add_article" + // TODO: Determine the simulation weight value + defaultWeightMsgAddArticle int = 100 + + // this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module @@ -65,6 +69,17 @@ func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) + var weightMsgAddArticle int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgAddArticle, &weightMsgAddArticle, nil, + func(_ *rand.Rand) { + weightMsgAddArticle = defaultWeightMsgAddArticle + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgAddArticle, + cointrunksimulation.SimulateMsgAddArticle(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations diff --git a/x/cointrunk/simulation/add_article.go b/x/cointrunk/simulation/add_article.go new file mode 100644 index 00000000..5ec665ac --- /dev/null +++ b/x/cointrunk/simulation/add_article.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/bze-alphateam/bze/x/cointrunk/keeper" + "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +func SimulateMsgAddArticle( + 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.MsgAddArticle{ + Publisher: simAccount.Address.String(), + } + + // TODO: Handling the AddArticle simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "AddArticle simulation not implemented"), nil, nil + } +} diff --git a/x/cointrunk/types/article.pb.go b/x/cointrunk/types/article.pb.go new file mode 100644 index 00000000..9de62f29 --- /dev/null +++ b/x/cointrunk/types/article.pb.go @@ -0,0 +1,512 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cointrunk/article.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/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 Article struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + Picture string `protobuf:"bytes,3,opt,name=picture,proto3" json:"picture,omitempty"` + Publisher string `protobuf:"bytes,4,opt,name=publisher,proto3" json:"publisher,omitempty"` + Paid bool `protobuf:"varint,5,opt,name=paid,proto3" json:"paid,omitempty"` +} + +func (m *Article) Reset() { *m = Article{} } +func (m *Article) String() string { return proto.CompactTextString(m) } +func (*Article) ProtoMessage() {} +func (*Article) Descriptor() ([]byte, []int) { + return fileDescriptor_b0f4352c8e9bdd9e, []int{0} +} +func (m *Article) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Article) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Article.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 *Article) XXX_Merge(src proto.Message) { + xxx_messageInfo_Article.Merge(m, src) +} +func (m *Article) XXX_Size() int { + return m.Size() +} +func (m *Article) XXX_DiscardUnknown() { + xxx_messageInfo_Article.DiscardUnknown(m) +} + +var xxx_messageInfo_Article proto.InternalMessageInfo + +func (m *Article) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Article) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *Article) GetPicture() string { + if m != nil { + return m.Picture + } + return "" +} + +func (m *Article) GetPublisher() string { + if m != nil { + return m.Publisher + } + return "" +} + +func (m *Article) GetPaid() bool { + if m != nil { + return m.Paid + } + return false +} + +func init() { + proto.RegisterType((*Article)(nil), "bze.cointrunk.Article") +} + +func init() { proto.RegisterFile("cointrunk/article.proto", fileDescriptor_b0f4352c8e9bdd9e) } + +var fileDescriptor_b0f4352c8e9bdd9e = []byte{ + // 216 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xce, 0xcf, 0xcc, + 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x2c, 0x2a, 0xc9, 0x4c, 0xce, 0x49, 0xd5, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x4b, 0x2a, 0xd5, 0x72, 0xb1, 0x3b, + 0x42, 0xe4, 0x85, 0x44, 0xb8, 0x58, 0x4b, 0x32, 0x4b, 0x72, 0x52, 0x25, 0x18, 0x15, 0x18, 0x35, + 0x38, 0x83, 0x20, 0x1c, 0x21, 0x01, 0x2e, 0xe6, 0xd2, 0xa2, 0x1c, 0x09, 0x26, 0xb0, 0x18, 0x88, + 0x29, 0x24, 0xc1, 0xc5, 0x5e, 0x90, 0x99, 0x5c, 0x52, 0x5a, 0x94, 0x2a, 0xc1, 0x0c, 0x16, 0x85, + 0x71, 0x85, 0x64, 0xb8, 0x38, 0x0b, 0x4a, 0x93, 0x72, 0x32, 0x8b, 0x33, 0x52, 0x8b, 0x24, 0x58, + 0xc0, 0x72, 0x08, 0x01, 0x21, 0x21, 0x2e, 0x96, 0x82, 0xc4, 0xcc, 0x14, 0x09, 0x56, 0x05, 0x46, + 0x0d, 0x8e, 0x20, 0x30, 0xdb, 0xc9, 0xe3, 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, 0xf4, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x93, 0xaa, 0x52, + 0x75, 0x13, 0x73, 0x0a, 0x32, 0x12, 0x4b, 0x52, 0x13, 0xc1, 0x3c, 0xfd, 0x0a, 0x7d, 0x84, 0xff, + 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xde, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, + 0x24, 0x57, 0x2a, 0x86, 0xf9, 0x00, 0x00, 0x00, +} + +func (m *Article) 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 *Article) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Article) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Paid { + i-- + if m.Paid { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if len(m.Publisher) > 0 { + i -= len(m.Publisher) + copy(dAtA[i:], m.Publisher) + i = encodeVarintArticle(dAtA, i, uint64(len(m.Publisher))) + i-- + dAtA[i] = 0x22 + } + if len(m.Picture) > 0 { + i -= len(m.Picture) + copy(dAtA[i:], m.Picture) + i = encodeVarintArticle(dAtA, i, uint64(len(m.Picture))) + i-- + dAtA[i] = 0x1a + } + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintArticle(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintArticle(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintArticle(dAtA []byte, offset int, v uint64) int { + offset -= sovArticle(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Article) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovArticle(uint64(l)) + } + l = len(m.Url) + if l > 0 { + n += 1 + l + sovArticle(uint64(l)) + } + l = len(m.Picture) + if l > 0 { + n += 1 + l + sovArticle(uint64(l)) + } + l = len(m.Publisher) + if l > 0 { + n += 1 + l + sovArticle(uint64(l)) + } + if m.Paid { + n += 2 + } + return n +} + +func sovArticle(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozArticle(x uint64) (n int) { + return sovArticle(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Article) 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 ErrIntOverflowArticle + } + 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: Article: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Article: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + 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 ErrInvalidLengthArticle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + 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 ErrInvalidLengthArticle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Url = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Picture", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + 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 ErrInvalidLengthArticle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Picture = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Publisher", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + 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 ErrInvalidLengthArticle + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthArticle + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Publisher = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Paid", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Paid = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipArticle(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthArticle + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipArticle(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, ErrIntOverflowArticle + } + 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, ErrIntOverflowArticle + } + 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, ErrIntOverflowArticle + } + 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, ErrInvalidLengthArticle + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupArticle + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthArticle + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthArticle = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowArticle = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupArticle = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/cointrunk/types/codec.go b/x/cointrunk/types/codec.go index ef008212..b8fdd9e4 100644 --- a/x/cointrunk/types/codec.go +++ b/x/cointrunk/types/codec.go @@ -5,17 +5,21 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/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(&AcceptedDomainProposal{}, "cointrunk/AcceptedDomainProposal", nil) cdc.RegisterConcrete(&PublisherProposal{}, "cointrunk/PublisherProposal", nil) + cdc.RegisterConcrete(&MsgAddArticle{}, "cointrunk/AddArticle", nil) // this line is used by starport scaffolding # 2 } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgAddArticle{}, + ) // this line is used by starport scaffolding # 3 registry.RegisterImplementations( (*govtypes.Content)(nil), diff --git a/x/cointrunk/types/expected_keepers.go b/x/cointrunk/types/expected_keepers.go index 5d230317..a9ba2cc2 100644 --- a/x/cointrunk/types/expected_keepers.go +++ b/x/cointrunk/types/expected_keepers.go @@ -18,5 +18,7 @@ type AccountKeeper interface { // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + BurnCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error // Methods imported from bank should be defined here } diff --git a/x/cointrunk/types/key_article.go b/x/cointrunk/types/key_article.go new file mode 100644 index 00000000..2626a507 --- /dev/null +++ b/x/cointrunk/types/key_article.go @@ -0,0 +1,34 @@ +package types + +import ( + "encoding/binary" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ binary.ByteOrder + +const ( + // ArticleKeyPrefix is the prefix to retrieve all Article + ArticleKeyPrefix = "Article/value/" +) + +// ArticleKey returns the store key to retrieve a Publisher from the index fields +func ArticleKey( + index string, +) []byte { + var key []byte + + indexBytes := []byte(index) + key = append(key, indexBytes...) + key = append(key, []byte("/")...) + + return key +} + +func GenerateArticlePrefix(ctx sdk.Context) (prefix string) { + return ArticleKeyPrefix + ctx.BlockHeader().Time.Format("200601021506") +} + +func GenerateArticleCountPrefix(ctx sdk.Context) (prefix string) { + return ctx.BlockHeader().Time.Format("200601") +} diff --git a/x/cointrunk/types/message_add_article.go b/x/cointrunk/types/message_add_article.go new file mode 100644 index 00000000..7de677c3 --- /dev/null +++ b/x/cointrunk/types/message_add_article.go @@ -0,0 +1,48 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgAddArticle = "add_article" + +var _ sdk.Msg = &MsgAddArticle{} + +func NewMsgAddArticle(publisher string, title string, url string, picture string) *MsgAddArticle { + return &MsgAddArticle{ + Publisher: publisher, + Title: title, + Url: url, + Picture: picture, + } +} + +func (msg *MsgAddArticle) Route() string { + return RouterKey +} + +func (msg *MsgAddArticle) Type() string { + return TypeMsgAddArticle +} + +func (msg *MsgAddArticle) GetSigners() []sdk.AccAddress { + publisher, err := sdk.AccAddressFromBech32(msg.Publisher) + if err != nil { + panic(err) + } + return []sdk.AccAddress{publisher} +} + +func (msg *MsgAddArticle) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgAddArticle) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Publisher) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid publisher address (%s)", err) + } + return nil +} diff --git a/x/cointrunk/types/message_add_article_test.go b/x/cointrunk/types/message_add_article_test.go new file mode 100644 index 00000000..504993b5 --- /dev/null +++ b/x/cointrunk/types/message_add_article_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + "github.com/bze-alphateam/bze/testutil/sample" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgAddArticle_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgAddArticle + err error + }{ + { + name: "invalid address", + msg: MsgAddArticle{ + Publisher: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgAddArticle{ + Publisher: 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/cointrunk/types/tx.pb.go b/x/cointrunk/types/tx.pb.go index 6987192e..4e3d72e2 100644 --- a/x/cointrunk/types/tx.pb.go +++ b/x/cointrunk/types/tx.pb.go @@ -9,7 +9,11 @@ import ( grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/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,18 +27,135 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type MsgAddArticle struct { + Publisher string `protobuf:"bytes,1,opt,name=publisher,proto3" json:"publisher,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` + Picture string `protobuf:"bytes,4,opt,name=picture,proto3" json:"picture,omitempty"` +} + +func (m *MsgAddArticle) Reset() { *m = MsgAddArticle{} } +func (m *MsgAddArticle) String() string { return proto.CompactTextString(m) } +func (*MsgAddArticle) ProtoMessage() {} +func (*MsgAddArticle) Descriptor() ([]byte, []int) { + return fileDescriptor_776bb1586e9b1fcd, []int{0} +} +func (m *MsgAddArticle) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddArticle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddArticle.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 *MsgAddArticle) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddArticle.Merge(m, src) +} +func (m *MsgAddArticle) XXX_Size() int { + return m.Size() +} +func (m *MsgAddArticle) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddArticle.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddArticle proto.InternalMessageInfo + +func (m *MsgAddArticle) GetPublisher() string { + if m != nil { + return m.Publisher + } + return "" +} + +func (m *MsgAddArticle) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *MsgAddArticle) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *MsgAddArticle) GetPicture() string { + if m != nil { + return m.Picture + } + return "" +} + +type MsgAddArticleResponse struct { +} + +func (m *MsgAddArticleResponse) Reset() { *m = MsgAddArticleResponse{} } +func (m *MsgAddArticleResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAddArticleResponse) ProtoMessage() {} +func (*MsgAddArticleResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_776bb1586e9b1fcd, []int{1} +} +func (m *MsgAddArticleResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddArticleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddArticleResponse.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 *MsgAddArticleResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddArticleResponse.Merge(m, src) +} +func (m *MsgAddArticleResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAddArticleResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddArticleResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddArticleResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgAddArticle)(nil), "bze.cointrunk.MsgAddArticle") + proto.RegisterType((*MsgAddArticleResponse)(nil), "bze.cointrunk.MsgAddArticleResponse") +} + func init() { proto.RegisterFile("cointrunk/tx.proto", fileDescriptor_776bb1586e9b1fcd) } var fileDescriptor_776bb1586e9b1fcd = []byte{ - // 128 bytes of a gzipped FileDescriptorProto + // 244 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4a, 0xce, 0xcf, 0xcc, 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, - 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x8b, 0x1b, 0xb1, 0x72, 0x31, 0xfb, 0x16, 0xa7, 0x3b, 0x79, 0x9c, - 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, 0x5e, 0x7a, 0x66, 0x49, 0x46, 0x69, - 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x52, 0x55, 0xaa, 0x6e, 0x62, 0x4e, 0x41, 0x46, 0x62, 0x49, - 0x6a, 0x22, 0x98, 0xa7, 0x5f, 0xa1, 0x8f, 0x64, 0x45, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, - 0x1a, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x06, 0x30, 0x5f, 0x7c, 0x00, 0x00, 0x00, + 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x8b, 0x2b, 0xe5, 0x73, 0xf1, 0xfa, 0x16, 0xa7, 0x3b, 0xa6, 0xa4, + 0x38, 0x16, 0x95, 0x64, 0x26, 0xe7, 0xa4, 0x0a, 0xc9, 0x70, 0x71, 0x16, 0x94, 0x26, 0xe5, 0x64, + 0x16, 0x67, 0xa4, 0x16, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x21, 0x04, 0x84, 0x44, 0xb8, + 0x58, 0x4b, 0x32, 0x4b, 0x72, 0x52, 0x25, 0x98, 0xc0, 0x32, 0x10, 0x8e, 0x90, 0x00, 0x17, 0x73, + 0x69, 0x51, 0x8e, 0x04, 0x33, 0x58, 0x0c, 0xc4, 0x14, 0x92, 0xe0, 0x62, 0x2f, 0xc8, 0x4c, 0x2e, + 0x29, 0x2d, 0x4a, 0x95, 0x60, 0x01, 0x8b, 0xc2, 0xb8, 0x4a, 0xe2, 0x5c, 0xa2, 0x28, 0x16, 0x06, + 0xa5, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x1a, 0x85, 0x73, 0x31, 0xfb, 0x16, 0xa7, 0x0b, 0x05, + 0x70, 0x71, 0x21, 0xbb, 0x46, 0x0f, 0xc5, 0xb9, 0x7a, 0x28, 0x5a, 0xa5, 0x54, 0xf0, 0xc9, 0xc2, + 0x0c, 0x76, 0xf2, 0x38, 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, 0xbd, 0xf4, + 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xa4, 0xaa, 0x54, 0xdd, 0xc4, 0x9c, + 0x82, 0x8c, 0xc4, 0x92, 0xd4, 0x44, 0x30, 0x4f, 0xbf, 0x42, 0x1f, 0x29, 0xf8, 0x2a, 0x0b, 0x52, + 0x8b, 0x93, 0xd8, 0xc0, 0x41, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x64, 0xd1, 0x3c, + 0x58, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -49,6 +170,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 { + AddArticle(ctx context.Context, in *MsgAddArticle, opts ...grpc.CallOption) (*MsgAddArticleResponse, error) } type msgClient struct { @@ -59,22 +181,497 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } +func (c *msgClient) AddArticle(ctx context.Context, in *MsgAddArticle, opts ...grpc.CallOption) (*MsgAddArticleResponse, error) { + out := new(MsgAddArticleResponse) + err := c.cc.Invoke(ctx, "/bze.cointrunk.Msg/AddArticle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { + AddArticle(context.Context, *MsgAddArticle) (*MsgAddArticleResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. type UnimplementedMsgServer struct { } +func (*UnimplementedMsgServer) AddArticle(ctx context.Context, req *MsgAddArticle) (*MsgAddArticleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddArticle not implemented") +} + func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +func _Msg_AddArticle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAddArticle) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AddArticle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bze.cointrunk.Msg/AddArticle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AddArticle(ctx, req.(*MsgAddArticle)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "bze.cointrunk.Msg", HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{}, - Metadata: "cointrunk/tx.proto", + Methods: []grpc.MethodDesc{ + { + MethodName: "AddArticle", + Handler: _Msg_AddArticle_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cointrunk/tx.proto", +} + +func (m *MsgAddArticle) 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 *MsgAddArticle) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddArticle) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Picture) > 0 { + i -= len(m.Picture) + copy(dAtA[i:], m.Picture) + i = encodeVarintTx(dAtA, i, uint64(len(m.Picture))) + i-- + dAtA[i] = 0x22 + } + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintTx(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0x1a + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x12 + } + if len(m.Publisher) > 0 { + i -= len(m.Publisher) + copy(dAtA[i:], m.Publisher) + i = encodeVarintTx(dAtA, i, uint64(len(m.Publisher))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAddArticleResponse) 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 *MsgAddArticleResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddArticleResponse) 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 *MsgAddArticle) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Publisher) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Url) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Picture) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAddArticleResponse) 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 *MsgAddArticle) 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: MsgAddArticle: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddArticle: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Publisher", 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.Publisher = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", 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.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Url", 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.Url = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Picture", 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.Picture = 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 *MsgAddArticleResponse) 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: MsgAddArticleResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddArticleResponse: 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 6f32555cbe5a6df9eaab48ce2b173855e927beb2 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 24 Nov 2022 03:22:14 +0200 Subject: [PATCH 11/54] added query articles by prefix --- config.yml | 6 +- docs/static/openapi.yml | 189 ++++++ proto/cointrunk/query.proto | 16 + .../bze-alphateam/bze/bze.cointrunk/index.ts | 33 + .../bze/bze.cointrunk/module/rest.ts | 50 ++ .../module/types/cointrunk/query.ts | 219 +++++++ .../bze-alphateam/bze/bze.scavenge/index.ts | 40 +- .../bze/bze.scavenge/module/index.ts | 6 +- x/cointrunk/client/cli/query.go | 2 + .../client/cli/query_articles_by_prefix.go | 51 ++ x/cointrunk/keeper/cointrunk.go | 14 + .../keeper/grpc_query_articles_by_prefix.go | 39 ++ x/cointrunk/types/query.pb.go | 593 ++++++++++++++++-- x/cointrunk/types/query.pb.gw.go | 119 ++++ 14 files changed, 1314 insertions(+), 63 deletions(-) create mode 100644 x/cointrunk/client/cli/query_articles_by_prefix.go create mode 100644 x/cointrunk/keeper/grpc_query_articles_by_prefix.go diff --git a/config.yml b/config.yml index dbeec7ef..d0fbb6b7 100644 --- a/config.yml +++ b/config.yml @@ -32,4 +32,8 @@ genesis: tally_params: quorum: "0.00001" threshold: "0.001" - veto_threshold: "0.01" \ No newline at end of file + veto_threshold: "0.01" + cointrunk: + params: + anonArticleLimit: 5 + anonArticleCost: "250000000000utestbze" \ No newline at end of file diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 99ced40e..75f5ac06 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -121,6 +121,139 @@ paths: descending order. + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + '/bze/cointrunk/articles_by_prefix/{prefix}': + get: + summary: Queries a list of ArticlesByPrefix items. + operationId: BzeCointrunkArticlesByPrefix + responses: + '200': + description: A successful response. + schema: + type: object + properties: + article: + type: array + items: + type: object + properties: + title: + type: string + url: + type: string + picture: + type: string + publisher: + type: string + paid: + type: boolean + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + default: + description: An unexpected 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: prefix + 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 @@ -30345,6 +30478,19 @@ definitions: type: string active: type: boolean + bze.cointrunk.Article: + type: object + properties: + title: + type: string + url: + type: string + picture: + type: string + publisher: + type: string + paid: + type: boolean bze.cointrunk.MsgAddArticleResponse: type: object bze.cointrunk.Params: @@ -30402,6 +30548,49 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + bze.cointrunk.QueryArticlesByPrefixResponse: + type: object + properties: + article: + type: array + items: + type: object + properties: + title: + type: string + url: + type: string + picture: + type: string + publisher: + type: string + paid: + type: boolean + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } bze.cointrunk.QueryParamsResponse: type: object properties: diff --git a/proto/cointrunk/query.proto b/proto/cointrunk/query.proto index acab95de..aa3e8bf2 100644 --- a/proto/cointrunk/query.proto +++ b/proto/cointrunk/query.proto @@ -7,6 +7,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "cointrunk/params.proto"; import "cointrunk/accepted_domain.proto"; import "cointrunk/publisher.proto"; +import "cointrunk/article.proto"; // this line is used by starport scaffolding # 1 option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; @@ -32,6 +33,11 @@ service Query { option (google.api.http).get = "/bze/cointrunk/publisher/{index}"; } +// Queries a list of ArticlesByPrefix items. + rpc ArticlesByPrefix(QueryArticlesByPrefixRequest) returns (QueryArticlesByPrefixResponse) { + option (google.api.http).get = "/bze/cointrunk/articles_by_prefix/{prefix}"; + } + // this line is used by starport scaffolding # 2 } @@ -70,4 +76,14 @@ message QueryPublisherByIndexResponse { Publisher publisher = 1 [(gogoproto.nullable) = false]; } +message QueryArticlesByPrefixRequest { + string prefix = 1; +cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryArticlesByPrefixResponse { + repeated Article article = 1 [(gogoproto.nullable) = false]; +cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + // this line is used by starport scaffolding # 3 diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts index 11493e9c..bbb43df4 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts @@ -50,6 +50,7 @@ const getDefaultState = () => { AcceptedDomain: {}, Publisher: {}, PublisherByIndex: {}, + ArticlesByPrefix: {}, _Structure: { AcceptedDomain: getStructure(AcceptedDomain.fromPartial({})), @@ -110,6 +111,12 @@ export default { } return state.PublisherByIndex[JSON.stringify(params)] ?? {} }, + getArticlesByPrefix: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.ArticlesByPrefix[JSON.stringify(params)] ?? {} + }, getTypeStructure: (state) => (type) => { return state._Structure[type].fields @@ -240,6 +247,32 @@ export default { }, + + + + + + async QueryArticlesByPrefix({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryArticlesByPrefix( key.prefix, query)).data + + + while (all && ( value).pagination && ( value).pagination.next_key!=null) { + let next_values=(await queryClient.queryArticlesByPrefix( key.prefix, {...query, 'pagination.key':( value).pagination.next_key})).data + value = mergeResults(value, next_values); + } + commit('QUERY', { query: 'ArticlesByPrefix', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryArticlesByPrefix', payload: { options: { all }, params: {...key},query }}) + return getters['getArticlesByPrefix']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryArticlesByPrefix API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + async sendMsgAddArticle({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts index 2087ab18..be69bcc3 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts @@ -14,6 +14,14 @@ export interface CointrunkAcceptedDomain { active?: boolean; } +export interface CointrunkArticle { + title?: string; + url?: string; + picture?: string; + publisher?: string; + paid?: boolean; +} + export type CointrunkMsgAddArticleResponse = object; /** @@ -46,6 +54,21 @@ export interface CointrunkQueryAcceptedDomainResponse { pagination?: V1Beta1PageResponse; } +export interface CointrunkQueryArticlesByPrefixResponse { + article?: CointrunkArticle[]; + + /** + * 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; + * } + */ + pagination?: V1Beta1PageResponse; +} + /** * QueryParamsResponse is response type for the Query/Params RPC method. */ @@ -369,6 +392,33 @@ export class Api extends HttpClient + this.request({ + path: `/bze/cointrunk/articles_by_prefix/${prefix}`, + method: "GET", + query: query, + format: "json", + ...params, + }); + /** * No description * diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts index f2300da8..42354009 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts @@ -7,6 +7,7 @@ import { } from "../cosmos/base/query/v1beta1/pagination"; import { AcceptedDomain } from "../cointrunk/accepted_domain"; import { Publisher } from "../cointrunk/publisher"; +import { Article } from "../cointrunk/article"; export const protobufPackage = "bze.cointrunk"; @@ -45,6 +46,16 @@ export interface QueryPublisherByIndexResponse { publisher: Publisher | undefined; } +export interface QueryArticlesByPrefixRequest { + prefix: string; + pagination: PageRequest | undefined; +} + +export interface QueryArticlesByPrefixResponse { + article: Article[]; + pagination: PageResponse | undefined; +} + const baseQueryParamsRequest: object = {}; export const QueryParamsRequest = { @@ -613,6 +624,196 @@ export const QueryPublisherByIndexResponse = { }, }; +const baseQueryArticlesByPrefixRequest: object = { prefix: "" }; + +export const QueryArticlesByPrefixRequest = { + encode( + message: QueryArticlesByPrefixRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.prefix !== "") { + writer.uint32(10).string(message.prefix); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryArticlesByPrefixRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryArticlesByPrefixRequest, + } as QueryArticlesByPrefixRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prefix = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryArticlesByPrefixRequest { + const message = { + ...baseQueryArticlesByPrefixRequest, + } as QueryArticlesByPrefixRequest; + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = String(object.prefix); + } else { + message.prefix = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryArticlesByPrefixRequest): unknown { + const obj: any = {}; + message.prefix !== undefined && (obj.prefix = message.prefix); + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryArticlesByPrefixRequest { + const message = { + ...baseQueryArticlesByPrefixRequest, + } as QueryArticlesByPrefixRequest; + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = object.prefix; + } else { + message.prefix = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryArticlesByPrefixResponse: object = {}; + +export const QueryArticlesByPrefixResponse = { + encode( + message: QueryArticlesByPrefixResponse, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.article) { + Article.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryArticlesByPrefixResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryArticlesByPrefixResponse, + } as QueryArticlesByPrefixResponse; + message.article = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.article.push(Article.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryArticlesByPrefixResponse { + const message = { + ...baseQueryArticlesByPrefixResponse, + } as QueryArticlesByPrefixResponse; + message.article = []; + if (object.article !== undefined && object.article !== null) { + for (const e of object.article) { + message.article.push(Article.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryArticlesByPrefixResponse): unknown { + const obj: any = {}; + if (message.article) { + obj.article = message.article.map((e) => + e ? Article.toJSON(e) : undefined + ); + } else { + obj.article = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryArticlesByPrefixResponse { + const message = { + ...baseQueryArticlesByPrefixResponse, + } as QueryArticlesByPrefixResponse; + message.article = []; + if (object.article !== undefined && object.article !== null) { + for (const e of object.article) { + message.article.push(Article.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + /** Query defines the gRPC querier service. */ export interface Query { /** Parameters queries the parameters of the module. */ @@ -627,6 +828,10 @@ export interface Query { PublisherByIndex( request: QueryPublisherByIndexRequest ): Promise; + /** Queries a list of ArticlesByPrefix items. */ + ArticlesByPrefix( + request: QueryArticlesByPrefixRequest + ): Promise; } export class QueryClientImpl implements Query { @@ -675,6 +880,20 @@ export class QueryClientImpl implements Query { QueryPublisherByIndexResponse.decode(new Reader(data)) ); } + + ArticlesByPrefix( + request: QueryArticlesByPrefixRequest + ): Promise { + const data = QueryArticlesByPrefixRequest.encode(request).finish(); + const promise = this.rpc.request( + "bze.cointrunk.Query", + "ArticlesByPrefix", + data + ); + return promise.then((data) => + QueryArticlesByPrefixResponse.decode(new Reader(data)) + ); + } } interface Rpc { diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 40cc1ba4..0b1e1ca7 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,21 +232,6 @@ export default { }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) - } - } - }, async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -277,20 +262,22 @@ export default { } } }, - - async MsgCommitSolution({ rootGetters }, { value }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) const msg = await txClient.msgCommitSolution(value) - return msg + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result } catch (e) { if (e == MissingWalletError) { throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + }else{ + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) @@ -317,6 +304,19 @@ export default { } } }, + async MsgCommitSolution({ rootGetters }, { value }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgCommitSolution(value) + return msg + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + } else{ + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + } + } + }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index c023b54d..0e8c4c98 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; +import { MsgCommitSolution } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], + ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), + msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/client/cli/query.go b/x/cointrunk/client/cli/query.go index 93e987f8..4fdc4cc5 100644 --- a/x/cointrunk/client/cli/query.go +++ b/x/cointrunk/client/cli/query.go @@ -29,6 +29,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdPublisher()) cmd.AddCommand(CmdPublisherByIndex()) + cmd.AddCommand(CmdArticlesByPrefix()) + // this line is used by starport scaffolding # 1 return cmd diff --git a/x/cointrunk/client/cli/query_articles_by_prefix.go b/x/cointrunk/client/cli/query_articles_by_prefix.go new file mode 100644 index 00000000..95c13f92 --- /dev/null +++ b/x/cointrunk/client/cli/query_articles_by_prefix.go @@ -0,0 +1,51 @@ +package cli + +import ( + "strconv" + + "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdArticlesByPrefix() *cobra.Command { + cmd := &cobra.Command{ + Use: "articles-by-prefix [prefix]", + Short: "Query ArticlesByPrefix", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + reqPrefix := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryArticlesByPrefixRequest{ + Prefix: reqPrefix, + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + params.Pagination = pageReq + + res, err := queryClient.ArticlesByPrefix(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/cointrunk/keeper/cointrunk.go b/x/cointrunk/keeper/cointrunk.go index 57245b1d..dceb35fe 100644 --- a/x/cointrunk/keeper/cointrunk.go +++ b/x/cointrunk/keeper/cointrunk.go @@ -83,6 +83,20 @@ func (k Keeper) SetAcceptedDomain(ctx sdk.Context, acceptedDomain types.Accepted ) } +func (k Keeper) GetArticlesByPrefix(ctx sdk.Context, pre string) (list []types.Article) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ArticleKeyPrefix+pre)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Article + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} + func (k Keeper) SetArticle(ctx sdk.Context, article types.Article) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.GenerateArticlePrefix(ctx))) hash := md5.Sum([]byte(article.Url)) diff --git a/x/cointrunk/keeper/grpc_query_articles_by_prefix.go b/x/cointrunk/keeper/grpc_query_articles_by_prefix.go new file mode 100644 index 00000000..e70afab4 --- /dev/null +++ b/x/cointrunk/keeper/grpc_query_articles_by_prefix.go @@ -0,0 +1,39 @@ +package keeper + +import ( + "context" + "github.com/cosmos/cosmos-sdk/store/prefix" + "github.com/cosmos/cosmos-sdk/types/query" + + "github.com/bze-alphateam/bze/x/cointrunk/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) ArticlesByPrefix(goCtx context.Context, req *types.QueryArticlesByPrefixRequest) (*types.QueryArticlesByPrefixResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + var articles []types.Article + store := ctx.KVStore(k.storeKey) + articlesStore := prefix.NewStore(store, types.KeyPrefix(types.ArticleKeyPrefix+req.Prefix)) + pageRes, err := query.Paginate(articlesStore, req.Pagination, func(key []byte, value []byte) error { + var article types.Article + if err := k.cdc.Unmarshal(value, &article); err != nil { + return err + } + articles = append(articles, article) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + _ = ctx + + return &types.QueryArticlesByPrefixResponse{Article: articles, Pagination: pageRes}, nil +} diff --git a/x/cointrunk/types/query.pb.go b/x/cointrunk/types/query.pb.go index 9f8b8ec0..6810df36 100644 --- a/x/cointrunk/types/query.pb.go +++ b/x/cointrunk/types/query.pb.go @@ -393,6 +393,110 @@ func (m *QueryPublisherByIndexResponse) GetPublisher() Publisher { return Publisher{} } +type QueryArticlesByPrefixRequest struct { + Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryArticlesByPrefixRequest) Reset() { *m = QueryArticlesByPrefixRequest{} } +func (m *QueryArticlesByPrefixRequest) String() string { return proto.CompactTextString(m) } +func (*QueryArticlesByPrefixRequest) ProtoMessage() {} +func (*QueryArticlesByPrefixRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_12b6eb50b0e9fa00, []int{8} +} +func (m *QueryArticlesByPrefixRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryArticlesByPrefixRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryArticlesByPrefixRequest.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 *QueryArticlesByPrefixRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryArticlesByPrefixRequest.Merge(m, src) +} +func (m *QueryArticlesByPrefixRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryArticlesByPrefixRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryArticlesByPrefixRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryArticlesByPrefixRequest proto.InternalMessageInfo + +func (m *QueryArticlesByPrefixRequest) GetPrefix() string { + if m != nil { + return m.Prefix + } + return "" +} + +func (m *QueryArticlesByPrefixRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryArticlesByPrefixResponse struct { + Article []Article `protobuf:"bytes,1,rep,name=article,proto3" json:"article"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryArticlesByPrefixResponse) Reset() { *m = QueryArticlesByPrefixResponse{} } +func (m *QueryArticlesByPrefixResponse) String() string { return proto.CompactTextString(m) } +func (*QueryArticlesByPrefixResponse) ProtoMessage() {} +func (*QueryArticlesByPrefixResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_12b6eb50b0e9fa00, []int{9} +} +func (m *QueryArticlesByPrefixResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryArticlesByPrefixResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryArticlesByPrefixResponse.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 *QueryArticlesByPrefixResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryArticlesByPrefixResponse.Merge(m, src) +} +func (m *QueryArticlesByPrefixResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryArticlesByPrefixResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryArticlesByPrefixResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryArticlesByPrefixResponse proto.InternalMessageInfo + +func (m *QueryArticlesByPrefixResponse) GetArticle() []Article { + if m != nil { + return m.Article + } + return nil +} + +func (m *QueryArticlesByPrefixResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "bze.cointrunk.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "bze.cointrunk.QueryParamsResponse") @@ -402,50 +506,58 @@ func init() { proto.RegisterType((*QueryPublisherResponse)(nil), "bze.cointrunk.QueryPublisherResponse") proto.RegisterType((*QueryPublisherByIndexRequest)(nil), "bze.cointrunk.QueryPublisherByIndexRequest") proto.RegisterType((*QueryPublisherByIndexResponse)(nil), "bze.cointrunk.QueryPublisherByIndexResponse") + proto.RegisterType((*QueryArticlesByPrefixRequest)(nil), "bze.cointrunk.QueryArticlesByPrefixRequest") + proto.RegisterType((*QueryArticlesByPrefixResponse)(nil), "bze.cointrunk.QueryArticlesByPrefixResponse") } func init() { proto.RegisterFile("cointrunk/query.proto", fileDescriptor_12b6eb50b0e9fa00) } var fileDescriptor_12b6eb50b0e9fa00 = []byte{ - // 593 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xcd, 0x6e, 0x13, 0x31, - 0x10, 0xc7, 0xe3, 0xd2, 0x46, 0xca, 0x54, 0x54, 0xc8, 0x24, 0x25, 0xdd, 0x36, 0xdb, 0x74, 0x05, - 0x25, 0x14, 0x58, 0xab, 0x29, 0x47, 0x2e, 0x44, 0x88, 0xcf, 0x4b, 0xc9, 0x11, 0x09, 0x55, 0xde, - 0xc4, 0xda, 0xac, 0x48, 0xd6, 0xdb, 0xac, 0x83, 0x9a, 0x56, 0x5c, 0x78, 0x01, 0x90, 0x38, 0x70, - 0x84, 0x77, 0xe0, 0x25, 0x7a, 0xac, 0xc4, 0x85, 0x13, 0x42, 0x09, 0x0f, 0x82, 0x62, 0x7b, 0x93, - 0xac, 0x49, 0x3f, 0x90, 0x7a, 0x8b, 0x33, 0x33, 0xff, 0xf9, 0xcd, 0xdf, 0xe3, 0x85, 0x42, 0x83, - 0x07, 0xa1, 0xe8, 0xf6, 0xc2, 0xb7, 0x64, 0xbf, 0xc7, 0xba, 0x7d, 0x37, 0xea, 0x72, 0xc1, 0xf1, - 0x55, 0xef, 0x90, 0xb9, 0xe3, 0x90, 0x95, 0xf7, 0xb9, 0xcf, 0x65, 0x84, 0x8c, 0x7e, 0xa9, 0x24, - 0x6b, 0xcd, 0xe7, 0xdc, 0x6f, 0x33, 0x42, 0xa3, 0x80, 0xd0, 0x30, 0xe4, 0x82, 0x8a, 0x80, 0x87, - 0xb1, 0x8e, 0x6e, 0x35, 0x78, 0xdc, 0xe1, 0x31, 0xf1, 0x68, 0xcc, 0x94, 0x36, 0x79, 0xb7, 0xed, - 0x31, 0x41, 0xb7, 0x49, 0x44, 0xfd, 0x20, 0x94, 0xc9, 0x3a, 0x77, 0x79, 0x42, 0x11, 0xd1, 0x2e, - 0xed, 0x24, 0x1a, 0xeb, 0x93, 0xff, 0x69, 0xa3, 0xc1, 0x22, 0xc1, 0x9a, 0x7b, 0x4d, 0xde, 0xa1, - 0x41, 0x52, 0xb8, 0x32, 0x55, 0xd8, 0xf3, 0xda, 0x41, 0xdc, 0x62, 0x5d, 0x15, 0x72, 0xf2, 0x80, - 0x5f, 0x8d, 0xba, 0xee, 0x4a, 0xc1, 0x3a, 0xdb, 0xef, 0xb1, 0x58, 0x38, 0x2f, 0xe0, 0x7a, 0xea, - 0xdf, 0x38, 0xe2, 0x61, 0xcc, 0xf0, 0x0e, 0x64, 0x55, 0xe3, 0x22, 0x2a, 0xa3, 0xca, 0x62, 0xb5, - 0xe0, 0xa6, 0x0c, 0x70, 0x55, 0x7a, 0x6d, 0xfe, 0xf8, 0xd7, 0x7a, 0xa6, 0xae, 0x53, 0x9d, 0x26, - 0x58, 0x52, 0xeb, 0x91, 0x46, 0x7b, 0x2c, 0xc9, 0x74, 0x27, 0xfc, 0x04, 0x60, 0x32, 0xa7, 0x96, - 0xdd, 0x74, 0x95, 0x29, 0xee, 0xc8, 0x14, 0x57, 0x19, 0xae, 0x4d, 0x71, 0x77, 0xa9, 0xcf, 0x74, - 0x6d, 0x7d, 0xaa, 0xd2, 0xf9, 0x8e, 0x60, 0x75, 0x66, 0x1b, 0x8d, 0xfe, 0x12, 0x96, 0x68, 0x2a, - 0x52, 0x44, 0xe5, 0x2b, 0x95, 0xc5, 0x6a, 0xc9, 0x18, 0x21, 0x5d, 0xae, 0x47, 0x31, 0x4a, 0xf1, - 0xd3, 0x14, 0xf4, 0x9c, 0x84, 0xbe, 0x7d, 0x2e, 0xb4, 0x22, 0x49, 0x51, 0xef, 0x41, 0x41, 0xf9, - 0x9c, 0xdc, 0xca, 0x65, 0xdb, 0xf2, 0x15, 0xc1, 0xb2, 0xd9, 0x41, 0x3b, 0xf2, 0x10, 0x72, 0xe3, - 0x65, 0xd0, 0x66, 0x14, 0xcd, 0xfb, 0x4c, 0xe2, 0xda, 0x87, 0x49, 0xc1, 0xe5, 0x59, 0xf0, 0x00, - 0xd6, 0xd2, 0x80, 0xb5, 0xfe, 0xf3, 0xb0, 0xc9, 0x0e, 0x12, 0x27, 0xf2, 0xb0, 0x10, 0x8c, 0xce, - 0xd2, 0x84, 0x5c, 0x5d, 0x1d, 0x9c, 0x37, 0x50, 0x3a, 0xa5, 0x6a, 0xf6, 0x74, 0xe8, 0xbf, 0xa6, - 0xab, 0x7e, 0x9b, 0x87, 0x05, 0xa9, 0x8f, 0x43, 0xc8, 0xaa, 0xad, 0xc6, 0x1b, 0x46, 0xf9, 0xbf, - 0xcf, 0xc6, 0x72, 0xce, 0x4a, 0x51, 0x60, 0x4e, 0xe9, 0xc3, 0x8f, 0x3f, 0x9f, 0xe7, 0x6e, 0xe0, - 0x02, 0xf1, 0x0e, 0x19, 0x31, 0x5f, 0x34, 0xfe, 0x88, 0x60, 0x29, 0xbd, 0x83, 0xf8, 0xce, 0x2c, - 0xd5, 0x99, 0xaf, 0xc9, 0xda, 0xba, 0x48, 0xaa, 0x06, 0xd9, 0x94, 0x20, 0x65, 0x6c, 0x1b, 0x20, - 0xc6, 0x27, 0x04, 0x1f, 0x41, 0x6e, 0xec, 0x14, 0xbe, 0x39, 0x73, 0x42, 0x63, 0x7b, 0xad, 0x5b, - 0xe7, 0x64, 0x69, 0x82, 0x0d, 0x49, 0xb0, 0x8a, 0x57, 0x4c, 0x2b, 0x92, 0xcc, 0x18, 0x7f, 0x41, - 0x70, 0xcd, 0xbc, 0x63, 0x7c, 0xf7, 0x4c, 0xf9, 0xf4, 0xfe, 0x58, 0xf7, 0x2e, 0x96, 0xac, 0x91, - 0x2a, 0x12, 0xc9, 0xc1, 0xe5, 0xd3, 0x90, 0xc8, 0x91, 0x5c, 0xc0, 0xf7, 0xb5, 0x67, 0xc7, 0x03, - 0x1b, 0x9d, 0x0c, 0x6c, 0xf4, 0x7b, 0x60, 0xa3, 0x4f, 0x43, 0x3b, 0x73, 0x32, 0xb4, 0x33, 0x3f, - 0x87, 0x76, 0xe6, 0xb5, 0xeb, 0x07, 0xa2, 0xd5, 0xf3, 0xdc, 0x06, 0xef, 0x8c, 0x54, 0xee, 0xd3, - 0x76, 0xd4, 0xa2, 0x82, 0x51, 0x79, 0x22, 0x07, 0x53, 0xaa, 0xa2, 0x1f, 0xb1, 0xd8, 0xcb, 0xca, - 0x2f, 0xf1, 0xce, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe8, 0xfc, 0xfe, 0xf5, 0x65, 0x06, 0x00, - 0x00, + // 697 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0x4d, 0x4f, 0x13, 0x41, + 0x18, 0xc7, 0x3b, 0x28, 0x35, 0x0c, 0x91, 0x90, 0x91, 0x16, 0x58, 0x60, 0x29, 0x1b, 0x45, 0x44, + 0xdc, 0x0d, 0xc5, 0x78, 0xf2, 0x42, 0x63, 0x7c, 0xbd, 0x60, 0x8f, 0x26, 0xa6, 0x99, 0xdd, 0x8e, + 0xcb, 0xc6, 0x76, 0x67, 0xd9, 0xdd, 0x1a, 0x0a, 0xc1, 0x83, 0x5f, 0x40, 0x13, 0x0f, 0x1e, 0xd5, + 0xcf, 0xe0, 0x57, 0xf0, 0xc0, 0x91, 0xc4, 0x8b, 0x27, 0x63, 0xc0, 0x0f, 0x62, 0x3a, 0xf3, 0x6c, + 0xdb, 0x1d, 0xb6, 0x80, 0xa6, 0xa7, 0x76, 0xe6, 0x79, 0x99, 0xdf, 0xf3, 0x7f, 0xe6, 0x99, 0xc5, + 0x05, 0x87, 0x7b, 0x7e, 0x1c, 0xb6, 0xfc, 0xd7, 0xd6, 0x4e, 0x8b, 0x85, 0x6d, 0x33, 0x08, 0x79, + 0xcc, 0xc9, 0x55, 0x7b, 0x8f, 0x99, 0x5d, 0x93, 0x36, 0xe5, 0x72, 0x97, 0x0b, 0x8b, 0xd5, 0xf9, + 0x27, 0x9d, 0xb4, 0x79, 0x97, 0x73, 0xb7, 0xc1, 0x2c, 0x1a, 0x78, 0x16, 0xf5, 0x7d, 0x1e, 0xd3, + 0xd8, 0xe3, 0x7e, 0x04, 0xd6, 0x55, 0x87, 0x47, 0x4d, 0x1e, 0x59, 0x36, 0x8d, 0x98, 0xcc, 0x6d, + 0xbd, 0x59, 0xb7, 0x59, 0x4c, 0xd7, 0xad, 0x80, 0xba, 0x9e, 0x2f, 0x9c, 0xc1, 0xb7, 0xd8, 0xa3, + 0x08, 0x68, 0x48, 0x9b, 0x49, 0x8e, 0xc5, 0xde, 0x3e, 0x75, 0x1c, 0x16, 0xc4, 0xac, 0x5e, 0xab, + 0xf3, 0x26, 0xf5, 0x92, 0xc0, 0xd9, 0xbe, 0xc0, 0x96, 0xdd, 0xf0, 0xa2, 0x6d, 0x16, 0x82, 0x69, + 0xba, 0x2f, 0x36, 0x8c, 0x3d, 0xa7, 0xc1, 0xa4, 0xc1, 0x98, 0xc2, 0xe4, 0x79, 0x07, 0x67, 0x4b, + 0x9c, 0x54, 0x65, 0x3b, 0x2d, 0x16, 0xc5, 0xc6, 0x53, 0x7c, 0x2d, 0xb5, 0x1b, 0x05, 0xdc, 0x8f, + 0x18, 0xd9, 0xc0, 0x79, 0x49, 0x34, 0x83, 0x4a, 0x68, 0x65, 0xbc, 0x5c, 0x30, 0x53, 0xca, 0x98, + 0xd2, 0xbd, 0x72, 0xf9, 0xf0, 0xd7, 0x62, 0xae, 0x0a, 0xae, 0x46, 0x1d, 0x6b, 0x22, 0xd7, 0x26, + 0x30, 0x3f, 0x10, 0xc8, 0x70, 0x12, 0x79, 0x88, 0x71, 0x4f, 0x00, 0x48, 0xbb, 0x6c, 0x4a, 0xb5, + 0xcc, 0x8e, 0x5a, 0xa6, 0xec, 0x04, 0xa8, 0x65, 0x6e, 0x51, 0x97, 0x41, 0x6c, 0xb5, 0x2f, 0xd2, + 0xf8, 0x86, 0xf0, 0x5c, 0xe6, 0x31, 0x80, 0xfe, 0x0c, 0x4f, 0xd0, 0x94, 0x65, 0x06, 0x95, 0x2e, + 0xad, 0x8c, 0x97, 0x17, 0x94, 0x12, 0xd2, 0xe1, 0x50, 0x8a, 0x12, 0x4a, 0x1e, 0xa5, 0xa0, 0x47, + 0x04, 0xf4, 0xcd, 0x73, 0xa1, 0x25, 0x49, 0x8a, 0xba, 0x86, 0x0b, 0x52, 0xe7, 0xa4, 0x5d, 0xc3, + 0x96, 0xe5, 0x33, 0xc2, 0x45, 0xf5, 0x04, 0x50, 0xe4, 0x3e, 0x1e, 0xeb, 0xde, 0x12, 0x10, 0x63, + 0x46, 0xed, 0x67, 0x62, 0x07, 0x1d, 0x7a, 0x01, 0xc3, 0x93, 0xe0, 0x2e, 0x9e, 0x4f, 0x03, 0x56, + 0xda, 0x4f, 0xfc, 0x3a, 0xdb, 0x4d, 0x94, 0x98, 0xc2, 0xa3, 0x5e, 0x67, 0x2d, 0x44, 0x18, 0xab, + 0xca, 0x85, 0xf1, 0x12, 0x2f, 0x0c, 0x88, 0xca, 0xae, 0x0e, 0xfd, 0x53, 0x75, 0xc6, 0x5b, 0x80, + 0xda, 0x94, 0xb3, 0x12, 0x55, 0xda, 0x5b, 0x21, 0x7b, 0xe5, 0x75, 0xa1, 0x8a, 0x38, 0x1f, 0x88, + 0x0d, 0xa0, 0x82, 0x95, 0xd2, 0xb6, 0x91, 0xff, 0x6e, 0xdb, 0x17, 0x04, 0xf5, 0x9d, 0x06, 0x80, + 0xfa, 0xee, 0xe1, 0x2b, 0x30, 0xc8, 0xd0, 0xbb, 0xa2, 0x7a, 0x91, 0xa5, 0x15, 0x6a, 0x4b, 0x9c, + 0x87, 0xd6, 0xb7, 0xf2, 0xf7, 0x51, 0x3c, 0x2a, 0x10, 0x89, 0x8f, 0xf3, 0x72, 0xf0, 0xc9, 0x92, + 0xc2, 0x70, 0xfa, 0x65, 0xd1, 0x8c, 0xb3, 0x5c, 0xe4, 0x31, 0xc6, 0xc2, 0xbb, 0x1f, 0x7f, 0x3e, + 0x8e, 0x4c, 0x93, 0x82, 0x65, 0xef, 0x31, 0x4b, 0x7d, 0x0d, 0xc9, 0x7b, 0x84, 0x27, 0xd2, 0x63, + 0x4a, 0x6e, 0x65, 0x65, 0xcd, 0x7c, 0x70, 0xb4, 0xd5, 0x8b, 0xb8, 0x02, 0xc8, 0xb2, 0x00, 0x29, + 0x11, 0x5d, 0x01, 0x51, 0x9e, 0x5f, 0xb2, 0x8f, 0xc7, 0xba, 0x97, 0x89, 0x5c, 0xcf, 0xac, 0x50, + 0x19, 0x70, 0xed, 0xc6, 0x39, 0x5e, 0x40, 0xb0, 0x24, 0x08, 0xe6, 0xc8, 0xac, 0x2a, 0x45, 0xe2, + 0x19, 0x91, 0x4f, 0x08, 0x4f, 0xaa, 0x63, 0x40, 0x6e, 0x9f, 0x99, 0x3e, 0x3d, 0x62, 0xda, 0xda, + 0xc5, 0x9c, 0x01, 0x69, 0x45, 0x20, 0x19, 0xa4, 0x34, 0x08, 0xc9, 0xda, 0x17, 0x33, 0x7a, 0x40, + 0xbe, 0x22, 0x3c, 0xa9, 0x5e, 0xe0, 0x6c, 0xb2, 0x01, 0x73, 0x96, 0x4d, 0x36, 0x68, 0x26, 0x8c, + 0xb2, 0x20, 0x5b, 0x23, 0xab, 0x6a, 0xbb, 0x20, 0xa0, 0x66, 0xb7, 0x6b, 0x72, 0x50, 0xad, 0x7d, + 0xf9, 0x7b, 0x50, 0x79, 0x7c, 0x78, 0xac, 0xa3, 0xa3, 0x63, 0x1d, 0xfd, 0x3e, 0xd6, 0xd1, 0x87, + 0x13, 0x3d, 0x77, 0x74, 0xa2, 0xe7, 0x7e, 0x9e, 0xe8, 0xb9, 0x17, 0xa6, 0xeb, 0xc5, 0xdb, 0x2d, + 0xdb, 0x74, 0x78, 0xb3, 0x93, 0xef, 0x0e, 0x6d, 0x04, 0xdb, 0x34, 0x66, 0x54, 0xac, 0xac, 0xdd, + 0xbe, 0xfc, 0x71, 0x3b, 0x60, 0x91, 0x9d, 0x17, 0x1f, 0xd4, 0x8d, 0xbf, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xa7, 0x36, 0xd6, 0xd5, 0x45, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -468,6 +580,8 @@ type QueryClient interface { Publisher(ctx context.Context, in *QueryPublisherRequest, opts ...grpc.CallOption) (*QueryPublisherResponse, error) // Queries publisher by index/address. PublisherByIndex(ctx context.Context, in *QueryPublisherByIndexRequest, opts ...grpc.CallOption) (*QueryPublisherByIndexResponse, error) + // Queries a list of ArticlesByPrefix items. + ArticlesByPrefix(ctx context.Context, in *QueryArticlesByPrefixRequest, opts ...grpc.CallOption) (*QueryArticlesByPrefixResponse, error) } type queryClient struct { @@ -514,6 +628,15 @@ func (c *queryClient) PublisherByIndex(ctx context.Context, in *QueryPublisherBy return out, nil } +func (c *queryClient) ArticlesByPrefix(ctx context.Context, in *QueryArticlesByPrefixRequest, opts ...grpc.CallOption) (*QueryArticlesByPrefixResponse, error) { + out := new(QueryArticlesByPrefixResponse) + err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/ArticlesByPrefix", 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. @@ -524,6 +647,8 @@ type QueryServer interface { Publisher(context.Context, *QueryPublisherRequest) (*QueryPublisherResponse, error) // Queries publisher by index/address. PublisherByIndex(context.Context, *QueryPublisherByIndexRequest) (*QueryPublisherByIndexResponse, error) + // Queries a list of ArticlesByPrefix items. + ArticlesByPrefix(context.Context, *QueryArticlesByPrefixRequest) (*QueryArticlesByPrefixResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -542,6 +667,9 @@ func (*UnimplementedQueryServer) Publisher(ctx context.Context, req *QueryPublis func (*UnimplementedQueryServer) PublisherByIndex(ctx context.Context, req *QueryPublisherByIndexRequest) (*QueryPublisherByIndexResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PublisherByIndex not implemented") } +func (*UnimplementedQueryServer) ArticlesByPrefix(ctx context.Context, req *QueryArticlesByPrefixRequest) (*QueryArticlesByPrefixResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ArticlesByPrefix not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -619,6 +747,24 @@ func _Query_PublisherByIndex_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Query_ArticlesByPrefix_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryArticlesByPrefixRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ArticlesByPrefix(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bze.cointrunk.Query/ArticlesByPrefix", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ArticlesByPrefix(ctx, req.(*QueryArticlesByPrefixRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "bze.cointrunk.Query", HandlerType: (*QueryServer)(nil), @@ -639,6 +785,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "PublisherByIndex", Handler: _Query_PublisherByIndex_Handler, }, + { + MethodName: "ArticlesByPrefix", + Handler: _Query_ArticlesByPrefix_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cointrunk/query.proto", @@ -931,6 +1081,97 @@ func (m *QueryPublisherByIndexResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *QueryArticlesByPrefixRequest) 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 *QueryArticlesByPrefixRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryArticlesByPrefixRequest) 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.Prefix) > 0 { + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Prefix))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryArticlesByPrefixResponse) 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 *QueryArticlesByPrefixResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryArticlesByPrefixResponse) 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.Article) > 0 { + for iNdEx := len(m.Article) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Article[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 @@ -1050,6 +1291,42 @@ func (m *QueryPublisherByIndexResponse) Size() (n int) { return n } +func (m *QueryArticlesByPrefixRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Prefix) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryArticlesByPrefixResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Article) > 0 { + for _, e := range m.Article { + 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 } @@ -1766,6 +2043,244 @@ func (m *QueryPublisherByIndexResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryArticlesByPrefixRequest) 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: QueryArticlesByPrefixRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryArticlesByPrefixRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prefix = string(dAtA[iNdEx:postIndex]) + 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.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 *QueryArticlesByPrefixResponse) 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: QueryArticlesByPrefixResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryArticlesByPrefixResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Article", 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.Article = append(m.Article, Article{}) + if err := m.Article[len(m.Article)-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/cointrunk/types/query.pb.gw.go b/x/cointrunk/types/query.pb.gw.go index 7e7790c2..1ea5fd06 100644 --- a/x/cointrunk/types/query.pb.gw.go +++ b/x/cointrunk/types/query.pb.gw.go @@ -177,6 +177,78 @@ func local_request_Query_PublisherByIndex_0(ctx context.Context, marshaler runti } +var ( + filter_Query_ArticlesByPrefix_0 = &utilities.DoubleArray{Encoding: map[string]int{"prefix": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_ArticlesByPrefix_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryArticlesByPrefixRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["prefix"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "prefix") + } + + protoReq.Prefix, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "prefix", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ArticlesByPrefix_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ArticlesByPrefix(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ArticlesByPrefix_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryArticlesByPrefixRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["prefix"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "prefix") + } + + protoReq.Prefix, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "prefix", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ArticlesByPrefix_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ArticlesByPrefix(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. @@ -275,6 +347,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_ArticlesByPrefix_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_ArticlesByPrefix_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_ArticlesByPrefix_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -396,6 +491,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ArticlesByPrefix_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_ArticlesByPrefix_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_ArticlesByPrefix_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -407,6 +522,8 @@ var ( pattern_Query_Publisher_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "publishers"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_PublisherByIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"bze", "cointrunk", "publisher", "index"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_ArticlesByPrefix_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"bze", "cointrunk", "articles_by_prefix", "prefix"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -417,4 +534,6 @@ var ( forward_Query_Publisher_0 = runtime.ForwardResponseMessage forward_Query_PublisherByIndex_0 = runtime.ForwardResponseMessage + + forward_Query_ArticlesByPrefix_0 = runtime.ForwardResponseMessage ) From d5ddba7d8b680f8215db7e24aadc5f4034360bf0 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 24 Nov 2022 16:49:24 +0200 Subject: [PATCH 12/54] validate basic on message add article --- config.yml | 2 +- .../bze-alphateam/bze/bze.scavenge/index.ts | 32 ++++++++--------- .../bze/bze.scavenge/module/index.ts | 6 ++-- x/cointrunk/types/message_add_article.go | 35 +++++++++++++++++++ 4 files changed, 55 insertions(+), 20 deletions(-) diff --git a/config.yml b/config.yml index d0fbb6b7..a7b3b0d8 100644 --- a/config.yml +++ b/config.yml @@ -36,4 +36,4 @@ genesis: cointrunk: params: anonArticleLimit: 5 - anonArticleCost: "250000000000utestbze" \ No newline at end of file + anonArticleCost: "25000000000utestbze" \ No newline at end of file diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 0b1e1ca7..36486b56 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -247,33 +247,33 @@ export default { } } }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -291,29 +291,29 @@ export default { } } }, - async MsgRevealSolution({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 0e8c4c98..27b7f752 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -5,14 +5,14 @@ import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; -import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; +import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -46,8 +46,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/types/message_add_article.go b/x/cointrunk/types/message_add_article.go index 7de677c3..82723eaa 100644 --- a/x/cointrunk/types/message_add_article.go +++ b/x/cointrunk/types/message_add_article.go @@ -1,8 +1,11 @@ package types import ( + "errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "net/url" + "strings" ) const TypeMsgAddArticle = "add_article" @@ -44,5 +47,37 @@ func (msg *MsgAddArticle) ValidateBasic() error { if err != nil { return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid publisher address (%s)", err) } + + if len(strings.Trim(msg.Title, " ")) < 10 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid title: expecting at least 10 characters") + } + + err = msg.validateRawURI(msg.Url) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid url provided (%s)", err) + } + + //validate picture only if it's provided + if msg.Picture == "" { + return nil + } + + err = msg.validateRawURI(msg.Picture) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid picture url provided (%s)", err) + } + + return nil +} + +func (msg *MsgAddArticle) validateRawURI(uri string) error { + parsed, err := url.ParseRequestURI(uri) + if err != nil { + return err + } + if parsed.Scheme != "https" { + return errors.New("invalid url scheme: only https accepted") + } + return nil } From 51ca73d3404352948ec28560afafcd834272414c Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 24 Nov 2022 18:05:19 +0200 Subject: [PATCH 13/54] check accepted domains on article submit --- app/app.go | 2 +- go.mod | 1 + go.sum | 1 + .../bze-alphateam/bze/bze.scavenge/index.ts | 32 ++++++++-------- .../bze/bze.scavenge/module/index.ts | 6 +-- x/cointrunk/keeper/msg_server_add_article.go | 38 ++++++++++++++++++- x/cointrunk/types/key_accepted_domain.go | 6 ++- x/cointrunk/types/message_add_article.go | 12 +++--- 8 files changed, 69 insertions(+), 29 deletions(-) diff --git a/app/app.go b/app/app.go index ea5b3ffa..67c683e4 100644 --- a/app/app.go +++ b/app/app.go @@ -166,7 +166,7 @@ var ( stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, govtypes.ModuleName: {authtypes.Burner}, ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - scavengemoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking}, + scavengemoduletypes.ModuleName: {authtypes.Burner, authtypes.Staking}, cointrunkmoduletypes.ModuleName: {authtypes.Burner}, // this line is used by starport scaffolding # stargate/app/maccPerms } diff --git a/go.mod b/go.mod index a64a0280..668e4275 100644 --- a/go.mod +++ b/go.mod @@ -18,6 +18,7 @@ require ( github.com/tendermint/tm-db v0.6.6 google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1 google.golang.org/grpc v1.50.1 + gopkg.in/errgo.v2 v2.1.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index b16e9ff0..c1daed6b 100644 --- a/go.sum +++ b/go.sum @@ -2114,6 +2114,7 @@ gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLF gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 36486b56..40cc1ba4 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,33 +232,33 @@ export default { }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgSubmitScavenge(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, @@ -278,29 +278,29 @@ export default { } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgSubmitScavenge(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 27b7f752..c023b54d 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,14 +4,14 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; @@ -45,8 +45,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; diff --git a/x/cointrunk/keeper/msg_server_add_article.go b/x/cointrunk/keeper/msg_server_add_article.go index ebdac89e..56065bfe 100644 --- a/x/cointrunk/keeper/msg_server_add_article.go +++ b/x/cointrunk/keeper/msg_server_add_article.go @@ -5,11 +5,16 @@ import ( "github.com/bze-alphateam/bze/x/cointrunk/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "gopkg.in/errgo.v2/fmt/errors" + "strings" ) func (k msgServer) AddArticle(goCtx context.Context, msg *types.MsgAddArticle) (*types.MsgAddArticleResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - + err := k.validateMessageDomains(ctx, msg) + if err != nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid domain (%s)", err) + } publisher, found := k.GetPublisher(ctx, msg.Publisher) paid := !found || publisher.Active != true if paid { @@ -36,7 +41,7 @@ func (k msgServer) AddArticle(goCtx context.Context, msg *types.MsgAddArticle) ( } var article = types.Article{ - Title: msg.Title, + Title: strings.Trim(msg.Title, " "), Url: msg.Url, Picture: msg.Picture, Publisher: msg.Publisher, @@ -49,3 +54,32 @@ func (k msgServer) AddArticle(goCtx context.Context, msg *types.MsgAddArticle) ( return &types.MsgAddArticleResponse{}, nil } + +func (k msgServer) validateMessageDomains(ctx sdk.Context, msg *types.MsgAddArticle) error { + parsedUrl, err := msg.ParseUrl(msg.Url) + if err != nil { + return errors.Newf("Invalid article url(%s)", err) + } + + _, found := k.GetAcceptedDomain(ctx, parsedUrl.Host) + if !found { + return errors.Newf("Provided url domain (%s) is not an accepted domain", parsedUrl.Host) + } + + //msg.Picture is optional so do not validate it unless needed + if msg.Picture == "" { + return nil + } + + parsedUrl, err = msg.ParseUrl(msg.Picture) + if err != nil { + return errors.Newf("Invalid article picture url(%s)", err) + } + + _, found = k.GetAcceptedDomain(ctx, parsedUrl.Host) + if !found { + return errors.Newf("Provided picture domain (%s) is not an accepted domain", parsedUrl.Host) + } + + return nil +} diff --git a/x/cointrunk/types/key_accepted_domain.go b/x/cointrunk/types/key_accepted_domain.go index 9a376f46..8f10b29c 100644 --- a/x/cointrunk/types/key_accepted_domain.go +++ b/x/cointrunk/types/key_accepted_domain.go @@ -1,6 +1,9 @@ package types -import "encoding/binary" +import ( + "encoding/binary" + "strings" +) var _ binary.ByteOrder @@ -13,6 +16,7 @@ const ( func AcceptedDomainKey( index string, ) []byte { + index = strings.TrimPrefix(index, "www.") var key []byte indexBytes := []byte(index) diff --git a/x/cointrunk/types/message_add_article.go b/x/cointrunk/types/message_add_article.go index 82723eaa..f47ea021 100644 --- a/x/cointrunk/types/message_add_article.go +++ b/x/cointrunk/types/message_add_article.go @@ -52,7 +52,7 @@ func (msg *MsgAddArticle) ValidateBasic() error { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid title: expecting at least 10 characters") } - err = msg.validateRawURI(msg.Url) + _, err = msg.ParseUrl(msg.Url) if err != nil { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid url provided (%s)", err) } @@ -62,7 +62,7 @@ func (msg *MsgAddArticle) ValidateBasic() error { return nil } - err = msg.validateRawURI(msg.Picture) + _, err = msg.ParseUrl(msg.Picture) if err != nil { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid picture url provided (%s)", err) } @@ -70,14 +70,14 @@ func (msg *MsgAddArticle) ValidateBasic() error { return nil } -func (msg *MsgAddArticle) validateRawURI(uri string) error { +func (msg *MsgAddArticle) ParseUrl(uri string) (*url.URL, error) { parsed, err := url.ParseRequestURI(uri) if err != nil { - return err + return nil, err } if parsed.Scheme != "https" { - return errors.New("invalid url scheme: only https accepted") + return nil, errors.New("invalid url scheme: only https accepted") } - return nil + return parsed, nil } From 27eb74fd40f8b0f23d1009bcb7892a4a1b51cbd7 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 24 Nov 2022 18:13:24 +0200 Subject: [PATCH 14/54] added articles to export-import genesis --- proto/cointrunk/genesis.proto | 2 + .../module/types/cointrunk/genesis.ts | 30 +++++- .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +++--- .../bze/bze.scavenge/module/index.ts | 6 +- x/cointrunk/genesis.go | 6 ++ x/cointrunk/keeper/cointrunk.go | 14 +++ x/cointrunk/types/genesis.pb.go | 102 ++++++++++++++---- 7 files changed, 153 insertions(+), 39 deletions(-) diff --git a/proto/cointrunk/genesis.proto b/proto/cointrunk/genesis.proto index 57ff3b71..405ebe6e 100644 --- a/proto/cointrunk/genesis.proto +++ b/proto/cointrunk/genesis.proto @@ -5,6 +5,7 @@ import "gogoproto/gogo.proto"; import "cointrunk/params.proto"; import "cointrunk/publisher.proto"; import "cointrunk/accepted_domain.proto"; +import "cointrunk/article.proto"; // this line is used by starport scaffolding # genesis/proto/import option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; @@ -14,5 +15,6 @@ message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; repeated Publisher PublisherList = 2 [(gogoproto.nullable) = false]; repeated AcceptedDomain AcceptedDomainList = 3 [(gogoproto.nullable) = false]; + repeated Article ArticleList = 4 [(gogoproto.nullable) = false]; // this line is used by starport scaffolding # genesis/proto/state } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts index a7fc7a97..6ee3e11a 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts @@ -2,6 +2,7 @@ import { Params } from "../cointrunk/params"; import { Publisher } from "../cointrunk/publisher"; import { AcceptedDomain } from "../cointrunk/accepted_domain"; +import { Article } from "../cointrunk/article"; import { Writer, Reader } from "protobufjs/minimal"; export const protobufPackage = "bze.cointrunk"; @@ -10,8 +11,9 @@ export const protobufPackage = "bze.cointrunk"; export interface GenesisState { params: Params | undefined; PublisherList: Publisher[]; - /** this line is used by starport scaffolding # genesis/proto/state */ AcceptedDomainList: AcceptedDomain[]; + /** this line is used by starport scaffolding # genesis/proto/state */ + ArticleList: Article[]; } const baseGenesisState: object = {}; @@ -27,6 +29,9 @@ export const GenesisState = { for (const v of message.AcceptedDomainList) { AcceptedDomain.encode(v!, writer.uint32(26).fork()).ldelim(); } + for (const v of message.ArticleList) { + Article.encode(v!, writer.uint32(34).fork()).ldelim(); + } return writer; }, @@ -36,6 +41,7 @@ export const GenesisState = { const message = { ...baseGenesisState } as GenesisState; message.PublisherList = []; message.AcceptedDomainList = []; + message.ArticleList = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -50,6 +56,9 @@ export const GenesisState = { AcceptedDomain.decode(reader, reader.uint32()) ); break; + case 4: + message.ArticleList.push(Article.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -62,6 +71,7 @@ export const GenesisState = { const message = { ...baseGenesisState } as GenesisState; message.PublisherList = []; message.AcceptedDomainList = []; + message.ArticleList = []; if (object.params !== undefined && object.params !== null) { message.params = Params.fromJSON(object.params); } else { @@ -80,6 +90,11 @@ export const GenesisState = { message.AcceptedDomainList.push(AcceptedDomain.fromJSON(e)); } } + if (object.ArticleList !== undefined && object.ArticleList !== null) { + for (const e of object.ArticleList) { + message.ArticleList.push(Article.fromJSON(e)); + } + } return message; }, @@ -101,6 +116,13 @@ export const GenesisState = { } else { obj.AcceptedDomainList = []; } + if (message.ArticleList) { + obj.ArticleList = message.ArticleList.map((e) => + e ? Article.toJSON(e) : undefined + ); + } else { + obj.ArticleList = []; + } return obj; }, @@ -108,6 +130,7 @@ export const GenesisState = { const message = { ...baseGenesisState } as GenesisState; message.PublisherList = []; message.AcceptedDomainList = []; + message.ArticleList = []; if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); } else { @@ -126,6 +149,11 @@ export const GenesisState = { message.AcceptedDomainList.push(AcceptedDomain.fromPartial(e)); } } + if (object.ArticleList !== undefined && object.ArticleList !== null) { + for (const e of object.ArticleList) { + message.ArticleList.push(Article.fromPartial(e)); + } + } return message; }, }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 40cc1ba4..0a633940 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -247,33 +247,33 @@ export default { } } }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgRevealSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgSubmitScavenge(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, @@ -291,29 +291,29 @@ export default { } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgRevealSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, - async MsgRevealSolution({ rootGetters }, { value }) { + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgSubmitScavenge(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index c023b54d..44bd4fda 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -5,14 +5,14 @@ import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; import { MsgCommitSolution } from "./types/scavenge/tx"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; const types = [ ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ]; export const MissingWalletError = new Error("wallet is required"); @@ -46,8 +46,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/genesis.go b/x/cointrunk/genesis.go index 4b85532c..d9eeeabf 100644 --- a/x/cointrunk/genesis.go +++ b/x/cointrunk/genesis.go @@ -16,6 +16,11 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) for _, acceptedDomain := range genState.AcceptedDomainList { k.SetAcceptedDomain(ctx, acceptedDomain) } + + for _, article := range genState.ArticleList { + k.SetArticle(ctx, article) + } + // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) } @@ -26,6 +31,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.Params = k.GetParams(ctx) genesis.PublisherList = k.GetAllPublisher(ctx) genesis.AcceptedDomainList = k.GetAllAcceptedDomain(ctx) + genesis.ArticleList = k.GetAllArticles(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/cointrunk/keeper/cointrunk.go b/x/cointrunk/keeper/cointrunk.go index dceb35fe..837efa38 100644 --- a/x/cointrunk/keeper/cointrunk.go +++ b/x/cointrunk/keeper/cointrunk.go @@ -97,6 +97,20 @@ func (k Keeper) GetArticlesByPrefix(ctx sdk.Context, pre string) (list []types.A return } +func (k Keeper) GetAllArticles(ctx sdk.Context) (list []types.Article) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ArticleKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Article + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} + func (k Keeper) SetArticle(ctx sdk.Context, article types.Article) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.GenerateArticlePrefix(ctx))) hash := md5.Sum([]byte(article.Url)) diff --git a/x/cointrunk/types/genesis.pb.go b/x/cointrunk/types/genesis.pb.go index c342a702..7e3f9d18 100644 --- a/x/cointrunk/types/genesis.pb.go +++ b/x/cointrunk/types/genesis.pb.go @@ -28,6 +28,7 @@ type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` PublisherList []Publisher `protobuf:"bytes,2,rep,name=PublisherList,proto3" json:"PublisherList"` AcceptedDomainList []AcceptedDomain `protobuf:"bytes,3,rep,name=AcceptedDomainList,proto3" json:"AcceptedDomainList"` + ArticleList []Article `protobuf:"bytes,4,rep,name=ArticleList,proto3" json:"ArticleList"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -84,6 +85,13 @@ func (m *GenesisState) GetAcceptedDomainList() []AcceptedDomain { return nil } +func (m *GenesisState) GetArticleList() []Article { + if m != nil { + return m.ArticleList + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "bze.cointrunk.GenesisState") } @@ -91,25 +99,27 @@ func init() { func init() { proto.RegisterFile("cointrunk/genesis.proto", fileDescriptor_20104b77ac07c6a4) } var fileDescriptor_20104b77ac07c6a4 = []byte{ - // 281 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xce, 0xcf, 0xcc, - 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x4b, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, - 0xe7, 0x83, 0x65, 0xf4, 0x41, 0x2c, 0x88, 0x22, 0x29, 0x31, 0x84, 0xee, 0x82, 0xc4, 0xa2, 0xc4, - 0x5c, 0xa8, 0x66, 0x29, 0x49, 0x24, 0xf1, 0xd2, 0xa4, 0x9c, 0xcc, 0xe2, 0x8c, 0xd4, 0x22, 0xa8, - 0x94, 0x3c, 0x42, 0x2a, 0x31, 0x39, 0x39, 0xb5, 0xa0, 0x24, 0x35, 0x25, 0x3e, 0x25, 0x3f, 0x37, - 0x31, 0x33, 0x0f, 0xa2, 0x40, 0xe9, 0x1e, 0x23, 0x17, 0x8f, 0x3b, 0xc4, 0x29, 0xc1, 0x25, 0x89, - 0x25, 0xa9, 0x42, 0xc6, 0x5c, 0x6c, 0x10, 0xc3, 0x25, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0x44, - 0xf5, 0x50, 0x9c, 0xa6, 0x17, 0x00, 0x96, 0x74, 0x62, 0x39, 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xaa, - 0x54, 0xc8, 0x85, 0x8b, 0x37, 0x00, 0x66, 0xb3, 0x4f, 0x66, 0x71, 0x89, 0x04, 0x93, 0x02, 0xb3, - 0x06, 0xb7, 0x91, 0x04, 0xba, 0x5e, 0x98, 0x1a, 0xa8, 0x76, 0x54, 0x4d, 0x42, 0xc1, 0x5c, 0x42, - 0x8e, 0x50, 0x47, 0xba, 0x80, 0xdd, 0x08, 0x36, 0x8a, 0x19, 0x6c, 0x94, 0x2c, 0x9a, 0x51, 0xa8, - 0x0a, 0xa1, 0xe6, 0x61, 0xd1, 0xee, 0xe4, 0x71, 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, 0x7a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x49, 0x55, - 0xa9, 0xba, 0x89, 0x39, 0x05, 0x19, 0x89, 0x25, 0xa9, 0x89, 0x60, 0x9e, 0x7e, 0x85, 0x3e, 0x22, - 0xe8, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x21, 0x66, 0x0c, 0x08, 0x00, 0x00, 0xff, - 0xff, 0xbf, 0xf4, 0x58, 0xab, 0xc5, 0x01, 0x00, 0x00, + // 314 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xbd, 0x4e, 0xeb, 0x30, + 0x00, 0x85, 0x93, 0xb6, 0xea, 0xe0, 0xdc, 0x2e, 0xd6, 0xa5, 0x84, 0x48, 0xb8, 0x15, 0x53, 0x17, + 0x1c, 0xa9, 0xdd, 0x91, 0x5a, 0x55, 0x82, 0x81, 0xa1, 0xa2, 0x1b, 0x0b, 0x72, 0x52, 0x2b, 0xb1, + 0x48, 0xe2, 0x28, 0x71, 0x24, 0xe8, 0x53, 0xf0, 0x04, 0x3c, 0x4f, 0xc7, 0x8e, 0x4c, 0x08, 0x25, + 0x2f, 0x82, 0xb0, 0x5d, 0xf2, 0x23, 0xb6, 0x24, 0xe7, 0x7c, 0x5f, 0x8e, 0x0d, 0xce, 0x7d, 0xce, + 0x12, 0x91, 0x15, 0xc9, 0xb3, 0x1b, 0xd0, 0x84, 0xe6, 0x2c, 0xc7, 0x69, 0xc6, 0x05, 0x87, 0x23, + 0x6f, 0x4f, 0xf1, 0x6f, 0xe8, 0xfc, 0x0f, 0x78, 0xc0, 0x65, 0xe2, 0xfe, 0x3c, 0xa9, 0x92, 0x33, + 0xae, 0xe9, 0x94, 0x64, 0x24, 0xd6, 0xb0, 0x73, 0xd1, 0xf8, 0x5e, 0x78, 0x11, 0xcb, 0x43, 0x9a, + 0xe9, 0x68, 0x52, 0x47, 0xc4, 0xf7, 0x69, 0x2a, 0xe8, 0xee, 0x69, 0xc7, 0x63, 0xc2, 0x12, 0x5d, + 0x68, 0x2c, 0x22, 0x99, 0x60, 0x7e, 0x44, 0x55, 0x70, 0xf5, 0xde, 0x03, 0xff, 0x6e, 0xd5, 0xc6, + 0xad, 0x20, 0x82, 0xc2, 0x05, 0x18, 0xaa, 0xbf, 0xda, 0xe6, 0xd4, 0x9c, 0x59, 0xf3, 0x33, 0xdc, + 0xda, 0x8c, 0x37, 0x32, 0x5c, 0x0d, 0x0e, 0x9f, 0x13, 0xe3, 0x41, 0x57, 0xe1, 0x1a, 0x8c, 0x36, + 0xa7, 0x49, 0xf7, 0x2c, 0x17, 0x76, 0x6f, 0xda, 0x9f, 0x59, 0x73, 0xbb, 0xcb, 0x9e, 0x3a, 0x1a, + 0x6f, 0x43, 0x70, 0x0b, 0xe0, 0x52, 0xaf, 0x5f, 0xcb, 0xf1, 0x52, 0xd5, 0x97, 0xaa, 0xcb, 0x8e, + 0xaa, 0x5d, 0xd4, 0xbe, 0x3f, 0x70, 0x78, 0x03, 0xac, 0xa5, 0x3a, 0xb1, 0xb4, 0x0d, 0xa4, 0x6d, + 0xdc, 0xb5, 0xa9, 0x86, 0xd6, 0x34, 0x81, 0xd5, 0xdd, 0xa1, 0x44, 0xe6, 0xb1, 0x44, 0xe6, 0x57, + 0x89, 0xcc, 0xb7, 0x0a, 0x19, 0xc7, 0x0a, 0x19, 0x1f, 0x15, 0x32, 0x1e, 0x71, 0xc0, 0x44, 0x58, + 0x78, 0xd8, 0xe7, 0xb1, 0xeb, 0xed, 0xe9, 0x35, 0x89, 0xd2, 0x90, 0x08, 0x4a, 0xe4, 0x9b, 0xfb, + 0xe2, 0xd6, 0x57, 0x2e, 0x5e, 0x53, 0x9a, 0x7b, 0x43, 0x79, 0xe3, 0x8b, 0xef, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x68, 0xec, 0x36, 0x49, 0x1e, 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.ArticleList) > 0 { + for iNdEx := len(m.ArticleList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ArticleList[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.AcceptedDomainList) > 0 { for iNdEx := len(m.AcceptedDomainList) - 1; iNdEx >= 0; iNdEx-- { { @@ -204,6 +228,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.ArticleList) > 0 { + for _, e := range m.ArticleList { + 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 ArticleList", 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.ArticleList = append(m.ArticleList, Article{}) + if err := m.ArticleList[len(m.ArticleList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) From 3e310d78e9e83e0174213bcab15489c711f97a8b Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 24 Nov 2022 18:25:20 +0200 Subject: [PATCH 15/54] moved gov related cli to its own file --- x/cointrunk/client/cli/gov.go | 143 ++++++++++++++++++++++++++++++++++ x/cointrunk/client/cli/tx.go | 133 ------------------------------- 2 files changed, 143 insertions(+), 133 deletions(-) create mode 100644 x/cointrunk/client/cli/gov.go diff --git a/x/cointrunk/client/cli/gov.go b/x/cointrunk/client/cli/gov.go new file mode 100644 index 00000000..a55ffed3 --- /dev/null +++ b/x/cointrunk/client/cli/gov.go @@ -0,0 +1,143 @@ +package cli + +import ( + "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + govcli "github.com/cosmos/cosmos-sdk/x/gov/client/cli" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/spf13/cobra" +) + +const ( + ActiveFlag = "active" +) + +func NewCmdSubmitAcceptedDomainProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "accepted-domain [domain-name]", + Args: cobra.ExactArgs(1), + Short: "Submit an accepted domain proposal", + Long: "Submit an accepted domain proposal along with an initial deposit.\n" + + "Please specify the domain you want to add (ex: domain.com)\n", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + title, err := cmd.Flags().GetString(govcli.FlagTitle) + if err != nil { + return err + } + + description, err := cmd.Flags().GetString(govcli.FlagDescription) + if err != nil { + return err + } + + domain := args[0] + active, err := cmd.Flags().GetBool(ActiveFlag) + if err != nil { + return err + } + + content := types.NewAcceptedDomainProposal(title, description, domain, active) + + from := clientCtx.GetFromAddress() + + depositStr, err := cmd.Flags().GetString(govcli.FlagDeposit) + if err != nil { + return err + } + deposit, err := sdk.ParseCoinsNormalized(depositStr) + if err != nil { + return err + } + + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + if err = msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().String(govcli.FlagTitle, "", "title of proposal") + cmd.Flags().String(govcli.FlagDescription, "", "description of proposal") + cmd.Flags().String(govcli.FlagDeposit, "", "deposit of proposal") + cmd.Flags().Bool(ActiveFlag, true, "whether or not the proposed domain to be active") + + return cmd +} + +func NewCmdSubmitPublisherProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "publisher [name] [address]", + Args: cobra.ExactArgs(2), + Short: "Submit a publisher proposal", + Long: "Submit a publishers proposal along with an initial deposit.\n" + + "Please specify the public name of the publisher\n" + + "Please specify the address to become a publisher\n", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + title, err := cmd.Flags().GetString(govcli.FlagTitle) + if err != nil { + return err + } + + description, err := cmd.Flags().GetString(govcli.FlagDescription) + if err != nil { + return err + } + + name := args[0] + address := args[1] + active, err := cmd.Flags().GetBool(ActiveFlag) + if err != nil { + return err + } + + content := types.NewPublisherProposal(title, description, name, address, active) + + from := clientCtx.GetFromAddress() + + depositStr, err := cmd.Flags().GetString(govcli.FlagDeposit) + if err != nil { + return err + } + deposit, err := sdk.ParseCoinsNormalized(depositStr) + if err != nil { + return err + } + + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + if err = msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().String(govcli.FlagTitle, "", "title of proposal") + cmd.Flags().String(govcli.FlagDescription, "", "description of proposal") + cmd.Flags().String(govcli.FlagDeposit, "", "deposit of proposal") + cmd.Flags().Bool(ActiveFlag, true, "whether or not the proposed publisher to be active") + + return cmd +} diff --git a/x/cointrunk/client/cli/tx.go b/x/cointrunk/client/cli/tx.go index 8afc917c..d6b486c4 100644 --- a/x/cointrunk/client/cli/tx.go +++ b/x/cointrunk/client/cli/tx.go @@ -2,10 +2,6 @@ package cli import ( "fmt" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - govcli "github.com/cosmos/cosmos-sdk/x/gov/client/cli" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "time" "github.com/spf13/cobra" @@ -20,7 +16,6 @@ var ( ) const ( - ActiveFlag = "active" flagPacketTimeoutTimestamp = "packet-timeout-timestamp" listSeparator = "," ) @@ -40,131 +35,3 @@ func GetTxCmd() *cobra.Command { return cmd } - -func NewCmdSubmitAcceptedDomainProposal() *cobra.Command { - cmd := &cobra.Command{ - Use: "accepted-domain [domain-name]", - Args: cobra.ExactArgs(1), - Short: "Submit an accepted domain proposal", - Long: "Submit an accepted domain proposal along with an initial deposit.\n" + - "Please specify the domain you want to add (ex: domain.com)\n", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - title, err := cmd.Flags().GetString(govcli.FlagTitle) - if err != nil { - return err - } - - description, err := cmd.Flags().GetString(govcli.FlagDescription) - if err != nil { - return err - } - - domain := args[0] - active, err := cmd.Flags().GetBool(ActiveFlag) - if err != nil { - return err - } - - content := types.NewAcceptedDomainProposal(title, description, domain, active) - - from := clientCtx.GetFromAddress() - - depositStr, err := cmd.Flags().GetString(govcli.FlagDeposit) - if err != nil { - return err - } - deposit, err := sdk.ParseCoinsNormalized(depositStr) - if err != nil { - return err - } - - msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) - if err != nil { - return err - } - - if err = msg.ValidateBasic(); err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(govcli.FlagTitle, "", "title of proposal") - cmd.Flags().String(govcli.FlagDescription, "", "description of proposal") - cmd.Flags().String(govcli.FlagDeposit, "", "deposit of proposal") - cmd.Flags().Bool(ActiveFlag, true, "whether or not the proposed domain to be active") - - return cmd -} - -func NewCmdSubmitPublisherProposal() *cobra.Command { - cmd := &cobra.Command{ - Use: "publisher [name] [address]", - Args: cobra.ExactArgs(2), - Short: "Submit a publisher proposal", - Long: "Submit a publishers proposal along with an initial deposit.\n" + - "Please specify the public name of the publisher\n" + - "Please specify the address to become a publisher\n", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - title, err := cmd.Flags().GetString(govcli.FlagTitle) - if err != nil { - return err - } - - description, err := cmd.Flags().GetString(govcli.FlagDescription) - if err != nil { - return err - } - - name := args[0] - address := args[1] - active, err := cmd.Flags().GetBool(ActiveFlag) - if err != nil { - return err - } - - content := types.NewPublisherProposal(title, description, name, address, active) - - from := clientCtx.GetFromAddress() - - depositStr, err := cmd.Flags().GetString(govcli.FlagDeposit) - if err != nil { - return err - } - deposit, err := sdk.ParseCoinsNormalized(depositStr) - if err != nil { - return err - } - - msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) - if err != nil { - return err - } - - if err = msg.ValidateBasic(); err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(govcli.FlagTitle, "", "title of proposal") - cmd.Flags().String(govcli.FlagDescription, "", "description of proposal") - cmd.Flags().String(govcli.FlagDeposit, "", "deposit of proposal") - cmd.Flags().Bool(ActiveFlag, true, "whether or not the proposed publisher to be active") - - return cmd -} From 7a58f178b61c0664c053cf217deb8233fc0f55e9 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Fri, 25 Nov 2022 18:57:32 +0200 Subject: [PATCH 16/54] added coins burning proposal --- app/app.go | 2 + proto/cointrunk/burn_coins_proposal.proto | 10 + .../bze-alphateam/bze/bze.cointrunk/index.ts | 4 +- .../types/cointrunk/burn_coins_proposal.ts | 93 +++++ .../bze-alphateam/bze/bze.scavenge/index.ts | 40 +- .../bze/bze.scavenge/module/index.ts | 6 +- x/cointrunk/client/cli/gov.go | 55 +++ x/cointrunk/client/proposal_handler.go | 1 + x/cointrunk/keeper/gov.go | 35 ++ x/cointrunk/keeper/keeper.go | 5 +- x/cointrunk/proposal_handler.go | 24 +- x/cointrunk/types/burn_coins_proposal.pb.go | 369 ++++++++++++++++++ x/cointrunk/types/codec.go | 2 + x/cointrunk/types/expected_keepers.go | 3 +- x/cointrunk/types/genesis.go | 1 + x/cointrunk/types/gov.go | 24 ++ 16 files changed, 627 insertions(+), 47 deletions(-) create mode 100644 proto/cointrunk/burn_coins_proposal.proto create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/burn_coins_proposal.ts create mode 100644 x/cointrunk/keeper/gov.go create mode 100644 x/cointrunk/types/burn_coins_proposal.pb.go diff --git a/app/app.go b/app/app.go index 67c683e4..e8b3af9e 100644 --- a/app/app.go +++ b/app/app.go @@ -121,6 +121,7 @@ func getGovProposalHandlers() []govclient.ProposalHandler { ibcclientclient.UpgradeProposalHandler, cointrunkmoduleclient.AcceptedDomainProposalHandler, cointrunkmoduleclient.PublisherProposalHandler, + cointrunkmoduleclient.BurnCoinsProposalHandler, // this line is used by starport scaffolding # stargate/app/govProposalHandler ) @@ -359,6 +360,7 @@ func New( app.GetSubspace(cointrunkmoduletypes.ModuleName), app.BankKeeper, app.GovKeeper, + app.AccountKeeper, ) scavengeModule := scavengemodule.NewAppModule(appCodec, app.ScavengeKeeper) diff --git a/proto/cointrunk/burn_coins_proposal.proto b/proto/cointrunk/burn_coins_proposal.proto new file mode 100644 index 00000000..148419dc --- /dev/null +++ b/proto/cointrunk/burn_coins_proposal.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +package bze.cointrunk; + +option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; + +message BurnCoinsProposal { + + string title = 1; + string description = 2; +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts index bbb43df4..d5167a2c 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts @@ -3,12 +3,13 @@ import { txClient, queryClient, MissingWalletError , registry} from './module' import { AcceptedDomain } from "./module/types/cointrunk/accepted_domain" import { AcceptedDomainProposal } from "./module/types/cointrunk/accepted_domain_proposal" import { Article } from "./module/types/cointrunk/article" +import { BurnCoinsProposal } from "./module/types/cointrunk/burn_coins_proposal" import { Params } from "./module/types/cointrunk/params" import { Publisher } from "./module/types/cointrunk/publisher" import { PublisherProposal } from "./module/types/cointrunk/publisher_proposal" -export { AcceptedDomain, AcceptedDomainProposal, Article, Params, Publisher, PublisherProposal }; +export { AcceptedDomain, AcceptedDomainProposal, Article, BurnCoinsProposal, Params, Publisher, PublisherProposal }; async function initTxClient(vuexGetters) { return await txClient(vuexGetters['common/wallet/signer'], { @@ -56,6 +57,7 @@ const getDefaultState = () => { AcceptedDomain: getStructure(AcceptedDomain.fromPartial({})), AcceptedDomainProposal: getStructure(AcceptedDomainProposal.fromPartial({})), Article: getStructure(Article.fromPartial({})), + BurnCoinsProposal: getStructure(BurnCoinsProposal.fromPartial({})), Params: getStructure(Params.fromPartial({})), Publisher: getStructure(Publisher.fromPartial({})), PublisherProposal: getStructure(PublisherProposal.fromPartial({})), diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/burn_coins_proposal.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/burn_coins_proposal.ts new file mode 100644 index 00000000..9ccd7ddb --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/burn_coins_proposal.ts @@ -0,0 +1,93 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk"; + +export interface BurnCoinsProposal { + title: string; + description: string; +} + +const baseBurnCoinsProposal: object = { title: "", description: "" }; + +export const BurnCoinsProposal = { + encode(message: BurnCoinsProposal, writer: Writer = Writer.create()): Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): BurnCoinsProposal { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBurnCoinsProposal } as BurnCoinsProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BurnCoinsProposal { + const message = { ...baseBurnCoinsProposal } as BurnCoinsProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + return message; + }, + + toJSON(message: BurnCoinsProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + return obj; + }, + + fromPartial(object: DeepPartial): BurnCoinsProposal { + const message = { ...baseBurnCoinsProposal } as BurnCoinsProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 0a633940..474b327f 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,21 +232,6 @@ export default { }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) - } - } - }, async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -277,20 +262,22 @@ export default { } } }, - - async MsgCommitSolution({ rootGetters }, { value }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) const msg = await txClient.msgCommitSolution(value) - return msg + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result } catch (e) { if (e == MissingWalletError) { throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + }else{ + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) @@ -317,6 +304,19 @@ export default { } } }, + async MsgCommitSolution({ rootGetters }, { value }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgCommitSolution(value) + return msg + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + } else{ + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + } + } + }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 44bd4fda..5f72a96b 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; +import { MsgCommitSolution } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], + ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), + msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/client/cli/gov.go b/x/cointrunk/client/cli/gov.go index a55ffed3..78ed974c 100644 --- a/x/cointrunk/client/cli/gov.go +++ b/x/cointrunk/client/cli/gov.go @@ -141,3 +141,58 @@ func NewCmdSubmitPublisherProposal() *cobra.Command { return cmd } + +func NewCmdSubmitBurnCoinsProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "coins-burn", + Args: cobra.ExactArgs(0), + Short: "Submit coins burning proposal", + Long: "Submit coins burning proposal along with an initial deposit.\n", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + title, err := cmd.Flags().GetString(govcli.FlagTitle) + if err != nil { + return err + } + + description, err := cmd.Flags().GetString(govcli.FlagDescription) + if err != nil { + return err + } + + content := types.NewBurnCoinsProposal(title, description) + + from := clientCtx.GetFromAddress() + + depositStr, err := cmd.Flags().GetString(govcli.FlagDeposit) + if err != nil { + return err + } + deposit, err := sdk.ParseCoinsNormalized(depositStr) + if err != nil { + return err + } + + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + if err = msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().String(govcli.FlagTitle, "", "title of proposal") + cmd.Flags().String(govcli.FlagDescription, "", "description of proposal") + cmd.Flags().String(govcli.FlagDeposit, "", "deposit of proposal") + + return cmd +} diff --git a/x/cointrunk/client/proposal_handler.go b/x/cointrunk/client/proposal_handler.go index 23a2c1f3..efb55899 100644 --- a/x/cointrunk/client/proposal_handler.go +++ b/x/cointrunk/client/proposal_handler.go @@ -11,6 +11,7 @@ import ( var AcceptedDomainProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitAcceptedDomainProposal, emptyRestHandler) var PublisherProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitPublisherProposal, emptyRestHandler) +var BurnCoinsProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitBurnCoinsProposal, emptyRestHandler) func emptyRestHandler(client.Context) govrest.ProposalRESTHandler { return govrest.ProposalRESTHandler{ diff --git a/x/cointrunk/keeper/gov.go b/x/cointrunk/keeper/gov.go new file mode 100644 index 00000000..99d195c7 --- /dev/null +++ b/x/cointrunk/keeper/gov.go @@ -0,0 +1,35 @@ +package keeper + +import ( + "github.com/bze-alphateam/bze/x/cointrunk/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) HandlePublisherProposal(ctx sdk.Context, proposal *types.PublisherProposal) error { + _ = sdk.MustAccAddressFromBech32(proposal.Address) + publisher, _ := k.GetPublisher(ctx, proposal.Address) + publisher.Name = proposal.Name + publisher.Active = proposal.Active + publisher.Address = proposal.Address + k.SetPublisher(ctx, publisher) + return nil +} + +func (k Keeper) HandleAcceptedDomainProposal(ctx sdk.Context, proposal *types.AcceptedDomainProposal) error { + acceptedDomain, _ := k.GetAcceptedDomain(ctx, proposal.Domain) + acceptedDomain.Domain = proposal.Domain + acceptedDomain.Active = proposal.Active + k.SetAcceptedDomain(ctx, acceptedDomain) + return nil +} + +func (k Keeper) HandleBurnCoinsProposal(ctx sdk.Context, proposal *types.BurnCoinsProposal) error { + moduleAcc := k.accKeeper.GetModuleAccount(ctx, types.ModuleName) + coins := k.bankKeeper.GetAllBalances(ctx, moduleAcc.GetAddress()) + err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, coins) + if err != nil { + panic(err) + } + //TODO: save burn events so we can brag about it + return nil +} diff --git a/x/cointrunk/keeper/keeper.go b/x/cointrunk/keeper/keeper.go index 9b9b44ae..6742e59c 100644 --- a/x/cointrunk/keeper/keeper.go +++ b/x/cointrunk/keeper/keeper.go @@ -20,6 +20,7 @@ type ( bankKeeper types.BankKeeper govKeeper types.GovKeeper + accKeeper types.AccountKeeper } ) @@ -29,7 +30,7 @@ func NewKeeper( memKey sdk.StoreKey, ps paramtypes.Subspace, - bankKeeper types.BankKeeper, govKeeper types.GovKeeper, + bankKeeper types.BankKeeper, govKeeper types.GovKeeper, accKeeper types.AccountKeeper, ) *Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -42,7 +43,7 @@ func NewKeeper( storeKey: storeKey, memKey: memKey, paramstore: ps, - bankKeeper: bankKeeper, govKeeper: govKeeper, + bankKeeper: bankKeeper, govKeeper: govKeeper, accKeeper: accKeeper, } } diff --git a/x/cointrunk/proposal_handler.go b/x/cointrunk/proposal_handler.go index 6ef5ccbc..a9024e7b 100644 --- a/x/cointrunk/proposal_handler.go +++ b/x/cointrunk/proposal_handler.go @@ -12,29 +12,13 @@ func NewCointrunkProposalHandler(k keeper.Keeper) govtypes.Handler { return func(ctx sdk.Context, content govtypes.Content) error { switch c := content.(type) { case *types.PublisherProposal: - return handlePublisherProposal(ctx, k, c) + return k.HandlePublisherProposal(ctx, c) case *types.AcceptedDomainProposal: - return handleAcceptedDomainProposal(ctx, k, c) + return k.HandleAcceptedDomainProposal(ctx, c) + case *types.BurnCoinsProposal: + return k.HandleBurnCoinsProposal(ctx, c) default: return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized cointrunk proposal content type: %T", c) } } } - -func handlePublisherProposal(ctx sdk.Context, k keeper.Keeper, proposal *types.PublisherProposal) error { - _ = sdk.MustAccAddressFromBech32(proposal.Address) - publisher, _ := k.GetPublisher(ctx, proposal.Address) - publisher.Name = proposal.Name - publisher.Active = proposal.Active - publisher.Address = proposal.Address - k.SetPublisher(ctx, publisher) - return nil -} - -func handleAcceptedDomainProposal(ctx sdk.Context, k keeper.Keeper, proposal *types.AcceptedDomainProposal) error { - acceptedDomain, _ := k.GetAcceptedDomain(ctx, proposal.Domain) - acceptedDomain.Domain = proposal.Domain - acceptedDomain.Active = proposal.Active - k.SetAcceptedDomain(ctx, acceptedDomain) - return nil -} diff --git a/x/cointrunk/types/burn_coins_proposal.pb.go b/x/cointrunk/types/burn_coins_proposal.pb.go new file mode 100644 index 00000000..676b7030 --- /dev/null +++ b/x/cointrunk/types/burn_coins_proposal.pb.go @@ -0,0 +1,369 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cointrunk/burn_coins_proposal.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/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 BurnCoinsProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (m *BurnCoinsProposal) Reset() { *m = BurnCoinsProposal{} } +func (m *BurnCoinsProposal) String() string { return proto.CompactTextString(m) } +func (*BurnCoinsProposal) ProtoMessage() {} +func (*BurnCoinsProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_c4370fe012c32bb1, []int{0} +} +func (m *BurnCoinsProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BurnCoinsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BurnCoinsProposal.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 *BurnCoinsProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_BurnCoinsProposal.Merge(m, src) +} +func (m *BurnCoinsProposal) XXX_Size() int { + return m.Size() +} +func (m *BurnCoinsProposal) XXX_DiscardUnknown() { + xxx_messageInfo_BurnCoinsProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_BurnCoinsProposal proto.InternalMessageInfo + +func (m *BurnCoinsProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *BurnCoinsProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func init() { + proto.RegisterType((*BurnCoinsProposal)(nil), "bze.cointrunk.BurnCoinsProposal") +} + +func init() { + proto.RegisterFile("cointrunk/burn_coins_proposal.proto", fileDescriptor_c4370fe012c32bb1) +} + +var fileDescriptor_c4370fe012c32bb1 = []byte{ + // 189 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0xcf, 0xcc, + 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x2a, 0x2d, 0xca, 0x8b, 0x07, 0x71, 0x8b, 0xe3, 0x0b, + 0x8a, 0xf2, 0x0b, 0xf2, 0x8b, 0x13, 0x73, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x78, 0x93, + 0xaa, 0x52, 0xf5, 0xe0, 0x0a, 0x95, 0xbc, 0xb9, 0x04, 0x9d, 0x4a, 0x8b, 0xf2, 0x9c, 0x41, 0x4a, + 0x03, 0xa0, 0x2a, 0x85, 0x44, 0xb8, 0x58, 0x4b, 0x32, 0x4b, 0x72, 0x52, 0x25, 0x18, 0x15, 0x18, + 0x35, 0x38, 0x83, 0x20, 0x1c, 0x21, 0x05, 0x2e, 0xee, 0x94, 0xd4, 0xe2, 0xe4, 0xa2, 0xcc, 0x82, + 0x92, 0xcc, 0xfc, 0x3c, 0x09, 0x26, 0xb0, 0x1c, 0xb2, 0x90, 0x93, 0xc7, 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, 0xe9, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, + 0xe7, 0xea, 0x27, 0x55, 0xa5, 0xea, 0x26, 0xe6, 0x14, 0x64, 0x24, 0x96, 0xa4, 0x26, 0x82, 0x79, + 0xfa, 0x15, 0xfa, 0x08, 0x97, 0x97, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x6b, 0x0c, + 0x08, 0x00, 0x00, 0xff, 0xff, 0x36, 0x54, 0x9e, 0xd5, 0xd3, 0x00, 0x00, 0x00, +} + +func (m *BurnCoinsProposal) 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 *BurnCoinsProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BurnCoinsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintBurnCoinsProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintBurnCoinsProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintBurnCoinsProposal(dAtA []byte, offset int, v uint64) int { + offset -= sovBurnCoinsProposal(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BurnCoinsProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovBurnCoinsProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovBurnCoinsProposal(uint64(l)) + } + return n +} + +func sovBurnCoinsProposal(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBurnCoinsProposal(x uint64) (n int) { + return sovBurnCoinsProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BurnCoinsProposal) 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 ErrIntOverflowBurnCoinsProposal + } + 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: BurnCoinsProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BurnCoinsProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBurnCoinsProposal + } + 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 ErrInvalidLengthBurnCoinsProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBurnCoinsProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBurnCoinsProposal + } + 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 ErrInvalidLengthBurnCoinsProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBurnCoinsProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBurnCoinsProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBurnCoinsProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBurnCoinsProposal(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, ErrIntOverflowBurnCoinsProposal + } + 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, ErrIntOverflowBurnCoinsProposal + } + 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, ErrIntOverflowBurnCoinsProposal + } + 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, ErrInvalidLengthBurnCoinsProposal + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBurnCoinsProposal + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBurnCoinsProposal + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBurnCoinsProposal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBurnCoinsProposal = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBurnCoinsProposal = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/cointrunk/types/codec.go b/x/cointrunk/types/codec.go index b8fdd9e4..f9ac6d3c 100644 --- a/x/cointrunk/types/codec.go +++ b/x/cointrunk/types/codec.go @@ -12,6 +12,7 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&AcceptedDomainProposal{}, "cointrunk/AcceptedDomainProposal", nil) cdc.RegisterConcrete(&PublisherProposal{}, "cointrunk/PublisherProposal", nil) + cdc.RegisterConcrete(&BurnCoinsProposal{}, "cointrunk/BurnCoinsProposal", nil) cdc.RegisterConcrete(&MsgAddArticle{}, "cointrunk/AddArticle", nil) // this line is used by starport scaffolding # 2 } @@ -25,6 +26,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { (*govtypes.Content)(nil), &AcceptedDomainProposal{}, &PublisherProposal{}, + &BurnCoinsProposal{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/cointrunk/types/expected_keepers.go b/x/cointrunk/types/expected_keepers.go index a9ba2cc2..2b006f63 100644 --- a/x/cointrunk/types/expected_keepers.go +++ b/x/cointrunk/types/expected_keepers.go @@ -12,12 +12,13 @@ type GovKeeper interface { // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI // 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 + GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins BurnCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error // Methods imported from bank should be defined here diff --git a/x/cointrunk/types/genesis.go b/x/cointrunk/types/genesis.go index bd0e07cc..855ce2dc 100644 --- a/x/cointrunk/types/genesis.go +++ b/x/cointrunk/types/genesis.go @@ -10,6 +10,7 @@ func DefaultGenesis() *GenesisState { Params: DefaultParams(), PublisherList: []Publisher{}, AcceptedDomainList: []AcceptedDomain{}, + ArticleList: []Article{}, } } diff --git a/x/cointrunk/types/gov.go b/x/cointrunk/types/gov.go index 56660226..5f48b9eb 100644 --- a/x/cointrunk/types/gov.go +++ b/x/cointrunk/types/gov.go @@ -10,6 +10,7 @@ import ( const ( ProposalTypeAcceptedDomain = "AcceptedDomainProposal" ProposalTypePublisher = "PublisherProposal" + ProposalTypeBurnCoins = "BurnCoinsProposal" ) func init() { @@ -17,11 +18,14 @@ func init() { govtypes.RegisterProposalTypeCodec(&AcceptedDomainProposal{}, "cointrunk/AcceptedDomainProposal") govtypes.RegisterProposalType(ProposalTypePublisher) govtypes.RegisterProposalTypeCodec(&PublisherProposal{}, "cointrunk/PublisherProposal") + govtypes.RegisterProposalType(ProposalTypeBurnCoins) + govtypes.RegisterProposalTypeCodec(&BurnCoinsProposal{}, "cointrunk/BurnCoinsProposal") } var ( _ govtypes.Content = &AcceptedDomainProposal{} _ govtypes.Content = &PublisherProposal{} + _ govtypes.Content = &BurnCoinsProposal{} ) func NewAcceptedDomainProposal(title, description, domain string, active bool) govtypes.Content { @@ -79,3 +83,23 @@ func (m *PublisherProposal) ValidateBasic() error { return nil } + +func NewBurnCoinsProposal(title, description string) govtypes.Content { + return &BurnCoinsProposal{ + Title: title, + Description: description, + } +} + +func (m *BurnCoinsProposal) ProposalRoute() string { return RouterKey } + +func (m *BurnCoinsProposal) ProposalType() string { return ProposalTypeBurnCoins } + +func (m *BurnCoinsProposal) ValidateBasic() error { + err := govtypes.ValidateAbstract(m) + if err != nil { + return err + } + + return nil +} From 673560545e808ac3c4901c3e582ae48b6808af91 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Fri, 25 Nov 2022 21:08:52 +0200 Subject: [PATCH 17/54] save burned coins so we can brag about it --- proto/cointrunk/burned_coins.proto | 9 + proto/cointrunk/genesis.proto | 2 + .../bze-alphateam/bze/bze.cointrunk/index.ts | 4 +- .../module/types/cointrunk/burned_coins.ts | 74 +++++ .../module/types/cointrunk/genesis.ts | 38 ++- .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +- .../bze/bze.scavenge/module/index.ts | 12 +- x/cointrunk/genesis.go | 5 + x/cointrunk/keeper/cointrunk.go | 24 ++ x/cointrunk/keeper/gov.go | 10 +- x/cointrunk/types/burned_coins.pb.go | 314 ++++++++++++++++++ x/cointrunk/types/genesis.go | 1 + x/cointrunk/types/genesis.pb.go | 106 ++++-- x/cointrunk/types/key_burned_coins.go | 23 ++ 14 files changed, 608 insertions(+), 46 deletions(-) create mode 100644 proto/cointrunk/burned_coins.proto create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/burned_coins.ts create mode 100644 x/cointrunk/types/burned_coins.pb.go create mode 100644 x/cointrunk/types/key_burned_coins.go diff --git a/proto/cointrunk/burned_coins.proto b/proto/cointrunk/burned_coins.proto new file mode 100644 index 00000000..1604c370 --- /dev/null +++ b/proto/cointrunk/burned_coins.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package bze.cointrunk; + +option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; + +message BurnedCoins { + + string burned = 1; +} \ No newline at end of file diff --git a/proto/cointrunk/genesis.proto b/proto/cointrunk/genesis.proto index 405ebe6e..980208f9 100644 --- a/proto/cointrunk/genesis.proto +++ b/proto/cointrunk/genesis.proto @@ -6,6 +6,7 @@ import "cointrunk/params.proto"; import "cointrunk/publisher.proto"; import "cointrunk/accepted_domain.proto"; import "cointrunk/article.proto"; +import "cointrunk/burned_coins.proto"; // this line is used by starport scaffolding # genesis/proto/import option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; @@ -16,5 +17,6 @@ message GenesisState { repeated Publisher PublisherList = 2 [(gogoproto.nullable) = false]; repeated AcceptedDomain AcceptedDomainList = 3 [(gogoproto.nullable) = false]; repeated Article ArticleList = 4 [(gogoproto.nullable) = false]; + repeated BurnedCoins BurnedCoinsList = 5 [(gogoproto.nullable) = false]; // this line is used by starport scaffolding # genesis/proto/state } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts index d5167a2c..93c1774d 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts @@ -4,12 +4,13 @@ import { AcceptedDomain } from "./module/types/cointrunk/accepted_domain" import { AcceptedDomainProposal } from "./module/types/cointrunk/accepted_domain_proposal" import { Article } from "./module/types/cointrunk/article" import { BurnCoinsProposal } from "./module/types/cointrunk/burn_coins_proposal" +import { BurnedCoins } from "./module/types/cointrunk/burned_coins" import { Params } from "./module/types/cointrunk/params" import { Publisher } from "./module/types/cointrunk/publisher" import { PublisherProposal } from "./module/types/cointrunk/publisher_proposal" -export { AcceptedDomain, AcceptedDomainProposal, Article, BurnCoinsProposal, Params, Publisher, PublisherProposal }; +export { AcceptedDomain, AcceptedDomainProposal, Article, BurnCoinsProposal, BurnedCoins, Params, Publisher, PublisherProposal }; async function initTxClient(vuexGetters) { return await txClient(vuexGetters['common/wallet/signer'], { @@ -58,6 +59,7 @@ const getDefaultState = () => { AcceptedDomainProposal: getStructure(AcceptedDomainProposal.fromPartial({})), Article: getStructure(Article.fromPartial({})), BurnCoinsProposal: getStructure(BurnCoinsProposal.fromPartial({})), + BurnedCoins: getStructure(BurnedCoins.fromPartial({})), Params: getStructure(Params.fromPartial({})), Publisher: getStructure(Publisher.fromPartial({})), PublisherProposal: getStructure(PublisherProposal.fromPartial({})), diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/burned_coins.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/burned_coins.ts new file mode 100644 index 00000000..167d3ccf --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/burned_coins.ts @@ -0,0 +1,74 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk"; + +export interface BurnedCoins { + burned: string; +} + +const baseBurnedCoins: object = { burned: "" }; + +export const BurnedCoins = { + encode(message: BurnedCoins, writer: Writer = Writer.create()): Writer { + if (message.burned !== "") { + writer.uint32(10).string(message.burned); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): BurnedCoins { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBurnedCoins } as BurnedCoins; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.burned = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BurnedCoins { + const message = { ...baseBurnedCoins } as BurnedCoins; + if (object.burned !== undefined && object.burned !== null) { + message.burned = String(object.burned); + } else { + message.burned = ""; + } + return message; + }, + + toJSON(message: BurnedCoins): unknown { + const obj: any = {}; + message.burned !== undefined && (obj.burned = message.burned); + return obj; + }, + + fromPartial(object: DeepPartial): BurnedCoins { + const message = { ...baseBurnedCoins } as BurnedCoins; + if (object.burned !== undefined && object.burned !== null) { + message.burned = object.burned; + } else { + message.burned = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts index 6ee3e11a..d910175c 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts @@ -3,6 +3,7 @@ import { Params } from "../cointrunk/params"; import { Publisher } from "../cointrunk/publisher"; import { AcceptedDomain } from "../cointrunk/accepted_domain"; import { Article } from "../cointrunk/article"; +import { BurnedCoins } from "../cointrunk/burned_coins"; import { Writer, Reader } from "protobufjs/minimal"; export const protobufPackage = "bze.cointrunk"; @@ -12,8 +13,9 @@ export interface GenesisState { params: Params | undefined; PublisherList: Publisher[]; AcceptedDomainList: AcceptedDomain[]; - /** this line is used by starport scaffolding # genesis/proto/state */ ArticleList: Article[]; + /** this line is used by starport scaffolding # genesis/proto/state */ + BurnedCoinsList: BurnedCoins[]; } const baseGenesisState: object = {}; @@ -32,6 +34,9 @@ export const GenesisState = { for (const v of message.ArticleList) { Article.encode(v!, writer.uint32(34).fork()).ldelim(); } + for (const v of message.BurnedCoinsList) { + BurnedCoins.encode(v!, writer.uint32(42).fork()).ldelim(); + } return writer; }, @@ -42,6 +47,7 @@ export const GenesisState = { message.PublisherList = []; message.AcceptedDomainList = []; message.ArticleList = []; + message.BurnedCoinsList = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -59,6 +65,11 @@ export const GenesisState = { case 4: message.ArticleList.push(Article.decode(reader, reader.uint32())); break; + case 5: + message.BurnedCoinsList.push( + BurnedCoins.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -72,6 +83,7 @@ export const GenesisState = { message.PublisherList = []; message.AcceptedDomainList = []; message.ArticleList = []; + message.BurnedCoinsList = []; if (object.params !== undefined && object.params !== null) { message.params = Params.fromJSON(object.params); } else { @@ -95,6 +107,14 @@ export const GenesisState = { message.ArticleList.push(Article.fromJSON(e)); } } + if ( + object.BurnedCoinsList !== undefined && + object.BurnedCoinsList !== null + ) { + for (const e of object.BurnedCoinsList) { + message.BurnedCoinsList.push(BurnedCoins.fromJSON(e)); + } + } return message; }, @@ -123,6 +143,13 @@ export const GenesisState = { } else { obj.ArticleList = []; } + if (message.BurnedCoinsList) { + obj.BurnedCoinsList = message.BurnedCoinsList.map((e) => + e ? BurnedCoins.toJSON(e) : undefined + ); + } else { + obj.BurnedCoinsList = []; + } return obj; }, @@ -131,6 +158,7 @@ export const GenesisState = { message.PublisherList = []; message.AcceptedDomainList = []; message.ArticleList = []; + message.BurnedCoinsList = []; if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); } else { @@ -154,6 +182,14 @@ export const GenesisState = { message.ArticleList.push(Article.fromPartial(e)); } } + if ( + object.BurnedCoinsList !== undefined && + object.BurnedCoinsList !== null + ) { + for (const e of object.BurnedCoinsList) { + message.BurnedCoinsList.push(BurnedCoins.fromPartial(e)); + } + } return message; }, }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 474b327f..40cc1ba4 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,18 +232,18 @@ export default { }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -262,32 +262,32 @@ export default { } } }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgRevealSolution({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, @@ -304,16 +304,16 @@ export default { } } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 5f72a96b..c023b54d 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgRevealSolution } from "./types/scavenge/tx"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; +import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/genesis.go b/x/cointrunk/genesis.go index d9eeeabf..6a776525 100644 --- a/x/cointrunk/genesis.go +++ b/x/cointrunk/genesis.go @@ -21,6 +21,10 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) k.SetArticle(ctx, article) } + for _, burnedCoins := range genState.BurnedCoinsList { + k.SetBurnedCoins(ctx, burnedCoins) + } + // 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.PublisherList = k.GetAllPublisher(ctx) genesis.AcceptedDomainList = k.GetAllAcceptedDomain(ctx) genesis.ArticleList = k.GetAllArticles(ctx) + genesis.BurnedCoinsList = k.GetAllBurnedCoins(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/cointrunk/keeper/cointrunk.go b/x/cointrunk/keeper/cointrunk.go index 837efa38..40ff1aa0 100644 --- a/x/cointrunk/keeper/cointrunk.go +++ b/x/cointrunk/keeper/cointrunk.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gobuffalo/packr/v2/file/resolver/encoding/hex" + "strconv" ) const ( @@ -134,6 +135,29 @@ func (k Keeper) GetCounter(ctx sdk.Context) (no uint64) { return binary.BigEndian.Uint64(counter) } +func (k Keeper) GetAllBurnedCoins(ctx sdk.Context) (list []types.BurnedCoins) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BurnedCoinsKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.BurnedCoins + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} + +func (k Keeper) SetBurnedCoins(ctx sdk.Context, burnedCoins types.BurnedCoins) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BurnedCoinsKeyPrefix)) + val := k.cdc.MustMarshal(&burnedCoins) + store.Set( + types.BurnedCoinsKey(strconv.FormatInt(ctx.BlockHeader().Height, 10)), + val, + ) +} + func (k Keeper) incrementCounter(ctx sdk.Context) { no := k.GetCounter(ctx) no++ diff --git a/x/cointrunk/keeper/gov.go b/x/cointrunk/keeper/gov.go index 99d195c7..c3fe219d 100644 --- a/x/cointrunk/keeper/gov.go +++ b/x/cointrunk/keeper/gov.go @@ -26,10 +26,18 @@ func (k Keeper) HandleAcceptedDomainProposal(ctx sdk.Context, proposal *types.Ac func (k Keeper) HandleBurnCoinsProposal(ctx sdk.Context, proposal *types.BurnCoinsProposal) error { moduleAcc := k.accKeeper.GetModuleAccount(ctx, types.ModuleName) coins := k.bankKeeper.GetAllBalances(ctx, moduleAcc.GetAddress()) + if coins.IsZero() { + //nothing to burn at this moment + return nil + } + err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, coins) if err != nil { panic(err) } - //TODO: save burn events so we can brag about it + + var burnedCoins = types.BurnedCoins{Burned: coins.String()} + k.SetBurnedCoins(ctx, burnedCoins) + return nil } diff --git a/x/cointrunk/types/burned_coins.pb.go b/x/cointrunk/types/burned_coins.pb.go new file mode 100644 index 00000000..34b63204 --- /dev/null +++ b/x/cointrunk/types/burned_coins.pb.go @@ -0,0 +1,314 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cointrunk/burned_coins.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/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 BurnedCoins struct { + Burned string `protobuf:"bytes,1,opt,name=burned,proto3" json:"burned,omitempty"` +} + +func (m *BurnedCoins) Reset() { *m = BurnedCoins{} } +func (m *BurnedCoins) String() string { return proto.CompactTextString(m) } +func (*BurnedCoins) ProtoMessage() {} +func (*BurnedCoins) Descriptor() ([]byte, []int) { + return fileDescriptor_787ee9a9009896ca, []int{0} +} +func (m *BurnedCoins) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BurnedCoins) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BurnedCoins.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 *BurnedCoins) XXX_Merge(src proto.Message) { + xxx_messageInfo_BurnedCoins.Merge(m, src) +} +func (m *BurnedCoins) XXX_Size() int { + return m.Size() +} +func (m *BurnedCoins) XXX_DiscardUnknown() { + xxx_messageInfo_BurnedCoins.DiscardUnknown(m) +} + +var xxx_messageInfo_BurnedCoins proto.InternalMessageInfo + +func (m *BurnedCoins) GetBurned() string { + if m != nil { + return m.Burned + } + return "" +} + +func init() { + proto.RegisterType((*BurnedCoins)(nil), "bze.cointrunk.BurnedCoins") +} + +func init() { proto.RegisterFile("cointrunk/burned_coins.proto", fileDescriptor_787ee9a9009896ca) } + +var fileDescriptor_787ee9a9009896ca = []byte{ + // 154 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0xcf, 0xcc, + 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x2a, 0x2d, 0xca, 0x4b, 0x4d, 0x89, 0x07, 0x09, 0x14, + 0xeb, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xf1, 0x26, 0x55, 0xa5, 0xea, 0xc1, 0x55, 0x28, 0xa9, + 0x72, 0x71, 0x3b, 0x81, 0x15, 0x39, 0x83, 0xd4, 0x08, 0x89, 0x71, 0xb1, 0x41, 0xf4, 0x48, 0x30, + 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x41, 0x79, 0x4e, 0x1e, 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, 0xa5, 0x97, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, + 0x54, 0x95, 0xaa, 0x9b, 0x98, 0x53, 0x90, 0x91, 0x58, 0x92, 0x9a, 0x08, 0xe6, 0xe9, 0x57, 0xe8, + 0x23, 0x1c, 0x53, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0x86, 0x31, 0x20, 0x00, 0x00, + 0xff, 0xff, 0x13, 0xe3, 0x07, 0x1b, 0xa6, 0x00, 0x00, 0x00, +} + +func (m *BurnedCoins) 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 *BurnedCoins) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BurnedCoins) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Burned) > 0 { + i -= len(m.Burned) + copy(dAtA[i:], m.Burned) + i = encodeVarintBurnedCoins(dAtA, i, uint64(len(m.Burned))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintBurnedCoins(dAtA []byte, offset int, v uint64) int { + offset -= sovBurnedCoins(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BurnedCoins) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Burned) + if l > 0 { + n += 1 + l + sovBurnedCoins(uint64(l)) + } + return n +} + +func sovBurnedCoins(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBurnedCoins(x uint64) (n int) { + return sovBurnedCoins(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BurnedCoins) 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 ErrIntOverflowBurnedCoins + } + 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: BurnedCoins: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BurnedCoins: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Burned", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBurnedCoins + } + 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 ErrInvalidLengthBurnedCoins + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBurnedCoins + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Burned = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBurnedCoins(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBurnedCoins + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBurnedCoins(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, ErrIntOverflowBurnedCoins + } + 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, ErrIntOverflowBurnedCoins + } + 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, ErrIntOverflowBurnedCoins + } + 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, ErrInvalidLengthBurnedCoins + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBurnedCoins + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBurnedCoins + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBurnedCoins = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBurnedCoins = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBurnedCoins = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/cointrunk/types/genesis.go b/x/cointrunk/types/genesis.go index 855ce2dc..3facafde 100644 --- a/x/cointrunk/types/genesis.go +++ b/x/cointrunk/types/genesis.go @@ -11,6 +11,7 @@ func DefaultGenesis() *GenesisState { PublisherList: []Publisher{}, AcceptedDomainList: []AcceptedDomain{}, ArticleList: []Article{}, + BurnedCoinsList: []BurnedCoins{}, } } diff --git a/x/cointrunk/types/genesis.pb.go b/x/cointrunk/types/genesis.pb.go index 7e3f9d18..19605b08 100644 --- a/x/cointrunk/types/genesis.pb.go +++ b/x/cointrunk/types/genesis.pb.go @@ -29,6 +29,7 @@ type GenesisState struct { PublisherList []Publisher `protobuf:"bytes,2,rep,name=PublisherList,proto3" json:"PublisherList"` AcceptedDomainList []AcceptedDomain `protobuf:"bytes,3,rep,name=AcceptedDomainList,proto3" json:"AcceptedDomainList"` ArticleList []Article `protobuf:"bytes,4,rep,name=ArticleList,proto3" json:"ArticleList"` + BurnedCoinsList []BurnedCoins `protobuf:"bytes,5,rep,name=BurnedCoinsList,proto3" json:"BurnedCoinsList"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -92,6 +93,13 @@ func (m *GenesisState) GetArticleList() []Article { return nil } +func (m *GenesisState) GetBurnedCoinsList() []BurnedCoins { + if m != nil { + return m.BurnedCoinsList + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "bze.cointrunk.GenesisState") } @@ -99,27 +107,29 @@ func init() { func init() { proto.RegisterFile("cointrunk/genesis.proto", fileDescriptor_20104b77ac07c6a4) } var fileDescriptor_20104b77ac07c6a4 = []byte{ - // 314 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xbd, 0x4e, 0xeb, 0x30, - 0x00, 0x85, 0x93, 0xb6, 0xea, 0xe0, 0xdc, 0x2e, 0xd6, 0xa5, 0x84, 0x48, 0xb8, 0x15, 0x53, 0x17, - 0x1c, 0xa9, 0xdd, 0x91, 0x5a, 0x55, 0x82, 0x81, 0xa1, 0xa2, 0x1b, 0x0b, 0x72, 0x52, 0x2b, 0xb1, - 0x48, 0xe2, 0x28, 0x71, 0x24, 0xe8, 0x53, 0xf0, 0x04, 0x3c, 0x4f, 0xc7, 0x8e, 0x4c, 0x08, 0x25, - 0x2f, 0x82, 0xb0, 0x5d, 0xf2, 0x23, 0xb6, 0x24, 0xe7, 0x7c, 0x5f, 0x8e, 0x0d, 0xce, 0x7d, 0xce, - 0x12, 0x91, 0x15, 0xc9, 0xb3, 0x1b, 0xd0, 0x84, 0xe6, 0x2c, 0xc7, 0x69, 0xc6, 0x05, 0x87, 0x23, - 0x6f, 0x4f, 0xf1, 0x6f, 0xe8, 0xfc, 0x0f, 0x78, 0xc0, 0x65, 0xe2, 0xfe, 0x3c, 0xa9, 0x92, 0x33, - 0xae, 0xe9, 0x94, 0x64, 0x24, 0xd6, 0xb0, 0x73, 0xd1, 0xf8, 0x5e, 0x78, 0x11, 0xcb, 0x43, 0x9a, - 0xe9, 0x68, 0x52, 0x47, 0xc4, 0xf7, 0x69, 0x2a, 0xe8, 0xee, 0x69, 0xc7, 0x63, 0xc2, 0x12, 0x5d, - 0x68, 0x2c, 0x22, 0x99, 0x60, 0x7e, 0x44, 0x55, 0x70, 0xf5, 0xde, 0x03, 0xff, 0x6e, 0xd5, 0xc6, - 0xad, 0x20, 0x82, 0xc2, 0x05, 0x18, 0xaa, 0xbf, 0xda, 0xe6, 0xd4, 0x9c, 0x59, 0xf3, 0x33, 0xdc, - 0xda, 0x8c, 0x37, 0x32, 0x5c, 0x0d, 0x0e, 0x9f, 0x13, 0xe3, 0x41, 0x57, 0xe1, 0x1a, 0x8c, 0x36, - 0xa7, 0x49, 0xf7, 0x2c, 0x17, 0x76, 0x6f, 0xda, 0x9f, 0x59, 0x73, 0xbb, 0xcb, 0x9e, 0x3a, 0x1a, - 0x6f, 0x43, 0x70, 0x0b, 0xe0, 0x52, 0xaf, 0x5f, 0xcb, 0xf1, 0x52, 0xd5, 0x97, 0xaa, 0xcb, 0x8e, - 0xaa, 0x5d, 0xd4, 0xbe, 0x3f, 0x70, 0x78, 0x03, 0xac, 0xa5, 0x3a, 0xb1, 0xb4, 0x0d, 0xa4, 0x6d, - 0xdc, 0xb5, 0xa9, 0x86, 0xd6, 0x34, 0x81, 0xd5, 0xdd, 0xa1, 0x44, 0xe6, 0xb1, 0x44, 0xe6, 0x57, - 0x89, 0xcc, 0xb7, 0x0a, 0x19, 0xc7, 0x0a, 0x19, 0x1f, 0x15, 0x32, 0x1e, 0x71, 0xc0, 0x44, 0x58, - 0x78, 0xd8, 0xe7, 0xb1, 0xeb, 0xed, 0xe9, 0x35, 0x89, 0xd2, 0x90, 0x08, 0x4a, 0xe4, 0x9b, 0xfb, - 0xe2, 0xd6, 0x57, 0x2e, 0x5e, 0x53, 0x9a, 0x7b, 0x43, 0x79, 0xe3, 0x8b, 0xef, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x68, 0xec, 0x36, 0x49, 0x1e, 0x02, 0x00, 0x00, + // 347 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xb1, 0x4f, 0xc2, 0x40, + 0x14, 0xc6, 0x5b, 0x40, 0x86, 0x43, 0x62, 0x72, 0x51, 0xc4, 0x46, 0x0b, 0x71, 0x62, 0xb1, 0x4d, + 0x60, 0x37, 0x01, 0x49, 0x34, 0xc6, 0x81, 0xc8, 0xe6, 0x42, 0xae, 0xe5, 0xa5, 0x5c, 0x84, 0x5e, + 0x73, 0xbd, 0x26, 0xca, 0x5f, 0xe1, 0x9f, 0xc5, 0xc8, 0xe8, 0x64, 0x0c, 0x6c, 0xfe, 0x15, 0x86, + 0xd7, 0xc3, 0x96, 0xc6, 0xad, 0xbd, 0xef, 0xfb, 0x7e, 0xf7, 0xbe, 0x77, 0xe4, 0xdc, 0x17, 0x3c, + 0x54, 0x32, 0x09, 0x5f, 0xdd, 0x00, 0x42, 0x88, 0x79, 0xec, 0x44, 0x52, 0x28, 0x41, 0xeb, 0xde, + 0x12, 0x9c, 0x3f, 0xd1, 0x3a, 0x0d, 0x44, 0x20, 0x50, 0x71, 0x77, 0x5f, 0xa9, 0xc9, 0x6a, 0x64, + 0xe9, 0x88, 0x49, 0xb6, 0xd0, 0x61, 0xeb, 0x22, 0x77, 0x9e, 0x78, 0x73, 0x1e, 0xcf, 0x40, 0x6a, + 0xa9, 0x95, 0x49, 0xcc, 0xf7, 0x21, 0x52, 0x30, 0x9d, 0x4c, 0xc5, 0x82, 0xf1, 0x50, 0x1b, 0x72, + 0x13, 0x31, 0xa9, 0xb8, 0x3f, 0x07, 0x2d, 0x5c, 0x66, 0x82, 0x97, 0xc8, 0x10, 0xa6, 0x93, 0xdd, + 0x81, 0xbe, 0xf2, 0xfa, 0xa7, 0x44, 0x8e, 0xef, 0xd3, 0x06, 0x63, 0xc5, 0x14, 0xd0, 0x1e, 0xa9, + 0xa6, 0x33, 0x35, 0xcd, 0xb6, 0xd9, 0xa9, 0x75, 0xcf, 0x9c, 0x83, 0x46, 0xce, 0x08, 0xc5, 0x41, + 0x65, 0xf5, 0xd5, 0x32, 0x9e, 0xb5, 0x95, 0x0e, 0x49, 0x7d, 0xb4, 0x1f, 0xf8, 0x89, 0xc7, 0xaa, + 0x59, 0x6a, 0x97, 0x3b, 0xb5, 0x6e, 0xb3, 0x98, 0xdd, 0x7b, 0x74, 0xfc, 0x30, 0x44, 0xc7, 0x84, + 0xf6, 0x75, 0xb7, 0x21, 0x56, 0x43, 0x54, 0x19, 0x51, 0x57, 0x05, 0xd4, 0xa1, 0x51, 0xf3, 0xfe, + 0x89, 0xd3, 0x5b, 0x52, 0xeb, 0xa7, 0xfb, 0x40, 0x5a, 0x05, 0x69, 0x8d, 0x22, 0x2d, 0x75, 0x68, + 0x4c, 0x3e, 0x40, 0x1f, 0xc9, 0xc9, 0x00, 0xd7, 0x76, 0xb7, 0xdb, 0x1a, 0x32, 0x8e, 0x90, 0x61, + 0x15, 0x18, 0x39, 0x97, 0xe6, 0x14, 0x83, 0x83, 0x87, 0xd5, 0xc6, 0x36, 0xd7, 0x1b, 0xdb, 0xfc, + 0xde, 0xd8, 0xe6, 0xc7, 0xd6, 0x36, 0xd6, 0x5b, 0xdb, 0xf8, 0xdc, 0xda, 0xc6, 0x8b, 0x13, 0x70, + 0x35, 0x4b, 0x3c, 0xc7, 0x17, 0x0b, 0xd7, 0x5b, 0xc2, 0x0d, 0x9b, 0x47, 0x33, 0xa6, 0x80, 0xe1, + 0x9f, 0xfb, 0xe6, 0x66, 0x6f, 0xa8, 0xde, 0x23, 0x88, 0xbd, 0x2a, 0xbe, 0x5e, 0xef, 0x37, 0x00, + 0x00, 0xff, 0xff, 0x71, 0xa5, 0x9e, 0xe5, 0x88, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -142,6 +152,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.BurnedCoinsList) > 0 { + for iNdEx := len(m.BurnedCoinsList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BurnedCoinsList[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.ArticleList) > 0 { for iNdEx := len(m.ArticleList) - 1; iNdEx >= 0; iNdEx-- { { @@ -234,6 +258,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.BurnedCoinsList) > 0 { + for _, e := range m.BurnedCoinsList { + 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 BurnedCoinsList", 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.BurnedCoinsList = append(m.BurnedCoinsList, BurnedCoins{}) + if err := m.BurnedCoinsList[len(m.BurnedCoinsList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/cointrunk/types/key_burned_coins.go b/x/cointrunk/types/key_burned_coins.go new file mode 100644 index 00000000..f38c786d --- /dev/null +++ b/x/cointrunk/types/key_burned_coins.go @@ -0,0 +1,23 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // BurnedCoinsKeyPrefix is the prefix to retrieve all BurnedCoins + BurnedCoinsKeyPrefix = "BurnedCoins/value/" +) + +// BurnedCoinsKey returns the store key to retrieve a BurnedCoins from the index fields +func BurnedCoinsKey( + index string, +) []byte { + var key []byte + + indexBytes := []byte(index) + key = append(key, indexBytes...) + key = append(key, []byte("/")...) + + return key +} From 9a583e93bbc458018f4f58293433859f62eec681 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Sat, 26 Nov 2022 01:13:29 +0200 Subject: [PATCH 18/54] saving burning amounts and querying them --- docs/static/openapi.yml | 167 ++++++ proto/cointrunk/burned_coins.proto | 1 + proto/cointrunk/query.proto | 15 + .../bze-alphateam/bze/bze.cointrunk/index.ts | 33 ++ .../bze/bze.cointrunk/module/rest.ts | 46 ++ .../module/types/cointrunk/burned_coins.ts | 20 +- .../module/types/cointrunk/query.ts | 201 +++++++ .../bze-alphateam/bze/bze.scavenge/index.ts | 40 +- .../bze/bze.scavenge/module/index.ts | 6 +- x/cointrunk/client/cli/gov.go | 2 +- x/cointrunk/client/cli/query.go | 2 + .../client/cli/query_all_burned_coins.go | 48 ++ x/cointrunk/keeper/cointrunk.go | 3 +- x/cointrunk/keeper/gov.go | 6 +- .../keeper/grpc_query_coins_burn_events.go | 38 ++ x/cointrunk/keeper/msg_server_add_article.go | 2 +- x/cointrunk/types/burned_coins.pb.go | 68 ++- x/cointrunk/types/query.pb.go | 553 ++++++++++++++++-- x/cointrunk/types/query.pb.gw.go | 83 +++ 19 files changed, 1252 insertions(+), 82 deletions(-) create mode 100644 x/cointrunk/client/cli/query_all_burned_coins.go create mode 100644 x/cointrunk/keeper/grpc_query_coins_burn_events.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 75f5ac06..978c39c7 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -121,6 +121,129 @@ paths: descending order. + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /bze/cointrunk/all_burned_coins: + get: + summary: Queries a list of CoinsBurnEvents items. + operationId: BzeCointrunkAllBurnedCoins + responses: + '200': + description: A successful response. + schema: + type: object + properties: + burnedCoins: + type: array + items: + type: object + properties: + burned: + type: string + height: + type: string + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + default: + description: An unexpected 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 @@ -30491,6 +30614,13 @@ definitions: type: string paid: type: boolean + bze.cointrunk.BurnedCoins: + type: object + properties: + burned: + type: string + height: + type: string bze.cointrunk.MsgAddArticleResponse: type: object bze.cointrunk.Params: @@ -30548,6 +30678,43 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + bze.cointrunk.QueryAllBurnedCoinsResponse: + type: object + properties: + burnedCoins: + type: array + items: + type: object + properties: + burned: + type: string + height: + type: string + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } bze.cointrunk.QueryArticlesByPrefixResponse: type: object properties: diff --git a/proto/cointrunk/burned_coins.proto b/proto/cointrunk/burned_coins.proto index 1604c370..8e0f778f 100644 --- a/proto/cointrunk/burned_coins.proto +++ b/proto/cointrunk/burned_coins.proto @@ -6,4 +6,5 @@ option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; message BurnedCoins { string burned = 1; + string height = 2; } \ No newline at end of file diff --git a/proto/cointrunk/query.proto b/proto/cointrunk/query.proto index aa3e8bf2..293f3e12 100644 --- a/proto/cointrunk/query.proto +++ b/proto/cointrunk/query.proto @@ -8,6 +8,7 @@ import "cointrunk/params.proto"; import "cointrunk/accepted_domain.proto"; import "cointrunk/publisher.proto"; import "cointrunk/article.proto"; +import "cointrunk/burned_coins.proto"; // this line is used by starport scaffolding # 1 option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; @@ -38,6 +39,11 @@ service Query { option (google.api.http).get = "/bze/cointrunk/articles_by_prefix/{prefix}"; } +// Queries a list of CoinsBurnEvents items. + rpc AllBurnedCoins(QueryAllBurnedCoinsRequest) returns (QueryAllBurnedCoinsResponse) { + option (google.api.http).get = "/bze/cointrunk/all_burned_coins"; + } + // this line is used by starport scaffolding # 2 } @@ -86,4 +92,13 @@ message QueryArticlesByPrefixResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message QueryAllBurnedCoinsRequest { +cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllBurnedCoinsResponse { + repeated BurnedCoins burnedCoins = 1 [(gogoproto.nullable) = false]; +cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + // this line is used by starport scaffolding # 3 diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts index 93c1774d..6e22458e 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts @@ -53,6 +53,7 @@ const getDefaultState = () => { Publisher: {}, PublisherByIndex: {}, ArticlesByPrefix: {}, + AllBurnedCoins: {}, _Structure: { AcceptedDomain: getStructure(AcceptedDomain.fromPartial({})), @@ -121,6 +122,12 @@ export default { } return state.ArticlesByPrefix[JSON.stringify(params)] ?? {} }, + getAllBurnedCoins: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.AllBurnedCoins[JSON.stringify(params)] ?? {} + }, getTypeStructure: (state) => (type) => { return state._Structure[type].fields @@ -277,6 +284,32 @@ export default { }, + + + + + + async QueryAllBurnedCoins({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryAllBurnedCoins(query)).data + + + while (all && ( value).pagination && ( value).pagination.next_key!=null) { + let next_values=(await queryClient.queryAllBurnedCoins({...query, 'pagination.key':( value).pagination.next_key})).data + value = mergeResults(value, next_values); + } + commit('QUERY', { query: 'AllBurnedCoins', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllBurnedCoins', payload: { options: { all }, params: {...key},query }}) + return getters['getAllBurnedCoins']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryAllBurnedCoins API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + async sendMsgAddArticle({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts index be69bcc3..7ad74129 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts @@ -22,6 +22,11 @@ export interface CointrunkArticle { paid?: boolean; } +export interface CointrunkBurnedCoins { + burned?: string; + height?: string; +} + export type CointrunkMsgAddArticleResponse = object; /** @@ -54,6 +59,21 @@ export interface CointrunkQueryAcceptedDomainResponse { pagination?: V1Beta1PageResponse; } +export interface CointrunkQueryAllBurnedCoinsResponse { + burnedCoins?: CointrunkBurnedCoins[]; + + /** + * 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; + * } + */ + pagination?: V1Beta1PageResponse; +} + export interface CointrunkQueryArticlesByPrefixResponse { article?: CointrunkArticle[]; @@ -392,6 +412,32 @@ export class Api extends HttpClient + this.request({ + path: `/bze/cointrunk/all_burned_coins`, + method: "GET", + query: query, + format: "json", + ...params, + }); + /** * No description * diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/burned_coins.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/burned_coins.ts index 167d3ccf..dc8356cb 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/burned_coins.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/burned_coins.ts @@ -5,15 +5,19 @@ export const protobufPackage = "bze.cointrunk"; export interface BurnedCoins { burned: string; + height: string; } -const baseBurnedCoins: object = { burned: "" }; +const baseBurnedCoins: object = { burned: "", height: "" }; export const BurnedCoins = { encode(message: BurnedCoins, writer: Writer = Writer.create()): Writer { if (message.burned !== "") { writer.uint32(10).string(message.burned); } + if (message.height !== "") { + writer.uint32(18).string(message.height); + } return writer; }, @@ -27,6 +31,9 @@ export const BurnedCoins = { case 1: message.burned = reader.string(); break; + case 2: + message.height = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -42,12 +49,18 @@ export const BurnedCoins = { } else { message.burned = ""; } + if (object.height !== undefined && object.height !== null) { + message.height = String(object.height); + } else { + message.height = ""; + } return message; }, toJSON(message: BurnedCoins): unknown { const obj: any = {}; message.burned !== undefined && (obj.burned = message.burned); + message.height !== undefined && (obj.height = message.height); return obj; }, @@ -58,6 +71,11 @@ export const BurnedCoins = { } else { message.burned = ""; } + if (object.height !== undefined && object.height !== null) { + message.height = object.height; + } else { + message.height = ""; + } return message; }, }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts index 42354009..ffcc18f8 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts @@ -8,6 +8,7 @@ import { import { AcceptedDomain } from "../cointrunk/accepted_domain"; import { Publisher } from "../cointrunk/publisher"; import { Article } from "../cointrunk/article"; +import { BurnedCoins } from "../cointrunk/burned_coins"; export const protobufPackage = "bze.cointrunk"; @@ -56,6 +57,15 @@ export interface QueryArticlesByPrefixResponse { pagination: PageResponse | undefined; } +export interface QueryAllBurnedCoinsRequest { + pagination: PageRequest | undefined; +} + +export interface QueryAllBurnedCoinsResponse { + burnedCoins: BurnedCoins[]; + pagination: PageResponse | undefined; +} + const baseQueryParamsRequest: object = {}; export const QueryParamsRequest = { @@ -814,6 +824,179 @@ export const QueryArticlesByPrefixResponse = { }, }; +const baseQueryAllBurnedCoinsRequest: object = {}; + +export const QueryAllBurnedCoinsRequest = { + encode( + message: QueryAllBurnedCoinsRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryAllBurnedCoinsRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAllBurnedCoinsRequest, + } as QueryAllBurnedCoinsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllBurnedCoinsRequest { + const message = { + ...baseQueryAllBurnedCoinsRequest, + } as QueryAllBurnedCoinsRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllBurnedCoinsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAllBurnedCoinsRequest { + const message = { + ...baseQueryAllBurnedCoinsRequest, + } as QueryAllBurnedCoinsRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAllBurnedCoinsResponse: object = {}; + +export const QueryAllBurnedCoinsResponse = { + encode( + message: QueryAllBurnedCoinsResponse, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.burnedCoins) { + BurnedCoins.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryAllBurnedCoinsResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAllBurnedCoinsResponse, + } as QueryAllBurnedCoinsResponse; + message.burnedCoins = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.burnedCoins.push(BurnedCoins.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllBurnedCoinsResponse { + const message = { + ...baseQueryAllBurnedCoinsResponse, + } as QueryAllBurnedCoinsResponse; + message.burnedCoins = []; + if (object.burnedCoins !== undefined && object.burnedCoins !== null) { + for (const e of object.burnedCoins) { + message.burnedCoins.push(BurnedCoins.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllBurnedCoinsResponse): unknown { + const obj: any = {}; + if (message.burnedCoins) { + obj.burnedCoins = message.burnedCoins.map((e) => + e ? BurnedCoins.toJSON(e) : undefined + ); + } else { + obj.burnedCoins = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAllBurnedCoinsResponse { + const message = { + ...baseQueryAllBurnedCoinsResponse, + } as QueryAllBurnedCoinsResponse; + message.burnedCoins = []; + if (object.burnedCoins !== undefined && object.burnedCoins !== null) { + for (const e of object.burnedCoins) { + message.burnedCoins.push(BurnedCoins.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + /** Query defines the gRPC querier service. */ export interface Query { /** Parameters queries the parameters of the module. */ @@ -832,6 +1015,10 @@ export interface Query { ArticlesByPrefix( request: QueryArticlesByPrefixRequest ): Promise; + /** Queries a list of CoinsBurnEvents items. */ + AllBurnedCoins( + request: QueryAllBurnedCoinsRequest + ): Promise; } export class QueryClientImpl implements Query { @@ -894,6 +1081,20 @@ export class QueryClientImpl implements Query { QueryArticlesByPrefixResponse.decode(new Reader(data)) ); } + + AllBurnedCoins( + request: QueryAllBurnedCoinsRequest + ): Promise { + const data = QueryAllBurnedCoinsRequest.encode(request).finish(); + const promise = this.rpc.request( + "bze.cointrunk.Query", + "AllBurnedCoins", + data + ); + return promise.then((data) => + QueryAllBurnedCoinsResponse.decode(new Reader(data)) + ); + } } interface Rpc { diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 40cc1ba4..155d50b2 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,6 +232,21 @@ export default { }, + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgRevealSolution(value) + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + }else{ + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + } + } + }, async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -262,22 +277,20 @@ export default { } } }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) const msg = await txClient.msgRevealSolution(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result + return msg } catch (e) { if (e == MissingWalletError) { throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + } else{ + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, - async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) @@ -304,19 +317,6 @@ export default { } } }, - async MsgRevealSolution({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) - } - } - }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index c023b54d..9a3de64c 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; +import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; -import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/client/cli/gov.go b/x/cointrunk/client/cli/gov.go index 78ed974c..3b67d12e 100644 --- a/x/cointrunk/client/cli/gov.go +++ b/x/cointrunk/client/cli/gov.go @@ -144,7 +144,7 @@ func NewCmdSubmitPublisherProposal() *cobra.Command { func NewCmdSubmitBurnCoinsProposal() *cobra.Command { cmd := &cobra.Command{ - Use: "coins-burn", + Use: "burn-coins", Args: cobra.ExactArgs(0), Short: "Submit coins burning proposal", Long: "Submit coins burning proposal along with an initial deposit.\n", diff --git a/x/cointrunk/client/cli/query.go b/x/cointrunk/client/cli/query.go index 4fdc4cc5..91157874 100644 --- a/x/cointrunk/client/cli/query.go +++ b/x/cointrunk/client/cli/query.go @@ -31,6 +31,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdArticlesByPrefix()) + cmd.AddCommand(CmdAllBurnedCoins()) + // this line is used by starport scaffolding # 1 return cmd diff --git a/x/cointrunk/client/cli/query_all_burned_coins.go b/x/cointrunk/client/cli/query_all_burned_coins.go new file mode 100644 index 00000000..47cb5ab2 --- /dev/null +++ b/x/cointrunk/client/cli/query_all_burned_coins.go @@ -0,0 +1,48 @@ +package cli + +import ( + "strconv" + + "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdAllBurnedCoins() *cobra.Command { + cmd := &cobra.Command{ + Use: "all-burned-coins", + Short: "Query coins-burn-events", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllBurnedCoinsRequest{} + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + params.Pagination = pageReq + + res, err := queryClient.AllBurnedCoins(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/cointrunk/keeper/cointrunk.go b/x/cointrunk/keeper/cointrunk.go index 40ff1aa0..e8af8732 100644 --- a/x/cointrunk/keeper/cointrunk.go +++ b/x/cointrunk/keeper/cointrunk.go @@ -7,7 +7,6 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gobuffalo/packr/v2/file/resolver/encoding/hex" - "strconv" ) const ( @@ -153,7 +152,7 @@ func (k Keeper) SetBurnedCoins(ctx sdk.Context, burnedCoins types.BurnedCoins) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BurnedCoinsKeyPrefix)) val := k.cdc.MustMarshal(&burnedCoins) store.Set( - types.BurnedCoinsKey(strconv.FormatInt(ctx.BlockHeader().Height, 10)), + types.BurnedCoinsKey(burnedCoins.Height), val, ) } diff --git a/x/cointrunk/keeper/gov.go b/x/cointrunk/keeper/gov.go index c3fe219d..e7d90bf6 100644 --- a/x/cointrunk/keeper/gov.go +++ b/x/cointrunk/keeper/gov.go @@ -3,6 +3,7 @@ package keeper import ( "github.com/bze-alphateam/bze/x/cointrunk/types" sdk "github.com/cosmos/cosmos-sdk/types" + "strconv" ) func (k Keeper) HandlePublisherProposal(ctx sdk.Context, proposal *types.PublisherProposal) error { @@ -36,7 +37,10 @@ func (k Keeper) HandleBurnCoinsProposal(ctx sdk.Context, proposal *types.BurnCoi panic(err) } - var burnedCoins = types.BurnedCoins{Burned: coins.String()} + var burnedCoins = types.BurnedCoins{ + Burned: coins.String(), + Height: strconv.FormatInt(ctx.BlockHeader().Height, 10), + } k.SetBurnedCoins(ctx, burnedCoins) return nil diff --git a/x/cointrunk/keeper/grpc_query_coins_burn_events.go b/x/cointrunk/keeper/grpc_query_coins_burn_events.go new file mode 100644 index 00000000..2c0a88a7 --- /dev/null +++ b/x/cointrunk/keeper/grpc_query_coins_burn_events.go @@ -0,0 +1,38 @@ +package keeper + +import ( + "context" + "github.com/cosmos/cosmos-sdk/store/prefix" + "github.com/cosmos/cosmos-sdk/types/query" + + "github.com/bze-alphateam/bze/x/cointrunk/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) AllBurnedCoins(goCtx context.Context, req *types.QueryAllBurnedCoinsRequest) (*types.QueryAllBurnedCoinsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + var burnedCoins []types.BurnedCoins + store := ctx.KVStore(k.storeKey) + burnedCoinsStore := prefix.NewStore(store, types.KeyPrefix(types.BurnedCoinsKeyPrefix)) + pageRes, err := query.Paginate(burnedCoinsStore, req.Pagination, func(key []byte, value []byte) error { + var entry types.BurnedCoins + if err := k.cdc.Unmarshal(value, &entry); err != nil { + return err + } + burnedCoins = append(burnedCoins, entry) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + _ = ctx + + return &types.QueryAllBurnedCoinsResponse{BurnedCoins: burnedCoins, Pagination: pageRes}, nil +} diff --git a/x/cointrunk/keeper/msg_server_add_article.go b/x/cointrunk/keeper/msg_server_add_article.go index 56065bfe..a48cc0c6 100644 --- a/x/cointrunk/keeper/msg_server_add_article.go +++ b/x/cointrunk/keeper/msg_server_add_article.go @@ -70,7 +70,7 @@ func (k msgServer) validateMessageDomains(ctx sdk.Context, msg *types.MsgAddArti if msg.Picture == "" { return nil } - + parsedUrl, err = msg.ParseUrl(msg.Picture) if err != nil { return errors.Newf("Invalid article picture url(%s)", err) diff --git a/x/cointrunk/types/burned_coins.pb.go b/x/cointrunk/types/burned_coins.pb.go index 34b63204..bc57f433 100644 --- a/x/cointrunk/types/burned_coins.pb.go +++ b/x/cointrunk/types/burned_coins.pb.go @@ -24,6 +24,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type BurnedCoins struct { Burned string `protobuf:"bytes,1,opt,name=burned,proto3" json:"burned,omitempty"` + Height string `protobuf:"bytes,2,opt,name=height,proto3" json:"height,omitempty"` } func (m *BurnedCoins) Reset() { *m = BurnedCoins{} } @@ -66,6 +67,13 @@ func (m *BurnedCoins) GetBurned() string { return "" } +func (m *BurnedCoins) GetHeight() string { + if m != nil { + return m.Height + } + return "" +} + func init() { proto.RegisterType((*BurnedCoins)(nil), "bze.cointrunk.BurnedCoins") } @@ -73,17 +81,18 @@ func init() { func init() { proto.RegisterFile("cointrunk/burned_coins.proto", fileDescriptor_787ee9a9009896ca) } var fileDescriptor_787ee9a9009896ca = []byte{ - // 154 bytes of a gzipped FileDescriptorProto + // 168 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0xcf, 0xcc, 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x2a, 0x2d, 0xca, 0x4b, 0x4d, 0x89, 0x07, 0x09, 0x14, - 0xeb, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xf1, 0x26, 0x55, 0xa5, 0xea, 0xc1, 0x55, 0x28, 0xa9, + 0xeb, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xf1, 0x26, 0x55, 0xa5, 0xea, 0xc1, 0x55, 0x28, 0xd9, 0x72, 0x71, 0x3b, 0x81, 0x15, 0x39, 0x83, 0xd4, 0x08, 0x89, 0x71, 0xb1, 0x41, 0xf4, 0x48, 0x30, - 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x41, 0x79, 0x4e, 0x1e, 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, 0xa5, 0x97, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, - 0x54, 0x95, 0xaa, 0x9b, 0x98, 0x53, 0x90, 0x91, 0x58, 0x92, 0x9a, 0x08, 0xe6, 0xe9, 0x57, 0xe8, - 0x23, 0x1c, 0x53, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0x86, 0x31, 0x20, 0x00, 0x00, - 0xff, 0xff, 0x13, 0xe3, 0x07, 0x1b, 0xa6, 0x00, 0x00, 0x00, + 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x41, 0x79, 0x20, 0xf1, 0x8c, 0xd4, 0xcc, 0xf4, 0x8c, 0x12, 0x09, + 0x26, 0x88, 0x38, 0x84, 0xe7, 0xe4, 0x71, 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, 0x7a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x49, 0x55, 0xa9, + 0xba, 0x89, 0x39, 0x05, 0x19, 0x89, 0x25, 0xa9, 0x89, 0x60, 0x9e, 0x7e, 0x85, 0x3e, 0xc2, 0x91, + 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xe7, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x32, 0x31, 0xf9, 0x8d, 0xbe, 0x00, 0x00, 0x00, } func (m *BurnedCoins) Marshal() (dAtA []byte, err error) { @@ -106,6 +115,13 @@ func (m *BurnedCoins) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Height) > 0 { + i -= len(m.Height) + copy(dAtA[i:], m.Height) + i = encodeVarintBurnedCoins(dAtA, i, uint64(len(m.Height))) + i-- + dAtA[i] = 0x12 + } if len(m.Burned) > 0 { i -= len(m.Burned) copy(dAtA[i:], m.Burned) @@ -137,6 +153,10 @@ func (m *BurnedCoins) Size() (n int) { if l > 0 { n += 1 + l + sovBurnedCoins(uint64(l)) } + l = len(m.Height) + if l > 0 { + n += 1 + l + sovBurnedCoins(uint64(l)) + } return n } @@ -207,6 +227,38 @@ func (m *BurnedCoins) Unmarshal(dAtA []byte) error { } m.Burned = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBurnedCoins + } + 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 ErrInvalidLengthBurnedCoins + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBurnedCoins + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Height = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipBurnedCoins(dAtA[iNdEx:]) diff --git a/x/cointrunk/types/query.pb.go b/x/cointrunk/types/query.pb.go index 6810df36..79445c39 100644 --- a/x/cointrunk/types/query.pb.go +++ b/x/cointrunk/types/query.pb.go @@ -497,6 +497,102 @@ func (m *QueryArticlesByPrefixResponse) GetPagination() *query.PageResponse { return nil } +type QueryAllBurnedCoinsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllBurnedCoinsRequest) Reset() { *m = QueryAllBurnedCoinsRequest{} } +func (m *QueryAllBurnedCoinsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllBurnedCoinsRequest) ProtoMessage() {} +func (*QueryAllBurnedCoinsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_12b6eb50b0e9fa00, []int{10} +} +func (m *QueryAllBurnedCoinsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllBurnedCoinsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllBurnedCoinsRequest.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 *QueryAllBurnedCoinsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllBurnedCoinsRequest.Merge(m, src) +} +func (m *QueryAllBurnedCoinsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllBurnedCoinsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllBurnedCoinsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllBurnedCoinsRequest proto.InternalMessageInfo + +func (m *QueryAllBurnedCoinsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllBurnedCoinsResponse struct { + BurnedCoins []BurnedCoins `protobuf:"bytes,1,rep,name=burnedCoins,proto3" json:"burnedCoins"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllBurnedCoinsResponse) Reset() { *m = QueryAllBurnedCoinsResponse{} } +func (m *QueryAllBurnedCoinsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllBurnedCoinsResponse) ProtoMessage() {} +func (*QueryAllBurnedCoinsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_12b6eb50b0e9fa00, []int{11} +} +func (m *QueryAllBurnedCoinsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllBurnedCoinsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllBurnedCoinsResponse.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 *QueryAllBurnedCoinsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllBurnedCoinsResponse.Merge(m, src) +} +func (m *QueryAllBurnedCoinsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllBurnedCoinsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllBurnedCoinsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllBurnedCoinsResponse proto.InternalMessageInfo + +func (m *QueryAllBurnedCoinsResponse) GetBurnedCoins() []BurnedCoins { + if m != nil { + return m.BurnedCoins + } + return nil +} + +func (m *QueryAllBurnedCoinsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "bze.cointrunk.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "bze.cointrunk.QueryParamsResponse") @@ -508,56 +604,63 @@ func init() { proto.RegisterType((*QueryPublisherByIndexResponse)(nil), "bze.cointrunk.QueryPublisherByIndexResponse") proto.RegisterType((*QueryArticlesByPrefixRequest)(nil), "bze.cointrunk.QueryArticlesByPrefixRequest") proto.RegisterType((*QueryArticlesByPrefixResponse)(nil), "bze.cointrunk.QueryArticlesByPrefixResponse") + proto.RegisterType((*QueryAllBurnedCoinsRequest)(nil), "bze.cointrunk.QueryAllBurnedCoinsRequest") + proto.RegisterType((*QueryAllBurnedCoinsResponse)(nil), "bze.cointrunk.QueryAllBurnedCoinsResponse") } func init() { proto.RegisterFile("cointrunk/query.proto", fileDescriptor_12b6eb50b0e9fa00) } var fileDescriptor_12b6eb50b0e9fa00 = []byte{ - // 697 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0x4d, 0x4f, 0x13, 0x41, - 0x18, 0xc7, 0x3b, 0x28, 0x35, 0x0c, 0x91, 0x90, 0x91, 0x16, 0x58, 0x60, 0x29, 0x1b, 0x45, 0x44, - 0xdc, 0x0d, 0xc5, 0x78, 0xf2, 0x42, 0x63, 0x7c, 0xbd, 0x60, 0x8f, 0x26, 0xa6, 0x99, 0xdd, 0x8e, - 0xcb, 0xc6, 0x76, 0x67, 0xd9, 0xdd, 0x1a, 0x0a, 0xc1, 0x83, 0x5f, 0x40, 0x13, 0x0f, 0x1e, 0xd5, - 0xcf, 0xe0, 0x57, 0xf0, 0xc0, 0x91, 0xc4, 0x8b, 0x27, 0x63, 0xc0, 0x0f, 0x62, 0x3a, 0xf3, 0x6c, - 0xdb, 0x1d, 0xb6, 0x80, 0xa6, 0xa7, 0x76, 0xe6, 0x79, 0x99, 0xdf, 0xf3, 0x7f, 0xe6, 0x99, 0xc5, - 0x05, 0x87, 0x7b, 0x7e, 0x1c, 0xb6, 0xfc, 0xd7, 0xd6, 0x4e, 0x8b, 0x85, 0x6d, 0x33, 0x08, 0x79, - 0xcc, 0xc9, 0x55, 0x7b, 0x8f, 0x99, 0x5d, 0x93, 0x36, 0xe5, 0x72, 0x97, 0x0b, 0x8b, 0xd5, 0xf9, - 0x27, 0x9d, 0xb4, 0x79, 0x97, 0x73, 0xb7, 0xc1, 0x2c, 0x1a, 0x78, 0x16, 0xf5, 0x7d, 0x1e, 0xd3, - 0xd8, 0xe3, 0x7e, 0x04, 0xd6, 0x55, 0x87, 0x47, 0x4d, 0x1e, 0x59, 0x36, 0x8d, 0x98, 0xcc, 0x6d, - 0xbd, 0x59, 0xb7, 0x59, 0x4c, 0xd7, 0xad, 0x80, 0xba, 0x9e, 0x2f, 0x9c, 0xc1, 0xb7, 0xd8, 0xa3, - 0x08, 0x68, 0x48, 0x9b, 0x49, 0x8e, 0xc5, 0xde, 0x3e, 0x75, 0x1c, 0x16, 0xc4, 0xac, 0x5e, 0xab, - 0xf3, 0x26, 0xf5, 0x92, 0xc0, 0xd9, 0xbe, 0xc0, 0x96, 0xdd, 0xf0, 0xa2, 0x6d, 0x16, 0x82, 0x69, - 0xba, 0x2f, 0x36, 0x8c, 0x3d, 0xa7, 0xc1, 0xa4, 0xc1, 0x98, 0xc2, 0xe4, 0x79, 0x07, 0x67, 0x4b, - 0x9c, 0x54, 0x65, 0x3b, 0x2d, 0x16, 0xc5, 0xc6, 0x53, 0x7c, 0x2d, 0xb5, 0x1b, 0x05, 0xdc, 0x8f, - 0x18, 0xd9, 0xc0, 0x79, 0x49, 0x34, 0x83, 0x4a, 0x68, 0x65, 0xbc, 0x5c, 0x30, 0x53, 0xca, 0x98, - 0xd2, 0xbd, 0x72, 0xf9, 0xf0, 0xd7, 0x62, 0xae, 0x0a, 0xae, 0x46, 0x1d, 0x6b, 0x22, 0xd7, 0x26, - 0x30, 0x3f, 0x10, 0xc8, 0x70, 0x12, 0x79, 0x88, 0x71, 0x4f, 0x00, 0x48, 0xbb, 0x6c, 0x4a, 0xb5, - 0xcc, 0x8e, 0x5a, 0xa6, 0xec, 0x04, 0xa8, 0x65, 0x6e, 0x51, 0x97, 0x41, 0x6c, 0xb5, 0x2f, 0xd2, - 0xf8, 0x86, 0xf0, 0x5c, 0xe6, 0x31, 0x80, 0xfe, 0x0c, 0x4f, 0xd0, 0x94, 0x65, 0x06, 0x95, 0x2e, - 0xad, 0x8c, 0x97, 0x17, 0x94, 0x12, 0xd2, 0xe1, 0x50, 0x8a, 0x12, 0x4a, 0x1e, 0xa5, 0xa0, 0x47, - 0x04, 0xf4, 0xcd, 0x73, 0xa1, 0x25, 0x49, 0x8a, 0xba, 0x86, 0x0b, 0x52, 0xe7, 0xa4, 0x5d, 0xc3, - 0x96, 0xe5, 0x33, 0xc2, 0x45, 0xf5, 0x04, 0x50, 0xe4, 0x3e, 0x1e, 0xeb, 0xde, 0x12, 0x10, 0x63, - 0x46, 0xed, 0x67, 0x62, 0x07, 0x1d, 0x7a, 0x01, 0xc3, 0x93, 0xe0, 0x2e, 0x9e, 0x4f, 0x03, 0x56, - 0xda, 0x4f, 0xfc, 0x3a, 0xdb, 0x4d, 0x94, 0x98, 0xc2, 0xa3, 0x5e, 0x67, 0x2d, 0x44, 0x18, 0xab, - 0xca, 0x85, 0xf1, 0x12, 0x2f, 0x0c, 0x88, 0xca, 0xae, 0x0e, 0xfd, 0x53, 0x75, 0xc6, 0x5b, 0x80, - 0xda, 0x94, 0xb3, 0x12, 0x55, 0xda, 0x5b, 0x21, 0x7b, 0xe5, 0x75, 0xa1, 0x8a, 0x38, 0x1f, 0x88, - 0x0d, 0xa0, 0x82, 0x95, 0xd2, 0xb6, 0x91, 0xff, 0x6e, 0xdb, 0x17, 0x04, 0xf5, 0x9d, 0x06, 0x80, - 0xfa, 0xee, 0xe1, 0x2b, 0x30, 0xc8, 0xd0, 0xbb, 0xa2, 0x7a, 0x91, 0xa5, 0x15, 0x6a, 0x4b, 0x9c, - 0x87, 0xd6, 0xb7, 0xf2, 0xf7, 0x51, 0x3c, 0x2a, 0x10, 0x89, 0x8f, 0xf3, 0x72, 0xf0, 0xc9, 0x92, - 0xc2, 0x70, 0xfa, 0x65, 0xd1, 0x8c, 0xb3, 0x5c, 0xe4, 0x31, 0xc6, 0xc2, 0xbb, 0x1f, 0x7f, 0x3e, - 0x8e, 0x4c, 0x93, 0x82, 0x65, 0xef, 0x31, 0x4b, 0x7d, 0x0d, 0xc9, 0x7b, 0x84, 0x27, 0xd2, 0x63, - 0x4a, 0x6e, 0x65, 0x65, 0xcd, 0x7c, 0x70, 0xb4, 0xd5, 0x8b, 0xb8, 0x02, 0xc8, 0xb2, 0x00, 0x29, - 0x11, 0x5d, 0x01, 0x51, 0x9e, 0x5f, 0xb2, 0x8f, 0xc7, 0xba, 0x97, 0x89, 0x5c, 0xcf, 0xac, 0x50, - 0x19, 0x70, 0xed, 0xc6, 0x39, 0x5e, 0x40, 0xb0, 0x24, 0x08, 0xe6, 0xc8, 0xac, 0x2a, 0x45, 0xe2, - 0x19, 0x91, 0x4f, 0x08, 0x4f, 0xaa, 0x63, 0x40, 0x6e, 0x9f, 0x99, 0x3e, 0x3d, 0x62, 0xda, 0xda, - 0xc5, 0x9c, 0x01, 0x69, 0x45, 0x20, 0x19, 0xa4, 0x34, 0x08, 0xc9, 0xda, 0x17, 0x33, 0x7a, 0x40, - 0xbe, 0x22, 0x3c, 0xa9, 0x5e, 0xe0, 0x6c, 0xb2, 0x01, 0x73, 0x96, 0x4d, 0x36, 0x68, 0x26, 0x8c, - 0xb2, 0x20, 0x5b, 0x23, 0xab, 0x6a, 0xbb, 0x20, 0xa0, 0x66, 0xb7, 0x6b, 0x72, 0x50, 0xad, 0x7d, - 0xf9, 0x7b, 0x50, 0x79, 0x7c, 0x78, 0xac, 0xa3, 0xa3, 0x63, 0x1d, 0xfd, 0x3e, 0xd6, 0xd1, 0x87, - 0x13, 0x3d, 0x77, 0x74, 0xa2, 0xe7, 0x7e, 0x9e, 0xe8, 0xb9, 0x17, 0xa6, 0xeb, 0xc5, 0xdb, 0x2d, - 0xdb, 0x74, 0x78, 0xb3, 0x93, 0xef, 0x0e, 0x6d, 0x04, 0xdb, 0x34, 0x66, 0x54, 0xac, 0xac, 0xdd, - 0xbe, 0xfc, 0x71, 0x3b, 0x60, 0x91, 0x9d, 0x17, 0x1f, 0xd4, 0x8d, 0xbf, 0x01, 0x00, 0x00, 0xff, - 0xff, 0xa7, 0x36, 0xd6, 0xd5, 0x45, 0x08, 0x00, 0x00, + // 781 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcf, 0x4f, 0x13, 0x41, + 0x14, 0xc7, 0xbb, 0x28, 0x35, 0x0c, 0x91, 0x90, 0x91, 0x16, 0x58, 0xa0, 0x94, 0x8d, 0x02, 0x22, + 0xee, 0x86, 0x62, 0x3c, 0x79, 0xa1, 0x1a, 0x7f, 0x5e, 0xb0, 0x47, 0x13, 0xd3, 0xcc, 0xb6, 0xe3, + 0xb2, 0x71, 0xbb, 0xb3, 0xec, 0x6e, 0x0d, 0x85, 0xe0, 0xc1, 0x7f, 0x40, 0x12, 0x0f, 0x1e, 0xd5, + 0xab, 0x57, 0xff, 0x09, 0x8e, 0x24, 0x1e, 0xf4, 0x64, 0x0c, 0xf8, 0x87, 0x98, 0x9d, 0x79, 0xdb, + 0xee, 0x0e, 0x5b, 0x40, 0xd3, 0x13, 0xcc, 0xcc, 0x7b, 0x6f, 0x3e, 0xef, 0xfb, 0xe6, 0xbd, 0x2e, + 0x2a, 0x34, 0x98, 0xed, 0x86, 0x7e, 0xdb, 0x7d, 0x6d, 0x6c, 0xb7, 0xa9, 0xdf, 0xd1, 0x3d, 0x9f, + 0x85, 0x0c, 0x5f, 0x35, 0x77, 0xa9, 0xde, 0x3d, 0x52, 0x27, 0x2c, 0x66, 0x31, 0x7e, 0x62, 0x44, + 0xff, 0x09, 0x23, 0x75, 0xd6, 0x62, 0xcc, 0x72, 0xa8, 0x41, 0x3c, 0xdb, 0x20, 0xae, 0xcb, 0x42, + 0x12, 0xda, 0xcc, 0x0d, 0xe0, 0x74, 0xa5, 0xc1, 0x82, 0x16, 0x0b, 0x0c, 0x93, 0x04, 0x54, 0xc4, + 0x36, 0xde, 0xac, 0x99, 0x34, 0x24, 0x6b, 0x86, 0x47, 0x2c, 0xdb, 0xe5, 0xc6, 0x60, 0x5b, 0xec, + 0x51, 0x78, 0xc4, 0x27, 0xad, 0x38, 0xc6, 0x7c, 0x6f, 0x9f, 0x34, 0x1a, 0xd4, 0x0b, 0x69, 0xb3, + 0xde, 0x64, 0x2d, 0x62, 0xc7, 0x8e, 0xd3, 0x09, 0xc7, 0xb6, 0xe9, 0xd8, 0xc1, 0x16, 0xf5, 0xe1, + 0x68, 0x32, 0xe1, 0xeb, 0x87, 0x76, 0xc3, 0xa1, 0x31, 0x76, 0xef, 0xc0, 0x6c, 0xfb, 0x2e, 0x6d, + 0xd6, 0xa3, 0x0d, 0xb8, 0x52, 0x9b, 0x40, 0xf8, 0x79, 0x04, 0xbb, 0xc9, 0x39, 0x6a, 0x74, 0xbb, + 0x4d, 0x83, 0x50, 0x7b, 0x8a, 0xae, 0xa5, 0x76, 0x03, 0x8f, 0xb9, 0x01, 0xc5, 0xeb, 0x28, 0x2f, + 0x78, 0xa7, 0x94, 0xb2, 0xb2, 0x3c, 0x5a, 0x29, 0xe8, 0x29, 0xdd, 0x74, 0x61, 0x5e, 0xbd, 0x7c, + 0xf8, 0x6b, 0x3e, 0x57, 0x03, 0x53, 0xad, 0x89, 0x54, 0x1e, 0x6b, 0x03, 0x32, 0x7a, 0xc0, 0x13, + 0x82, 0x9b, 0xf0, 0x43, 0x84, 0x7a, 0xf2, 0x40, 0xd8, 0x45, 0x5d, 0x68, 0xa9, 0x47, 0x5a, 0xea, + 0xa2, 0x4e, 0xa0, 0xa5, 0xbe, 0x49, 0x2c, 0x0a, 0xbe, 0xb5, 0x84, 0xa7, 0xf6, 0x4d, 0x41, 0x33, + 0x99, 0xd7, 0x00, 0xfa, 0x33, 0x34, 0x46, 0x52, 0x27, 0x53, 0x4a, 0xf9, 0xd2, 0xf2, 0x68, 0x65, + 0x4e, 0x4a, 0x21, 0xed, 0x0e, 0xa9, 0x48, 0xae, 0xf8, 0x51, 0x0a, 0x7a, 0x88, 0x43, 0x2f, 0x9d, + 0x0b, 0x2d, 0x48, 0x52, 0xd4, 0x75, 0x54, 0x10, 0x3a, 0xc7, 0xc5, 0x1c, 0xb4, 0x2c, 0x9f, 0x14, + 0x54, 0x94, 0x6f, 0x00, 0x45, 0xee, 0xa1, 0x91, 0xee, 0x1b, 0x02, 0x31, 0xa6, 0xe4, 0x7a, 0xc6, + 0xe7, 0xa0, 0x43, 0xcf, 0x61, 0x70, 0x12, 0xdc, 0x41, 0xb3, 0x69, 0xc0, 0x6a, 0xe7, 0x89, 0xdb, + 0xa4, 0x3b, 0xb1, 0x12, 0x13, 0x68, 0xd8, 0x8e, 0xd6, 0x5c, 0x84, 0x91, 0x9a, 0x58, 0x68, 0x2f, + 0xd1, 0x5c, 0x1f, 0xaf, 0xec, 0xec, 0x94, 0x7f, 0xca, 0x4e, 0x7b, 0x0b, 0x50, 0x1b, 0xa2, 0x93, + 0x82, 0x6a, 0x67, 0xd3, 0xa7, 0xaf, 0xec, 0x2e, 0x54, 0x11, 0xe5, 0x3d, 0xbe, 0x01, 0x54, 0xb0, + 0x92, 0xca, 0x36, 0xf4, 0xdf, 0x65, 0xfb, 0xac, 0x40, 0x7e, 0xa7, 0x01, 0x20, 0xbf, 0xbb, 0xe8, + 0x0a, 0xb4, 0x39, 0xd4, 0xae, 0x28, 0x3f, 0x64, 0x71, 0x0a, 0xb9, 0xc5, 0xc6, 0x83, 0xab, 0x5b, + 0xb7, 0xad, 0x1d, 0xa7, 0xca, 0xc7, 0xca, 0xfd, 0x68, 0xaa, 0x0c, 0xfa, 0xfd, 0x7e, 0xed, 0xb6, + 0xb5, 0x74, 0x0d, 0xc8, 0x50, 0x45, 0xa3, 0x66, 0x6f, 0x1b, 0xa4, 0x50, 0x25, 0x29, 0x12, 0x8e, + 0x20, 0x47, 0xd2, 0x69, 0x60, 0x92, 0x54, 0x7e, 0xe4, 0xd1, 0x30, 0x87, 0xc5, 0x2e, 0xca, 0x8b, + 0x59, 0x88, 0x17, 0x24, 0x96, 0xd3, 0xc3, 0x56, 0xd5, 0xce, 0x32, 0x11, 0xd7, 0x68, 0x73, 0xef, + 0xbe, 0xff, 0xf9, 0x30, 0x34, 0x89, 0x0b, 0x86, 0xb9, 0x4b, 0x0d, 0xf9, 0xe7, 0x03, 0xbf, 0x57, + 0xd0, 0x58, 0x7a, 0x72, 0xe1, 0x9b, 0x59, 0x51, 0x33, 0x67, 0xb0, 0xba, 0x72, 0x11, 0x53, 0x00, + 0x59, 0xe4, 0x20, 0x65, 0x5c, 0x92, 0x40, 0xa4, 0xdf, 0x2b, 0xbc, 0x87, 0x46, 0xba, 0xfd, 0x85, + 0xaf, 0x67, 0x66, 0x28, 0xcd, 0x3c, 0xf5, 0xc6, 0x39, 0x56, 0x40, 0xb0, 0xc0, 0x09, 0x66, 0xf0, + 0xb4, 0x2c, 0x45, 0x6c, 0x19, 0xe0, 0x8f, 0x0a, 0x1a, 0x97, 0x27, 0x03, 0xbe, 0x75, 0x66, 0xf8, + 0xf4, 0xd4, 0x51, 0x57, 0x2f, 0x66, 0x0c, 0x48, 0xcb, 0x1c, 0x49, 0xc3, 0xe5, 0x7e, 0x48, 0xc6, + 0x1e, 0x1f, 0x5b, 0xfb, 0xf8, 0x8b, 0x82, 0xc6, 0xe5, 0x9e, 0xce, 0x26, 0xeb, 0x33, 0x7a, 0xb2, + 0xc9, 0xfa, 0x8d, 0x09, 0xad, 0xc2, 0xc9, 0x56, 0xf1, 0x8a, 0x5c, 0x2e, 0x70, 0xa8, 0x9b, 0x9d, + 0xba, 0x98, 0x5d, 0xc6, 0x9e, 0xf8, 0xbb, 0x8f, 0x0f, 0xa2, 0xc7, 0x94, 0x6a, 0xb7, 0x3e, 0x8f, + 0x29, 0xab, 0xf3, 0xfb, 0x3c, 0xa6, 0xcc, 0xee, 0xd5, 0x96, 0x38, 0xdd, 0x02, 0x9e, 0x97, 0xe9, + 0x1c, 0xa7, 0x9e, 0xfc, 0x56, 0xa9, 0x3e, 0x3e, 0x3c, 0x2e, 0x29, 0x47, 0xc7, 0x25, 0xe5, 0xf7, + 0x71, 0x49, 0x39, 0x38, 0x29, 0xe5, 0x8e, 0x4e, 0x4a, 0xb9, 0x9f, 0x27, 0xa5, 0xdc, 0x0b, 0xdd, + 0xb2, 0xc3, 0xad, 0xb6, 0xa9, 0x37, 0x58, 0x2b, 0x0a, 0x72, 0x9b, 0x38, 0xde, 0x16, 0x09, 0x29, + 0xe1, 0x2b, 0x63, 0x27, 0x11, 0x34, 0xec, 0x78, 0x34, 0x30, 0xf3, 0xfc, 0xb3, 0x67, 0xfd, 0x6f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x2a, 0x2a, 0xef, 0x4e, 0x09, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -582,6 +685,8 @@ type QueryClient interface { PublisherByIndex(ctx context.Context, in *QueryPublisherByIndexRequest, opts ...grpc.CallOption) (*QueryPublisherByIndexResponse, error) // Queries a list of ArticlesByPrefix items. ArticlesByPrefix(ctx context.Context, in *QueryArticlesByPrefixRequest, opts ...grpc.CallOption) (*QueryArticlesByPrefixResponse, error) + // Queries a list of CoinsBurnEvents items. + AllBurnedCoins(ctx context.Context, in *QueryAllBurnedCoinsRequest, opts ...grpc.CallOption) (*QueryAllBurnedCoinsResponse, error) } type queryClient struct { @@ -637,6 +742,15 @@ func (c *queryClient) ArticlesByPrefix(ctx context.Context, in *QueryArticlesByP return out, nil } +func (c *queryClient) AllBurnedCoins(ctx context.Context, in *QueryAllBurnedCoinsRequest, opts ...grpc.CallOption) (*QueryAllBurnedCoinsResponse, error) { + out := new(QueryAllBurnedCoinsResponse) + err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/AllBurnedCoins", 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. @@ -649,6 +763,8 @@ type QueryServer interface { PublisherByIndex(context.Context, *QueryPublisherByIndexRequest) (*QueryPublisherByIndexResponse, error) // Queries a list of ArticlesByPrefix items. ArticlesByPrefix(context.Context, *QueryArticlesByPrefixRequest) (*QueryArticlesByPrefixResponse, error) + // Queries a list of CoinsBurnEvents items. + AllBurnedCoins(context.Context, *QueryAllBurnedCoinsRequest) (*QueryAllBurnedCoinsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -670,6 +786,9 @@ func (*UnimplementedQueryServer) PublisherByIndex(ctx context.Context, req *Quer func (*UnimplementedQueryServer) ArticlesByPrefix(ctx context.Context, req *QueryArticlesByPrefixRequest) (*QueryArticlesByPrefixResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ArticlesByPrefix not implemented") } +func (*UnimplementedQueryServer) AllBurnedCoins(ctx context.Context, req *QueryAllBurnedCoinsRequest) (*QueryAllBurnedCoinsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllBurnedCoins not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -765,6 +884,24 @@ func _Query_ArticlesByPrefix_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Query_AllBurnedCoins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllBurnedCoinsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllBurnedCoins(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bze.cointrunk.Query/AllBurnedCoins", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllBurnedCoins(ctx, req.(*QueryAllBurnedCoinsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "bze.cointrunk.Query", HandlerType: (*QueryServer)(nil), @@ -789,6 +926,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "ArticlesByPrefix", Handler: _Query_ArticlesByPrefix_Handler, }, + { + MethodName: "AllBurnedCoins", + Handler: _Query_AllBurnedCoins_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cointrunk/query.proto", @@ -1172,6 +1313,90 @@ func (m *QueryArticlesByPrefixResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *QueryAllBurnedCoinsRequest) 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 *QueryAllBurnedCoinsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllBurnedCoinsRequest) 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 *QueryAllBurnedCoinsResponse) 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 *QueryAllBurnedCoinsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllBurnedCoinsResponse) 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.BurnedCoins) > 0 { + for iNdEx := len(m.BurnedCoins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BurnedCoins[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 @@ -1327,6 +1552,38 @@ func (m *QueryArticlesByPrefixResponse) Size() (n int) { return n } +func (m *QueryAllBurnedCoinsRequest) 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 *QueryAllBurnedCoinsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.BurnedCoins) > 0 { + for _, e := range m.BurnedCoins { + 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 } @@ -2281,6 +2538,212 @@ func (m *QueryArticlesByPrefixResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryAllBurnedCoinsRequest) 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: QueryAllBurnedCoinsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllBurnedCoinsRequest: 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 *QueryAllBurnedCoinsResponse) 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: QueryAllBurnedCoinsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllBurnedCoinsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BurnedCoins", 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.BurnedCoins = append(m.BurnedCoins, BurnedCoins{}) + if err := m.BurnedCoins[len(m.BurnedCoins)-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/cointrunk/types/query.pb.gw.go b/x/cointrunk/types/query.pb.gw.go index 1ea5fd06..e1ca26d2 100644 --- a/x/cointrunk/types/query.pb.gw.go +++ b/x/cointrunk/types/query.pb.gw.go @@ -249,6 +249,42 @@ func local_request_Query_ArticlesByPrefix_0(ctx context.Context, marshaler runti } +var ( + filter_Query_AllBurnedCoins_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AllBurnedCoins_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllBurnedCoinsRequest + 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_AllBurnedCoins_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllBurnedCoins(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllBurnedCoins_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllBurnedCoinsRequest + 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_AllBurnedCoins_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllBurnedCoins(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. @@ -370,6 +406,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_AllBurnedCoins_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_AllBurnedCoins_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_AllBurnedCoins_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -511,6 +570,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_AllBurnedCoins_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_AllBurnedCoins_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_AllBurnedCoins_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -524,6 +603,8 @@ var ( pattern_Query_PublisherByIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"bze", "cointrunk", "publisher", "index"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_ArticlesByPrefix_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"bze", "cointrunk", "articles_by_prefix", "prefix"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_AllBurnedCoins_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "all_burned_coins"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -536,4 +617,6 @@ var ( forward_Query_PublisherByIndex_0 = runtime.ForwardResponseMessage forward_Query_ArticlesByPrefix_0 = runtime.ForwardResponseMessage + + forward_Query_AllBurnedCoins_0 = runtime.ForwardResponseMessage ) From 3c350b5a6aa3f53d635d2c2dbe52cebacef9ec69 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Sat, 26 Nov 2022 01:59:36 +0200 Subject: [PATCH 19/54] refactored article limit counter --- .../bze-alphateam/bze/bze.scavenge/index.ts | 40 ++++++++-------- .../bze/bze.scavenge/module/index.ts | 6 +-- x/cointrunk/keeper/cointrunk.go | 46 ++++++++++++------- x/cointrunk/keeper/msg_server_add_article.go | 2 +- x/cointrunk/types/key_article.go | 9 ++-- 5 files changed, 56 insertions(+), 47 deletions(-) diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 155d50b2..0b1e1ca7 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,6 +232,21 @@ export default { }, + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgSubmitScavenge(value) + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + }else{ + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + } + } + }, async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -262,22 +277,20 @@ export default { } } }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) const msg = await txClient.msgSubmitScavenge(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result + return msg } catch (e) { if (e == MissingWalletError) { throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + } else{ + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, - async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) @@ -304,19 +317,6 @@ export default { } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) - } - } - }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 9a3de64c..0e8c4c98 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; const types = [ + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/keeper/cointrunk.go b/x/cointrunk/keeper/cointrunk.go index e8af8732..c897192f 100644 --- a/x/cointrunk/keeper/cointrunk.go +++ b/x/cointrunk/keeper/cointrunk.go @@ -112,7 +112,7 @@ func (k Keeper) GetAllArticles(ctx sdk.Context) (list []types.Article) { } func (k Keeper) SetArticle(ctx sdk.Context, article types.Article) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.GenerateArticlePrefix(ctx))) + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ArticleKeyPrefix)) hash := md5.Sum([]byte(article.Url)) keyString := hex.EncodeToString(hash[:]) record := k.cdc.MustMarshal(&article) @@ -121,11 +121,17 @@ func (k Keeper) SetArticle(ctx sdk.Context, article types.Article) { record, ) - k.incrementCounter(ctx) + if article.Paid { + k.incrementMonthlyPaidArticleCounter(ctx) + } +} + +func (k Keeper) GetMonthlyPaidArticleCounter(ctx sdk.Context) uint64 { + return k.getCounter(ctx, types.GenerateMonthlyPaidArticleCounterPrefix(ctx)) } -func (k Keeper) GetCounter(ctx sdk.Context) (no uint64) { - counterStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.GenerateArticleCountPrefix(ctx))) +func (k Keeper) getCounter(ctx sdk.Context, storePrefix string) uint64 { + counterStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(storePrefix)) counter := counterStore.Get(types.ArticleKey(CounterKey)) if counter == nil { return 0 @@ -134,6 +140,25 @@ func (k Keeper) GetCounter(ctx sdk.Context) (no uint64) { return binary.BigEndian.Uint64(counter) } +func (k Keeper) incrementMonthlyPaidArticleCounter(ctx sdk.Context) uint64 { + return k.incrementCounter(ctx, types.GenerateMonthlyPaidArticleCounterPrefix(ctx)) +} + +func (k Keeper) incrementCounter(ctx sdk.Context, storePrefix string) uint64 { + no := k.getCounter(ctx, storePrefix) + no++ + counterStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(storePrefix)) + record := make([]byte, 8) + binary.BigEndian.PutUint64(record, no) + + counterStore.Set( + types.ArticleKey(CounterKey), + record, + ) + + return no +} + func (k Keeper) GetAllBurnedCoins(ctx sdk.Context) (list []types.BurnedCoins) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BurnedCoinsKeyPrefix)) iterator := sdk.KVStorePrefixIterator(store, []byte{}) @@ -156,16 +181,3 @@ func (k Keeper) SetBurnedCoins(ctx sdk.Context, burnedCoins types.BurnedCoins) { val, ) } - -func (k Keeper) incrementCounter(ctx sdk.Context) { - no := k.GetCounter(ctx) - no++ - counterStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.GenerateArticleCountPrefix(ctx))) - record := make([]byte, 8) - binary.BigEndian.PutUint64(record, no) - - counterStore.Set( - types.ArticleKey(CounterKey), - record, - ) -} diff --git a/x/cointrunk/keeper/msg_server_add_article.go b/x/cointrunk/keeper/msg_server_add_article.go index a48cc0c6..eadc9486 100644 --- a/x/cointrunk/keeper/msg_server_add_article.go +++ b/x/cointrunk/keeper/msg_server_add_article.go @@ -19,7 +19,7 @@ func (k msgServer) AddArticle(goCtx context.Context, msg *types.MsgAddArticle) ( paid := !found || publisher.Active != true if paid { articleLimit := k.AnonArticleLimit(ctx) - existingArticlesCount := k.GetCounter(ctx) + existingArticlesCount := k.GetMonthlyPaidArticleCounter(ctx) if existingArticlesCount >= articleLimit { return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Paid article limit reached for current period") } diff --git a/x/cointrunk/types/key_article.go b/x/cointrunk/types/key_article.go index 2626a507..867905cd 100644 --- a/x/cointrunk/types/key_article.go +++ b/x/cointrunk/types/key_article.go @@ -9,7 +9,8 @@ var _ binary.ByteOrder const ( // ArticleKeyPrefix is the prefix to retrieve all Article - ArticleKeyPrefix = "Article/value/" + ArticleKeyPrefix = "Article/value/" + ArticleCounterKeyPrefix = "Article/counter/" ) // ArticleKey returns the store key to retrieve a Publisher from the index fields @@ -25,10 +26,6 @@ func ArticleKey( return key } -func GenerateArticlePrefix(ctx sdk.Context) (prefix string) { - return ArticleKeyPrefix + ctx.BlockHeader().Time.Format("200601021506") -} - -func GenerateArticleCountPrefix(ctx sdk.Context) (prefix string) { +func GenerateMonthlyPaidArticleCounterPrefix(ctx sdk.Context) (prefix string) { return ctx.BlockHeader().Time.Format("200601") } From c45953dade8de0554688327cc28a7fbb22281ac9 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Sat, 26 Nov 2022 02:14:42 +0200 Subject: [PATCH 20/54] moved articles in lists --- docs/static/openapi.yml | 68 +++-- go.mod | 1 - go.sum | 1 - proto/cointrunk/query.proto | 9 +- .../bze-alphateam/bze/bze.cointrunk/index.ts | 20 +- .../bze/bze.cointrunk/module/rest.ts | 33 ++- .../module/types/cointrunk/query.ts | 99 +++---- .../client/cli/query_articles_by_prefix.go | 13 +- x/cointrunk/keeper/cointrunk.go | 21 +- ...y_prefix.go => grpc_query_all_articles.go} | 6 +- x/cointrunk/keeper/msg_server_add_article.go | 4 +- x/cointrunk/types/query.pb.go | 272 +++++++----------- x/cointrunk/types/query.pb.gw.go | 70 ++--- 13 files changed, 241 insertions(+), 376 deletions(-) rename x/cointrunk/keeper/{grpc_query_articles_by_prefix.go => grpc_query_all_articles.go} (77%) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 978c39c7..b1fdd672 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -127,25 +127,31 @@ paths: type: boolean tags: - Query - /bze/cointrunk/all_burned_coins: + /bze/cointrunk/all_articles: get: - summary: Queries a list of CoinsBurnEvents items. - operationId: BzeCointrunkAllBurnedCoins + summary: Queries a list of ArticlesByPrefix items. + operationId: BzeCointrunkAllArticles responses: '200': description: A successful response. schema: type: object properties: - burnedCoins: + article: type: array items: type: object properties: - burned: + title: type: string - height: + url: + type: string + picture: type: string + publisher: + type: string + paid: + type: boolean pagination: type: object properties: @@ -250,31 +256,25 @@ paths: type: boolean tags: - Query - '/bze/cointrunk/articles_by_prefix/{prefix}': + /bze/cointrunk/all_burned_coins: get: - summary: Queries a list of ArticlesByPrefix items. - operationId: BzeCointrunkArticlesByPrefix + summary: Queries a list of CoinsBurnEvents items. + operationId: BzeCointrunkAllBurnedCoins responses: '200': description: A successful response. schema: type: object properties: - article: + burnedCoins: type: array items: type: object properties: - title: - type: string - url: - type: string - picture: + burned: type: string - publisher: + height: type: string - paid: - type: boolean pagination: type: object properties: @@ -321,10 +321,6 @@ paths: type: string additionalProperties: {} parameters: - - name: prefix - in: path - required: true - type: string - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -30678,18 +30674,24 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - bze.cointrunk.QueryAllBurnedCoinsResponse: + bze.cointrunk.QueryAllArticlesResponse: type: object properties: - burnedCoins: + article: type: array items: type: object properties: - burned: + title: type: string - height: + url: + type: string + picture: + type: string + publisher: type: string + paid: + type: boolean pagination: type: object properties: @@ -30715,24 +30717,18 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - bze.cointrunk.QueryArticlesByPrefixResponse: + bze.cointrunk.QueryAllBurnedCoinsResponse: type: object properties: - article: + burnedCoins: type: array items: type: object properties: - title: - type: string - url: - type: string - picture: + burned: type: string - publisher: + height: type: string - paid: - type: boolean pagination: type: object properties: diff --git a/go.mod b/go.mod index 668e4275..1136f44a 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.19 require ( github.com/cosmos/cosmos-sdk v0.45.10 github.com/cosmos/ibc-go/v2 v2.4.2 - github.com/gobuffalo/packr/v2 v2.7.1 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 github.com/gorilla/mux v1.8.0 diff --git a/go.sum b/go.sum index c1daed6b..bc97a6aa 100644 --- a/go.sum +++ b/go.sum @@ -603,7 +603,6 @@ github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PL github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/gobuffalo/logger v1.0.3/go.mod h1:SoeejUwldiS7ZsyCBphOGURmWdwUFXs0J7TCjEhjKxM= github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= -github.com/gobuffalo/packr/v2 v2.7.1 h1:n3CIW5T17T8v4GGK5sWXLVWJhCz7b5aNLSxW6gYim4o= github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= github.com/gobuffalo/plush v3.8.3+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= github.com/gobuffalo/plushgen v0.1.2/go.mod h1:3U71v6HWZpVER1nInTXeAwdoRNsRd4W8aeIa1Lyp+Bk= diff --git a/proto/cointrunk/query.proto b/proto/cointrunk/query.proto index 293f3e12..66d0bb32 100644 --- a/proto/cointrunk/query.proto +++ b/proto/cointrunk/query.proto @@ -35,8 +35,8 @@ service Query { } // Queries a list of ArticlesByPrefix items. - rpc ArticlesByPrefix(QueryArticlesByPrefixRequest) returns (QueryArticlesByPrefixResponse) { - option (google.api.http).get = "/bze/cointrunk/articles_by_prefix/{prefix}"; + rpc AllArticles(QueryAllArticlesRequest) returns (QueryAllArticlesResponse) { + option (google.api.http).get = "/bze/cointrunk/all_articles"; } // Queries a list of CoinsBurnEvents items. @@ -82,12 +82,11 @@ message QueryPublisherByIndexResponse { Publisher publisher = 1 [(gogoproto.nullable) = false]; } -message QueryArticlesByPrefixRequest { - string prefix = 1; +message QueryAllArticlesRequest { cosmos.base.query.v1beta1.PageRequest pagination = 2; } -message QueryArticlesByPrefixResponse { +message QueryAllArticlesResponse { repeated Article article = 1 [(gogoproto.nullable) = false]; cosmos.base.query.v1beta1.PageResponse pagination = 2; } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts index 6e22458e..8e197c67 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts @@ -52,7 +52,7 @@ const getDefaultState = () => { AcceptedDomain: {}, Publisher: {}, PublisherByIndex: {}, - ArticlesByPrefix: {}, + AllArticles: {}, AllBurnedCoins: {}, _Structure: { @@ -116,11 +116,11 @@ export default { } return state.PublisherByIndex[JSON.stringify(params)] ?? {} }, - getArticlesByPrefix: (state) => (params = { params: {}}) => { + getAllArticles: (state) => (params = { params: {}}) => { if (!( params).query) { ( params).query=null } - return state.ArticlesByPrefix[JSON.stringify(params)] ?? {} + return state.AllArticles[JSON.stringify(params)] ?? {} }, getAllBurnedCoins: (state) => (params = { params: {}}) => { if (!( params).query) { @@ -263,22 +263,22 @@ export default { - async QueryArticlesByPrefix({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + async QueryAllArticles({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { try { const key = params ?? {}; const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryArticlesByPrefix( key.prefix, query)).data + let value= (await queryClient.queryAllArticles(query)).data while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryArticlesByPrefix( key.prefix, {...query, 'pagination.key':( value).pagination.next_key})).data + let next_values=(await queryClient.queryAllArticles({...query, 'pagination.key':( value).pagination.next_key})).data value = mergeResults(value, next_values); } - commit('QUERY', { query: 'ArticlesByPrefix', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryArticlesByPrefix', payload: { options: { all }, params: {...key},query }}) - return getters['getArticlesByPrefix']( { params: {...key}, query}) ?? {} + commit('QUERY', { query: 'AllArticles', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllArticles', payload: { options: { all }, params: {...key},query }}) + return getters['getAllArticles']( { params: {...key}, query}) ?? {} } catch (e) { - throw new Error('QueryClient:QueryArticlesByPrefix API Node Unavailable. Could not perform query: ' + e.message) + throw new Error('QueryClient:QueryAllArticles API Node Unavailable. Could not perform query: ' + e.message) } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts index 7ad74129..62ed3383 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts @@ -59,8 +59,8 @@ export interface CointrunkQueryAcceptedDomainResponse { pagination?: V1Beta1PageResponse; } -export interface CointrunkQueryAllBurnedCoinsResponse { - burnedCoins?: CointrunkBurnedCoins[]; +export interface CointrunkQueryAllArticlesResponse { + article?: CointrunkArticle[]; /** * PageResponse is to be embedded in gRPC response messages where the @@ -74,8 +74,8 @@ export interface CointrunkQueryAllBurnedCoinsResponse { pagination?: V1Beta1PageResponse; } -export interface CointrunkQueryArticlesByPrefixResponse { - article?: CointrunkArticle[]; +export interface CointrunkQueryAllBurnedCoinsResponse { + burnedCoins?: CointrunkBurnedCoins[]; /** * PageResponse is to be embedded in gRPC response messages where the @@ -416,11 +416,11 @@ export class Api extends HttpClient extends HttpClient - this.request({ - path: `/bze/cointrunk/all_burned_coins`, + this.request({ + path: `/bze/cointrunk/all_articles`, method: "GET", query: query, format: "json", @@ -442,12 +442,11 @@ export class Api extends HttpClient extends HttpClient - this.request({ - path: `/bze/cointrunk/articles_by_prefix/${prefix}`, + this.request({ + path: `/bze/cointrunk/all_burned_coins`, method: "GET", query: query, format: "json", diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts index ffcc18f8..f165049e 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts @@ -47,12 +47,11 @@ export interface QueryPublisherByIndexResponse { publisher: Publisher | undefined; } -export interface QueryArticlesByPrefixRequest { - prefix: string; +export interface QueryAllArticlesRequest { pagination: PageRequest | undefined; } -export interface QueryArticlesByPrefixResponse { +export interface QueryAllArticlesResponse { article: Article[]; pagination: PageResponse | undefined; } @@ -634,37 +633,28 @@ export const QueryPublisherByIndexResponse = { }, }; -const baseQueryArticlesByPrefixRequest: object = { prefix: "" }; +const baseQueryAllArticlesRequest: object = {}; -export const QueryArticlesByPrefixRequest = { +export const QueryAllArticlesRequest = { encode( - message: QueryArticlesByPrefixRequest, + message: QueryAllArticlesRequest, writer: Writer = Writer.create() ): Writer { - if (message.prefix !== "") { - writer.uint32(10).string(message.prefix); - } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: Reader | Uint8Array, - length?: number - ): QueryArticlesByPrefixRequest { + decode(input: Reader | Uint8Array, length?: number): QueryAllArticlesRequest { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseQueryArticlesByPrefixRequest, - } as QueryArticlesByPrefixRequest; + ...baseQueryAllArticlesRequest, + } as QueryAllArticlesRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.prefix = reader.string(); - break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); break; @@ -676,15 +666,10 @@ export const QueryArticlesByPrefixRequest = { return message; }, - fromJSON(object: any): QueryArticlesByPrefixRequest { + fromJSON(object: any): QueryAllArticlesRequest { const message = { - ...baseQueryArticlesByPrefixRequest, - } as QueryArticlesByPrefixRequest; - if (object.prefix !== undefined && object.prefix !== null) { - message.prefix = String(object.prefix); - } else { - message.prefix = ""; - } + ...baseQueryAllArticlesRequest, + } as QueryAllArticlesRequest; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromJSON(object.pagination); } else { @@ -693,9 +678,8 @@ export const QueryArticlesByPrefixRequest = { return message; }, - toJSON(message: QueryArticlesByPrefixRequest): unknown { + toJSON(message: QueryAllArticlesRequest): unknown { const obj: any = {}; - message.prefix !== undefined && (obj.prefix = message.prefix); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) @@ -704,16 +688,11 @@ export const QueryArticlesByPrefixRequest = { }, fromPartial( - object: DeepPartial - ): QueryArticlesByPrefixRequest { + object: DeepPartial + ): QueryAllArticlesRequest { const message = { - ...baseQueryArticlesByPrefixRequest, - } as QueryArticlesByPrefixRequest; - if (object.prefix !== undefined && object.prefix !== null) { - message.prefix = object.prefix; - } else { - message.prefix = ""; - } + ...baseQueryAllArticlesRequest, + } as QueryAllArticlesRequest; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); } else { @@ -723,11 +702,11 @@ export const QueryArticlesByPrefixRequest = { }, }; -const baseQueryArticlesByPrefixResponse: object = {}; +const baseQueryAllArticlesResponse: object = {}; -export const QueryArticlesByPrefixResponse = { +export const QueryAllArticlesResponse = { encode( - message: QueryArticlesByPrefixResponse, + message: QueryAllArticlesResponse, writer: Writer = Writer.create() ): Writer { for (const v of message.article) { @@ -745,12 +724,12 @@ export const QueryArticlesByPrefixResponse = { decode( input: Reader | Uint8Array, length?: number - ): QueryArticlesByPrefixResponse { + ): QueryAllArticlesResponse { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseQueryArticlesByPrefixResponse, - } as QueryArticlesByPrefixResponse; + ...baseQueryAllArticlesResponse, + } as QueryAllArticlesResponse; message.article = []; while (reader.pos < end) { const tag = reader.uint32(); @@ -769,10 +748,10 @@ export const QueryArticlesByPrefixResponse = { return message; }, - fromJSON(object: any): QueryArticlesByPrefixResponse { + fromJSON(object: any): QueryAllArticlesResponse { const message = { - ...baseQueryArticlesByPrefixResponse, - } as QueryArticlesByPrefixResponse; + ...baseQueryAllArticlesResponse, + } as QueryAllArticlesResponse; message.article = []; if (object.article !== undefined && object.article !== null) { for (const e of object.article) { @@ -787,7 +766,7 @@ export const QueryArticlesByPrefixResponse = { return message; }, - toJSON(message: QueryArticlesByPrefixResponse): unknown { + toJSON(message: QueryAllArticlesResponse): unknown { const obj: any = {}; if (message.article) { obj.article = message.article.map((e) => @@ -804,11 +783,11 @@ export const QueryArticlesByPrefixResponse = { }, fromPartial( - object: DeepPartial - ): QueryArticlesByPrefixResponse { + object: DeepPartial + ): QueryAllArticlesResponse { const message = { - ...baseQueryArticlesByPrefixResponse, - } as QueryArticlesByPrefixResponse; + ...baseQueryAllArticlesResponse, + } as QueryAllArticlesResponse; message.article = []; if (object.article !== undefined && object.article !== null) { for (const e of object.article) { @@ -1012,9 +991,9 @@ export interface Query { request: QueryPublisherByIndexRequest ): Promise; /** Queries a list of ArticlesByPrefix items. */ - ArticlesByPrefix( - request: QueryArticlesByPrefixRequest - ): Promise; + AllArticles( + request: QueryAllArticlesRequest + ): Promise; /** Queries a list of CoinsBurnEvents items. */ AllBurnedCoins( request: QueryAllBurnedCoinsRequest @@ -1068,17 +1047,17 @@ export class QueryClientImpl implements Query { ); } - ArticlesByPrefix( - request: QueryArticlesByPrefixRequest - ): Promise { - const data = QueryArticlesByPrefixRequest.encode(request).finish(); + AllArticles( + request: QueryAllArticlesRequest + ): Promise { + const data = QueryAllArticlesRequest.encode(request).finish(); const promise = this.rpc.request( "bze.cointrunk.Query", - "ArticlesByPrefix", + "AllArticles", data ); return promise.then((data) => - QueryArticlesByPrefixResponse.decode(new Reader(data)) + QueryAllArticlesResponse.decode(new Reader(data)) ); } diff --git a/x/cointrunk/client/cli/query_articles_by_prefix.go b/x/cointrunk/client/cli/query_articles_by_prefix.go index 95c13f92..645230e2 100644 --- a/x/cointrunk/client/cli/query_articles_by_prefix.go +++ b/x/cointrunk/client/cli/query_articles_by_prefix.go @@ -13,11 +13,10 @@ var _ = strconv.Itoa(0) func CmdArticlesByPrefix() *cobra.Command { cmd := &cobra.Command{ - Use: "articles-by-prefix [prefix]", - Short: "Query ArticlesByPrefix", - Args: cobra.ExactArgs(1), + Use: "all-articles", + Short: "Query all articles", + Args: cobra.ExactArgs(0), RunE: func(cmd *cobra.Command, args []string) (err error) { - reqPrefix := args[0] clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -26,9 +25,7 @@ func CmdArticlesByPrefix() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) - params := &types.QueryArticlesByPrefixRequest{ - Prefix: reqPrefix, - } + params := &types.QueryAllArticlesRequest{} pageReq, err := client.ReadPageRequest(cmd.Flags()) if err != nil { @@ -36,7 +33,7 @@ func CmdArticlesByPrefix() *cobra.Command { } params.Pagination = pageReq - res, err := queryClient.ArticlesByPrefix(cmd.Context(), params) + res, err := queryClient.AllArticles(cmd.Context(), params) if err != nil { return err } diff --git a/x/cointrunk/keeper/cointrunk.go b/x/cointrunk/keeper/cointrunk.go index c897192f..b1f57331 100644 --- a/x/cointrunk/keeper/cointrunk.go +++ b/x/cointrunk/keeper/cointrunk.go @@ -1,12 +1,11 @@ package keeper import ( - "crypto/md5" "encoding/binary" "github.com/bze-alphateam/bze/x/cointrunk/types" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/gobuffalo/packr/v2/file/resolver/encoding/hex" + "strconv" ) const ( @@ -83,20 +82,6 @@ func (k Keeper) SetAcceptedDomain(ctx sdk.Context, acceptedDomain types.Accepted ) } -func (k Keeper) GetArticlesByPrefix(ctx sdk.Context, pre string) (list []types.Article) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ArticleKeyPrefix+pre)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.Article - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return -} - func (k Keeper) GetAllArticles(ctx sdk.Context) (list []types.Article) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ArticleKeyPrefix)) iterator := sdk.KVStorePrefixIterator(store, []byte{}) @@ -113,8 +98,8 @@ func (k Keeper) GetAllArticles(ctx sdk.Context) (list []types.Article) { func (k Keeper) SetArticle(ctx sdk.Context, article types.Article) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ArticleKeyPrefix)) - hash := md5.Sum([]byte(article.Url)) - keyString := hex.EncodeToString(hash[:]) + articleCounter := k.incrementCounter(ctx, types.ArticleCounterKeyPrefix) + keyString := strconv.FormatUint(articleCounter, 10) record := k.cdc.MustMarshal(&article) store.Set( types.ArticleKey(keyString), diff --git a/x/cointrunk/keeper/grpc_query_articles_by_prefix.go b/x/cointrunk/keeper/grpc_query_all_articles.go similarity index 77% rename from x/cointrunk/keeper/grpc_query_articles_by_prefix.go rename to x/cointrunk/keeper/grpc_query_all_articles.go index e70afab4..b48b2d21 100644 --- a/x/cointrunk/keeper/grpc_query_articles_by_prefix.go +++ b/x/cointrunk/keeper/grpc_query_all_articles.go @@ -11,7 +11,7 @@ import ( "google.golang.org/grpc/status" ) -func (k Keeper) ArticlesByPrefix(goCtx context.Context, req *types.QueryArticlesByPrefixRequest) (*types.QueryArticlesByPrefixResponse, error) { +func (k Keeper) AllArticles(goCtx context.Context, req *types.QueryAllArticlesRequest) (*types.QueryAllArticlesResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -19,7 +19,7 @@ func (k Keeper) ArticlesByPrefix(goCtx context.Context, req *types.QueryArticles ctx := sdk.UnwrapSDKContext(goCtx) var articles []types.Article store := ctx.KVStore(k.storeKey) - articlesStore := prefix.NewStore(store, types.KeyPrefix(types.ArticleKeyPrefix+req.Prefix)) + articlesStore := prefix.NewStore(store, types.KeyPrefix(types.ArticleKeyPrefix)) pageRes, err := query.Paginate(articlesStore, req.Pagination, func(key []byte, value []byte) error { var article types.Article if err := k.cdc.Unmarshal(value, &article); err != nil { @@ -35,5 +35,5 @@ func (k Keeper) ArticlesByPrefix(goCtx context.Context, req *types.QueryArticles _ = ctx - return &types.QueryArticlesByPrefixResponse{Article: articles, Pagination: pageRes}, nil + return &types.QueryAllArticlesResponse{Article: articles, Pagination: pageRes}, nil } diff --git a/x/cointrunk/keeper/msg_server_add_article.go b/x/cointrunk/keeper/msg_server_add_article.go index eadc9486..3c719d5d 100644 --- a/x/cointrunk/keeper/msg_server_add_article.go +++ b/x/cointrunk/keeper/msg_server_add_article.go @@ -19,8 +19,8 @@ func (k msgServer) AddArticle(goCtx context.Context, msg *types.MsgAddArticle) ( paid := !found || publisher.Active != true if paid { articleLimit := k.AnonArticleLimit(ctx) - existingArticlesCount := k.GetMonthlyPaidArticleCounter(ctx) - if existingArticlesCount >= articleLimit { + existingPaidArticlesCount := k.GetMonthlyPaidArticleCounter(ctx) + if existingPaidArticlesCount >= articleLimit { return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Paid article limit reached for current period") } diff --git a/x/cointrunk/types/query.pb.go b/x/cointrunk/types/query.pb.go index 79445c39..99b6f08b 100644 --- a/x/cointrunk/types/query.pb.go +++ b/x/cointrunk/types/query.pb.go @@ -393,23 +393,22 @@ func (m *QueryPublisherByIndexResponse) GetPublisher() Publisher { return Publisher{} } -type QueryArticlesByPrefixRequest struct { - Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"` +type QueryAllArticlesRequest struct { Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryArticlesByPrefixRequest) Reset() { *m = QueryArticlesByPrefixRequest{} } -func (m *QueryArticlesByPrefixRequest) String() string { return proto.CompactTextString(m) } -func (*QueryArticlesByPrefixRequest) ProtoMessage() {} -func (*QueryArticlesByPrefixRequest) Descriptor() ([]byte, []int) { +func (m *QueryAllArticlesRequest) Reset() { *m = QueryAllArticlesRequest{} } +func (m *QueryAllArticlesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllArticlesRequest) ProtoMessage() {} +func (*QueryAllArticlesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_12b6eb50b0e9fa00, []int{8} } -func (m *QueryArticlesByPrefixRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryAllArticlesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryArticlesByPrefixRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllArticlesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryArticlesByPrefixRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllArticlesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -419,49 +418,42 @@ func (m *QueryArticlesByPrefixRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *QueryArticlesByPrefixRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryArticlesByPrefixRequest.Merge(m, src) +func (m *QueryAllArticlesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllArticlesRequest.Merge(m, src) } -func (m *QueryArticlesByPrefixRequest) XXX_Size() int { +func (m *QueryAllArticlesRequest) XXX_Size() int { return m.Size() } -func (m *QueryArticlesByPrefixRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryArticlesByPrefixRequest.DiscardUnknown(m) +func (m *QueryAllArticlesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllArticlesRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryArticlesByPrefixRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryAllArticlesRequest proto.InternalMessageInfo -func (m *QueryArticlesByPrefixRequest) GetPrefix() string { - if m != nil { - return m.Prefix - } - return "" -} - -func (m *QueryArticlesByPrefixRequest) GetPagination() *query.PageRequest { +func (m *QueryAllArticlesRequest) GetPagination() *query.PageRequest { if m != nil { return m.Pagination } return nil } -type QueryArticlesByPrefixResponse struct { +type QueryAllArticlesResponse struct { Article []Article `protobuf:"bytes,1,rep,name=article,proto3" json:"article"` Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryArticlesByPrefixResponse) Reset() { *m = QueryArticlesByPrefixResponse{} } -func (m *QueryArticlesByPrefixResponse) String() string { return proto.CompactTextString(m) } -func (*QueryArticlesByPrefixResponse) ProtoMessage() {} -func (*QueryArticlesByPrefixResponse) Descriptor() ([]byte, []int) { +func (m *QueryAllArticlesResponse) Reset() { *m = QueryAllArticlesResponse{} } +func (m *QueryAllArticlesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllArticlesResponse) ProtoMessage() {} +func (*QueryAllArticlesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_12b6eb50b0e9fa00, []int{9} } -func (m *QueryArticlesByPrefixResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryAllArticlesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryArticlesByPrefixResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAllArticlesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryArticlesByPrefixResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAllArticlesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -471,26 +463,26 @@ func (m *QueryArticlesByPrefixResponse) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } -func (m *QueryArticlesByPrefixResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryArticlesByPrefixResponse.Merge(m, src) +func (m *QueryAllArticlesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllArticlesResponse.Merge(m, src) } -func (m *QueryArticlesByPrefixResponse) XXX_Size() int { +func (m *QueryAllArticlesResponse) XXX_Size() int { return m.Size() } -func (m *QueryArticlesByPrefixResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryArticlesByPrefixResponse.DiscardUnknown(m) +func (m *QueryAllArticlesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllArticlesResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryArticlesByPrefixResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryAllArticlesResponse proto.InternalMessageInfo -func (m *QueryArticlesByPrefixResponse) GetArticle() []Article { +func (m *QueryAllArticlesResponse) GetArticle() []Article { if m != nil { return m.Article } return nil } -func (m *QueryArticlesByPrefixResponse) GetPagination() *query.PageResponse { +func (m *QueryAllArticlesResponse) GetPagination() *query.PageResponse { if m != nil { return m.Pagination } @@ -602,8 +594,8 @@ func init() { proto.RegisterType((*QueryPublisherResponse)(nil), "bze.cointrunk.QueryPublisherResponse") proto.RegisterType((*QueryPublisherByIndexRequest)(nil), "bze.cointrunk.QueryPublisherByIndexRequest") proto.RegisterType((*QueryPublisherByIndexResponse)(nil), "bze.cointrunk.QueryPublisherByIndexResponse") - proto.RegisterType((*QueryArticlesByPrefixRequest)(nil), "bze.cointrunk.QueryArticlesByPrefixRequest") - proto.RegisterType((*QueryArticlesByPrefixResponse)(nil), "bze.cointrunk.QueryArticlesByPrefixResponse") + proto.RegisterType((*QueryAllArticlesRequest)(nil), "bze.cointrunk.QueryAllArticlesRequest") + proto.RegisterType((*QueryAllArticlesResponse)(nil), "bze.cointrunk.QueryAllArticlesResponse") proto.RegisterType((*QueryAllBurnedCoinsRequest)(nil), "bze.cointrunk.QueryAllBurnedCoinsRequest") proto.RegisterType((*QueryAllBurnedCoinsResponse)(nil), "bze.cointrunk.QueryAllBurnedCoinsResponse") } @@ -611,56 +603,55 @@ func init() { func init() { proto.RegisterFile("cointrunk/query.proto", fileDescriptor_12b6eb50b0e9fa00) } var fileDescriptor_12b6eb50b0e9fa00 = []byte{ - // 781 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcf, 0x4f, 0x13, 0x41, - 0x14, 0xc7, 0xbb, 0x28, 0x35, 0x0c, 0x91, 0x90, 0x91, 0x16, 0x58, 0xa0, 0x94, 0x8d, 0x02, 0x22, - 0xee, 0x86, 0x62, 0x3c, 0x79, 0xa1, 0x1a, 0x7f, 0x5e, 0xb0, 0x47, 0x13, 0xd3, 0xcc, 0xb6, 0xe3, - 0xb2, 0x71, 0xbb, 0xb3, 0xec, 0x6e, 0x0d, 0x85, 0xe0, 0xc1, 0x7f, 0x40, 0x12, 0x0f, 0x1e, 0xd5, - 0xab, 0x57, 0xff, 0x09, 0x8e, 0x24, 0x1e, 0xf4, 0x64, 0x0c, 0xf8, 0x87, 0x98, 0x9d, 0x79, 0xdb, - 0xee, 0x0e, 0x5b, 0x40, 0xd3, 0x13, 0xcc, 0xcc, 0x7b, 0x6f, 0x3e, 0xef, 0xfb, 0xe6, 0xbd, 0x2e, - 0x2a, 0x34, 0x98, 0xed, 0x86, 0x7e, 0xdb, 0x7d, 0x6d, 0x6c, 0xb7, 0xa9, 0xdf, 0xd1, 0x3d, 0x9f, - 0x85, 0x0c, 0x5f, 0x35, 0x77, 0xa9, 0xde, 0x3d, 0x52, 0x27, 0x2c, 0x66, 0x31, 0x7e, 0x62, 0x44, - 0xff, 0x09, 0x23, 0x75, 0xd6, 0x62, 0xcc, 0x72, 0xa8, 0x41, 0x3c, 0xdb, 0x20, 0xae, 0xcb, 0x42, - 0x12, 0xda, 0xcc, 0x0d, 0xe0, 0x74, 0xa5, 0xc1, 0x82, 0x16, 0x0b, 0x0c, 0x93, 0x04, 0x54, 0xc4, - 0x36, 0xde, 0xac, 0x99, 0x34, 0x24, 0x6b, 0x86, 0x47, 0x2c, 0xdb, 0xe5, 0xc6, 0x60, 0x5b, 0xec, - 0x51, 0x78, 0xc4, 0x27, 0xad, 0x38, 0xc6, 0x7c, 0x6f, 0x9f, 0x34, 0x1a, 0xd4, 0x0b, 0x69, 0xb3, - 0xde, 0x64, 0x2d, 0x62, 0xc7, 0x8e, 0xd3, 0x09, 0xc7, 0xb6, 0xe9, 0xd8, 0xc1, 0x16, 0xf5, 0xe1, - 0x68, 0x32, 0xe1, 0xeb, 0x87, 0x76, 0xc3, 0xa1, 0x31, 0x76, 0xef, 0xc0, 0x6c, 0xfb, 0x2e, 0x6d, - 0xd6, 0xa3, 0x0d, 0xb8, 0x52, 0x9b, 0x40, 0xf8, 0x79, 0x04, 0xbb, 0xc9, 0x39, 0x6a, 0x74, 0xbb, - 0x4d, 0x83, 0x50, 0x7b, 0x8a, 0xae, 0xa5, 0x76, 0x03, 0x8f, 0xb9, 0x01, 0xc5, 0xeb, 0x28, 0x2f, - 0x78, 0xa7, 0x94, 0xb2, 0xb2, 0x3c, 0x5a, 0x29, 0xe8, 0x29, 0xdd, 0x74, 0x61, 0x5e, 0xbd, 0x7c, - 0xf8, 0x6b, 0x3e, 0x57, 0x03, 0x53, 0xad, 0x89, 0x54, 0x1e, 0x6b, 0x03, 0x32, 0x7a, 0xc0, 0x13, - 0x82, 0x9b, 0xf0, 0x43, 0x84, 0x7a, 0xf2, 0x40, 0xd8, 0x45, 0x5d, 0x68, 0xa9, 0x47, 0x5a, 0xea, - 0xa2, 0x4e, 0xa0, 0xa5, 0xbe, 0x49, 0x2c, 0x0a, 0xbe, 0xb5, 0x84, 0xa7, 0xf6, 0x4d, 0x41, 0x33, - 0x99, 0xd7, 0x00, 0xfa, 0x33, 0x34, 0x46, 0x52, 0x27, 0x53, 0x4a, 0xf9, 0xd2, 0xf2, 0x68, 0x65, - 0x4e, 0x4a, 0x21, 0xed, 0x0e, 0xa9, 0x48, 0xae, 0xf8, 0x51, 0x0a, 0x7a, 0x88, 0x43, 0x2f, 0x9d, - 0x0b, 0x2d, 0x48, 0x52, 0xd4, 0x75, 0x54, 0x10, 0x3a, 0xc7, 0xc5, 0x1c, 0xb4, 0x2c, 0x9f, 0x14, - 0x54, 0x94, 0x6f, 0x00, 0x45, 0xee, 0xa1, 0x91, 0xee, 0x1b, 0x02, 0x31, 0xa6, 0xe4, 0x7a, 0xc6, - 0xe7, 0xa0, 0x43, 0xcf, 0x61, 0x70, 0x12, 0xdc, 0x41, 0xb3, 0x69, 0xc0, 0x6a, 0xe7, 0x89, 0xdb, - 0xa4, 0x3b, 0xb1, 0x12, 0x13, 0x68, 0xd8, 0x8e, 0xd6, 0x5c, 0x84, 0x91, 0x9a, 0x58, 0x68, 0x2f, - 0xd1, 0x5c, 0x1f, 0xaf, 0xec, 0xec, 0x94, 0x7f, 0xca, 0x4e, 0x7b, 0x0b, 0x50, 0x1b, 0xa2, 0x93, - 0x82, 0x6a, 0x67, 0xd3, 0xa7, 0xaf, 0xec, 0x2e, 0x54, 0x11, 0xe5, 0x3d, 0xbe, 0x01, 0x54, 0xb0, - 0x92, 0xca, 0x36, 0xf4, 0xdf, 0x65, 0xfb, 0xac, 0x40, 0x7e, 0xa7, 0x01, 0x20, 0xbf, 0xbb, 0xe8, - 0x0a, 0xb4, 0x39, 0xd4, 0xae, 0x28, 0x3f, 0x64, 0x71, 0x0a, 0xb9, 0xc5, 0xc6, 0x83, 0xab, 0x5b, - 0xb7, 0xad, 0x1d, 0xa7, 0xca, 0xc7, 0xca, 0xfd, 0x68, 0xaa, 0x0c, 0xfa, 0xfd, 0x7e, 0xed, 0xb6, - 0xb5, 0x74, 0x0d, 0xc8, 0x50, 0x45, 0xa3, 0x66, 0x6f, 0x1b, 0xa4, 0x50, 0x25, 0x29, 0x12, 0x8e, - 0x20, 0x47, 0xd2, 0x69, 0x60, 0x92, 0x54, 0x7e, 0xe4, 0xd1, 0x30, 0x87, 0xc5, 0x2e, 0xca, 0x8b, - 0x59, 0x88, 0x17, 0x24, 0x96, 0xd3, 0xc3, 0x56, 0xd5, 0xce, 0x32, 0x11, 0xd7, 0x68, 0x73, 0xef, - 0xbe, 0xff, 0xf9, 0x30, 0x34, 0x89, 0x0b, 0x86, 0xb9, 0x4b, 0x0d, 0xf9, 0xe7, 0x03, 0xbf, 0x57, - 0xd0, 0x58, 0x7a, 0x72, 0xe1, 0x9b, 0x59, 0x51, 0x33, 0x67, 0xb0, 0xba, 0x72, 0x11, 0x53, 0x00, - 0x59, 0xe4, 0x20, 0x65, 0x5c, 0x92, 0x40, 0xa4, 0xdf, 0x2b, 0xbc, 0x87, 0x46, 0xba, 0xfd, 0x85, - 0xaf, 0x67, 0x66, 0x28, 0xcd, 0x3c, 0xf5, 0xc6, 0x39, 0x56, 0x40, 0xb0, 0xc0, 0x09, 0x66, 0xf0, - 0xb4, 0x2c, 0x45, 0x6c, 0x19, 0xe0, 0x8f, 0x0a, 0x1a, 0x97, 0x27, 0x03, 0xbe, 0x75, 0x66, 0xf8, - 0xf4, 0xd4, 0x51, 0x57, 0x2f, 0x66, 0x0c, 0x48, 0xcb, 0x1c, 0x49, 0xc3, 0xe5, 0x7e, 0x48, 0xc6, - 0x1e, 0x1f, 0x5b, 0xfb, 0xf8, 0x8b, 0x82, 0xc6, 0xe5, 0x9e, 0xce, 0x26, 0xeb, 0x33, 0x7a, 0xb2, - 0xc9, 0xfa, 0x8d, 0x09, 0xad, 0xc2, 0xc9, 0x56, 0xf1, 0x8a, 0x5c, 0x2e, 0x70, 0xa8, 0x9b, 0x9d, - 0xba, 0x98, 0x5d, 0xc6, 0x9e, 0xf8, 0xbb, 0x8f, 0x0f, 0xa2, 0xc7, 0x94, 0x6a, 0xb7, 0x3e, 0x8f, - 0x29, 0xab, 0xf3, 0xfb, 0x3c, 0xa6, 0xcc, 0xee, 0xd5, 0x96, 0x38, 0xdd, 0x02, 0x9e, 0x97, 0xe9, - 0x1c, 0xa7, 0x9e, 0xfc, 0x56, 0xa9, 0x3e, 0x3e, 0x3c, 0x2e, 0x29, 0x47, 0xc7, 0x25, 0xe5, 0xf7, - 0x71, 0x49, 0x39, 0x38, 0x29, 0xe5, 0x8e, 0x4e, 0x4a, 0xb9, 0x9f, 0x27, 0xa5, 0xdc, 0x0b, 0xdd, - 0xb2, 0xc3, 0xad, 0xb6, 0xa9, 0x37, 0x58, 0x2b, 0x0a, 0x72, 0x9b, 0x38, 0xde, 0x16, 0x09, 0x29, - 0xe1, 0x2b, 0x63, 0x27, 0x11, 0x34, 0xec, 0x78, 0x34, 0x30, 0xf3, 0xfc, 0xb3, 0x67, 0xfd, 0x6f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x2a, 0x2a, 0xef, 0x4e, 0x09, 0x0a, 0x00, 0x00, + // 760 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x3d, 0x6f, 0xd3, 0x40, + 0x18, 0xc7, 0xe3, 0x42, 0x83, 0x7a, 0x11, 0x15, 0x3a, 0x9a, 0x36, 0x75, 0x1b, 0x37, 0x35, 0xd0, + 0x96, 0x02, 0xb6, 0xda, 0x22, 0x26, 0x96, 0x06, 0xc4, 0xeb, 0x52, 0x32, 0x22, 0xa1, 0xe8, 0x9c, + 0x9c, 0x5c, 0x0b, 0xc7, 0xe7, 0xda, 0x0e, 0xea, 0x8b, 0x58, 0xe0, 0x03, 0x50, 0x89, 0x81, 0x81, + 0x81, 0x9d, 0x95, 0x89, 0x6f, 0xd0, 0xb1, 0x12, 0x0b, 0x13, 0x42, 0x2d, 0x1f, 0x04, 0xf9, 0xee, + 0x71, 0x62, 0x5f, 0x9d, 0xb6, 0xa0, 0x6c, 0xb1, 0x9f, 0xb7, 0xdf, 0xfd, 0x9f, 0x7b, 0x9e, 0x18, + 0x95, 0x5b, 0xcc, 0xf1, 0xa2, 0xa0, 0xeb, 0xbd, 0x36, 0xb7, 0xba, 0x34, 0xd8, 0x31, 0xfc, 0x80, + 0x45, 0x0c, 0x5f, 0xb6, 0x76, 0xa9, 0xd1, 0x33, 0xa9, 0x13, 0x36, 0xb3, 0x19, 0xb7, 0x98, 0xf1, + 0x2f, 0xe1, 0xa4, 0xce, 0xda, 0x8c, 0xd9, 0x2e, 0x35, 0x89, 0xef, 0x98, 0xc4, 0xf3, 0x58, 0x44, + 0x22, 0x87, 0x79, 0x21, 0x58, 0x97, 0x5b, 0x2c, 0xec, 0xb0, 0xd0, 0xb4, 0x48, 0x48, 0x45, 0x6e, + 0xf3, 0xcd, 0x8a, 0x45, 0x23, 0xb2, 0x62, 0xfa, 0xc4, 0x76, 0x3c, 0xee, 0x0c, 0xbe, 0x93, 0x7d, + 0x0a, 0x9f, 0x04, 0xa4, 0x93, 0xe4, 0x98, 0xeb, 0xbf, 0x27, 0xad, 0x16, 0xf5, 0x23, 0xda, 0x6e, + 0xb6, 0x59, 0x87, 0x38, 0x49, 0xe0, 0x74, 0x2a, 0xb0, 0x6b, 0xb9, 0x4e, 0xb8, 0x49, 0x03, 0x30, + 0x4d, 0xa5, 0x62, 0x83, 0xc8, 0x69, 0xb9, 0x34, 0xc1, 0xee, 0x1b, 0xac, 0x6e, 0xe0, 0xd1, 0x76, + 0x33, 0x7e, 0x01, 0x25, 0xf5, 0x09, 0x84, 0x5f, 0xc4, 0xb0, 0x1b, 0x9c, 0xa3, 0x41, 0xb7, 0xba, + 0x34, 0x8c, 0xf4, 0x67, 0xe8, 0x6a, 0xe6, 0x6d, 0xe8, 0x33, 0x2f, 0xa4, 0x78, 0x0d, 0x15, 0x05, + 0x6f, 0x45, 0xa9, 0x29, 0x4b, 0xa5, 0xd5, 0xb2, 0x91, 0xd1, 0xcd, 0x10, 0xee, 0xf5, 0x8b, 0x07, + 0xbf, 0xe6, 0x0a, 0x0d, 0x70, 0xd5, 0xdb, 0x48, 0xe5, 0xb9, 0xd6, 0xe1, 0x44, 0x0f, 0xf9, 0x81, + 0xa0, 0x12, 0x7e, 0x84, 0x50, 0x5f, 0x1e, 0x48, 0xbb, 0x60, 0x08, 0x2d, 0x8d, 0x58, 0x4b, 0x43, + 0xf4, 0x09, 0xb4, 0x34, 0x36, 0x88, 0x4d, 0x21, 0xb6, 0x91, 0x8a, 0xd4, 0xbf, 0x29, 0x68, 0x26, + 0xb7, 0x0c, 0xa0, 0x3f, 0x47, 0xe3, 0x24, 0x63, 0xa9, 0x28, 0xb5, 0x0b, 0x4b, 0xa5, 0xd5, 0xaa, + 0x74, 0x84, 0x6c, 0x38, 0x1c, 0x45, 0x0a, 0xc5, 0x8f, 0x33, 0xd0, 0x23, 0x1c, 0x7a, 0xf1, 0x4c, + 0x68, 0x41, 0x92, 0xa1, 0x6e, 0xa2, 0xb2, 0xd0, 0x39, 0x69, 0xe6, 0xb0, 0x65, 0xf9, 0xa2, 0xa0, + 0x49, 0xb9, 0x02, 0x28, 0x72, 0x1f, 0x8d, 0xf5, 0xee, 0x10, 0x88, 0x51, 0x91, 0xfb, 0x99, 0xd8, + 0x41, 0x87, 0x7e, 0xc0, 0xf0, 0x24, 0xb8, 0x8b, 0x66, 0xb3, 0x80, 0xf5, 0x9d, 0xa7, 0x5e, 0x9b, + 0x6e, 0x27, 0x4a, 0x4c, 0xa0, 0x51, 0x27, 0x7e, 0xe6, 0x22, 0x8c, 0x35, 0xc4, 0x83, 0xfe, 0x0a, + 0x55, 0x07, 0x44, 0xe5, 0x9f, 0x4e, 0xf9, 0xa7, 0xd3, 0xe9, 0x04, 0x4d, 0x89, 0xcb, 0xe4, 0xba, + 0xeb, 0x62, 0x98, 0xc2, 0xfc, 0xce, 0x8c, 0xfc, 0x77, 0x67, 0x3e, 0x2b, 0xa8, 0x72, 0xb2, 0x06, + 0xd0, 0xdf, 0x43, 0x97, 0x60, 0x88, 0xa1, 0x33, 0x93, 0xf2, 0x35, 0x15, 0x56, 0x20, 0x4f, 0x9c, + 0x87, 0xd7, 0x95, 0xde, 0xd0, 0xba, 0x6e, 0x9d, 0x2f, 0x8d, 0x07, 0xf1, 0xce, 0x18, 0xf6, 0xed, + 0xfc, 0xda, 0x1b, 0x5a, 0xa9, 0x0c, 0xc8, 0x50, 0x47, 0x25, 0xab, 0xff, 0x1a, 0xa4, 0x50, 0x25, + 0x29, 0x52, 0x81, 0x20, 0x47, 0x3a, 0x68, 0x68, 0x92, 0xac, 0x7e, 0x2f, 0xa2, 0x51, 0x0e, 0x8b, + 0x3d, 0x54, 0x14, 0x9b, 0x0e, 0xcf, 0x4b, 0x2c, 0x27, 0x57, 0xa9, 0xaa, 0x9f, 0xe6, 0x22, 0xca, + 0xe8, 0xd5, 0x77, 0x3f, 0xfe, 0x7c, 0x1c, 0x99, 0xc2, 0x65, 0xd3, 0xda, 0xa5, 0xa6, 0xfc, 0xe7, + 0x80, 0x3f, 0x28, 0x68, 0x3c, 0xbb, 0x97, 0xf0, 0xcd, 0xbc, 0xac, 0xb9, 0x1b, 0x56, 0x5d, 0x3e, + 0x8f, 0x2b, 0x80, 0x2c, 0x70, 0x90, 0x1a, 0xd6, 0x24, 0x10, 0xe9, 0xdf, 0x08, 0xef, 0xa1, 0xb1, + 0xde, 0xf4, 0xe0, 0xeb, 0xb9, 0x27, 0x94, 0x36, 0x9a, 0x7a, 0xe3, 0x0c, 0x2f, 0x20, 0x98, 0xe7, + 0x04, 0x33, 0x78, 0x5a, 0x96, 0x22, 0xf1, 0x0c, 0xf1, 0x27, 0x05, 0x5d, 0x91, 0xe7, 0x1e, 0xdf, + 0x3a, 0x35, 0x7d, 0x76, 0xa7, 0xa8, 0xb7, 0xcf, 0xe7, 0x0c, 0x48, 0x4b, 0x1c, 0x49, 0xc7, 0xb5, + 0x41, 0x48, 0xe6, 0x1e, 0x5f, 0x4a, 0x6f, 0xf1, 0x7b, 0x05, 0x95, 0x52, 0xe3, 0x8c, 0x17, 0x72, + 0xa5, 0x3f, 0xb1, 0x53, 0xd4, 0xc5, 0x33, 0xfd, 0x00, 0xe5, 0x1a, 0x47, 0xa9, 0xe2, 0x19, 0xb9, + 0x3f, 0xae, 0xdb, 0x24, 0x49, 0xd5, 0xfd, 0xf8, 0xba, 0x64, 0x06, 0x6a, 0xc0, 0x75, 0xc9, 0x9b, + 0xed, 0x01, 0xd7, 0x25, 0x77, 0x3e, 0xf5, 0x45, 0x8e, 0x33, 0x8f, 0xe7, 0x72, 0x70, 0xd2, 0xdf, + 0x1a, 0xf5, 0x27, 0x07, 0x47, 0x9a, 0x72, 0x78, 0xa4, 0x29, 0xbf, 0x8f, 0x34, 0x65, 0xff, 0x58, + 0x2b, 0x1c, 0x1e, 0x6b, 0x85, 0x9f, 0xc7, 0x5a, 0xe1, 0xa5, 0x61, 0x3b, 0xd1, 0x66, 0xd7, 0x32, + 0x5a, 0xac, 0x13, 0x27, 0xb9, 0x43, 0x5c, 0x7f, 0x93, 0x44, 0x94, 0xf0, 0x27, 0x73, 0x3b, 0x95, + 0x34, 0xda, 0xf1, 0x69, 0x68, 0x15, 0xf9, 0x67, 0xcb, 0xda, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xa7, 0x83, 0x9b, 0x9a, 0xc9, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -684,7 +675,7 @@ type QueryClient interface { // Queries publisher by index/address. PublisherByIndex(ctx context.Context, in *QueryPublisherByIndexRequest, opts ...grpc.CallOption) (*QueryPublisherByIndexResponse, error) // Queries a list of ArticlesByPrefix items. - ArticlesByPrefix(ctx context.Context, in *QueryArticlesByPrefixRequest, opts ...grpc.CallOption) (*QueryArticlesByPrefixResponse, error) + AllArticles(ctx context.Context, in *QueryAllArticlesRequest, opts ...grpc.CallOption) (*QueryAllArticlesResponse, error) // Queries a list of CoinsBurnEvents items. AllBurnedCoins(ctx context.Context, in *QueryAllBurnedCoinsRequest, opts ...grpc.CallOption) (*QueryAllBurnedCoinsResponse, error) } @@ -733,9 +724,9 @@ func (c *queryClient) PublisherByIndex(ctx context.Context, in *QueryPublisherBy return out, nil } -func (c *queryClient) ArticlesByPrefix(ctx context.Context, in *QueryArticlesByPrefixRequest, opts ...grpc.CallOption) (*QueryArticlesByPrefixResponse, error) { - out := new(QueryArticlesByPrefixResponse) - err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/ArticlesByPrefix", in, out, opts...) +func (c *queryClient) AllArticles(ctx context.Context, in *QueryAllArticlesRequest, opts ...grpc.CallOption) (*QueryAllArticlesResponse, error) { + out := new(QueryAllArticlesResponse) + err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/AllArticles", in, out, opts...) if err != nil { return nil, err } @@ -762,7 +753,7 @@ type QueryServer interface { // Queries publisher by index/address. PublisherByIndex(context.Context, *QueryPublisherByIndexRequest) (*QueryPublisherByIndexResponse, error) // Queries a list of ArticlesByPrefix items. - ArticlesByPrefix(context.Context, *QueryArticlesByPrefixRequest) (*QueryArticlesByPrefixResponse, error) + AllArticles(context.Context, *QueryAllArticlesRequest) (*QueryAllArticlesResponse, error) // Queries a list of CoinsBurnEvents items. AllBurnedCoins(context.Context, *QueryAllBurnedCoinsRequest) (*QueryAllBurnedCoinsResponse, error) } @@ -783,8 +774,8 @@ func (*UnimplementedQueryServer) Publisher(ctx context.Context, req *QueryPublis func (*UnimplementedQueryServer) PublisherByIndex(ctx context.Context, req *QueryPublisherByIndexRequest) (*QueryPublisherByIndexResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PublisherByIndex not implemented") } -func (*UnimplementedQueryServer) ArticlesByPrefix(ctx context.Context, req *QueryArticlesByPrefixRequest) (*QueryArticlesByPrefixResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ArticlesByPrefix not implemented") +func (*UnimplementedQueryServer) AllArticles(ctx context.Context, req *QueryAllArticlesRequest) (*QueryAllArticlesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllArticles not implemented") } func (*UnimplementedQueryServer) AllBurnedCoins(ctx context.Context, req *QueryAllBurnedCoinsRequest) (*QueryAllBurnedCoinsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AllBurnedCoins not implemented") @@ -866,20 +857,20 @@ func _Query_PublisherByIndex_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } -func _Query_ArticlesByPrefix_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryArticlesByPrefixRequest) +func _Query_AllArticles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllArticlesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).ArticlesByPrefix(ctx, in) + return srv.(QueryServer).AllArticles(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bze.cointrunk.Query/ArticlesByPrefix", + FullMethod: "/bze.cointrunk.Query/AllArticles", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ArticlesByPrefix(ctx, req.(*QueryArticlesByPrefixRequest)) + return srv.(QueryServer).AllArticles(ctx, req.(*QueryAllArticlesRequest)) } return interceptor(ctx, in, info, handler) } @@ -923,8 +914,8 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_PublisherByIndex_Handler, }, { - MethodName: "ArticlesByPrefix", - Handler: _Query_ArticlesByPrefix_Handler, + MethodName: "AllArticles", + Handler: _Query_AllArticles_Handler, }, { MethodName: "AllBurnedCoins", @@ -1222,7 +1213,7 @@ func (m *QueryPublisherByIndexResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *QueryArticlesByPrefixRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllArticlesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1232,12 +1223,12 @@ func (m *QueryArticlesByPrefixRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryArticlesByPrefixRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllArticlesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryArticlesByPrefixRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllArticlesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1254,17 +1245,10 @@ func (m *QueryArticlesByPrefixRequest) MarshalToSizedBuffer(dAtA []byte) (int, e i-- dAtA[i] = 0x12 } - if len(m.Prefix) > 0 { - i -= len(m.Prefix) - copy(dAtA[i:], m.Prefix) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Prefix))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *QueryArticlesByPrefixResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAllArticlesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1274,12 +1258,12 @@ func (m *QueryArticlesByPrefixResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryArticlesByPrefixResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllArticlesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryArticlesByPrefixResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllArticlesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1516,16 +1500,12 @@ func (m *QueryPublisherByIndexResponse) Size() (n int) { return n } -func (m *QueryArticlesByPrefixRequest) Size() (n int) { +func (m *QueryAllArticlesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Prefix) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } if m.Pagination != nil { l = m.Pagination.Size() n += 1 + l + sovQuery(uint64(l)) @@ -1533,7 +1513,7 @@ func (m *QueryArticlesByPrefixRequest) Size() (n int) { return n } -func (m *QueryArticlesByPrefixResponse) Size() (n int) { +func (m *QueryAllArticlesResponse) Size() (n int) { if m == nil { return 0 } @@ -2300,7 +2280,7 @@ func (m *QueryPublisherByIndexResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryArticlesByPrefixRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllArticlesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2323,44 +2303,12 @@ func (m *QueryArticlesByPrefixRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryArticlesByPrefixRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllArticlesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryArticlesByPrefixRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllArticlesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Prefix = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) @@ -2418,7 +2366,7 @@ func (m *QueryArticlesByPrefixRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryArticlesByPrefixResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllArticlesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2441,10 +2389,10 @@ func (m *QueryArticlesByPrefixResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryArticlesByPrefixResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllArticlesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryArticlesByPrefixResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllArticlesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/cointrunk/types/query.pb.gw.go b/x/cointrunk/types/query.pb.gw.go index e1ca26d2..dd018336 100644 --- a/x/cointrunk/types/query.pb.gw.go +++ b/x/cointrunk/types/query.pb.gw.go @@ -178,73 +178,37 @@ func local_request_Query_PublisherByIndex_0(ctx context.Context, marshaler runti } var ( - filter_Query_ArticlesByPrefix_0 = &utilities.DoubleArray{Encoding: map[string]int{"prefix": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} + filter_Query_AllArticles_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_ArticlesByPrefix_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryArticlesByPrefixRequest +func request_Query_AllArticles_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllArticlesRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["prefix"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "prefix") - } - - protoReq.Prefix, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "prefix", err) - } - if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ArticlesByPrefix_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllArticles_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.ArticlesByPrefix(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.AllArticles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_ArticlesByPrefix_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryArticlesByPrefixRequest +func local_request_Query_AllArticles_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllArticlesRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["prefix"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "prefix") - } - - protoReq.Prefix, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "prefix", err) - } - if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ArticlesByPrefix_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllArticles_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ArticlesByPrefix(ctx, &protoReq) + msg, err := server.AllArticles(ctx, &protoReq) return msg, metadata, err } @@ -383,7 +347,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_ArticlesByPrefix_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_AllArticles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -394,7 +358,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_ArticlesByPrefix_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_AllArticles_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 { @@ -402,7 +366,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_ArticlesByPrefix_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_AllArticles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -550,7 +514,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_ArticlesByPrefix_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_AllArticles_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) @@ -559,14 +523,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_ArticlesByPrefix_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_AllArticles_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_ArticlesByPrefix_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_AllArticles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -602,7 +566,7 @@ var ( pattern_Query_PublisherByIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"bze", "cointrunk", "publisher", "index"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ArticlesByPrefix_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"bze", "cointrunk", "articles_by_prefix", "prefix"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_AllArticles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "all_articles"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_AllBurnedCoins_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "all_burned_coins"}, "", runtime.AssumeColonVerbOpt(true))) ) @@ -616,7 +580,7 @@ var ( forward_Query_PublisherByIndex_0 = runtime.ForwardResponseMessage - forward_Query_ArticlesByPrefix_0 = runtime.ForwardResponseMessage + forward_Query_AllArticles_0 = runtime.ForwardResponseMessage forward_Query_AllBurnedCoins_0 = runtime.ForwardResponseMessage ) From 33682050c856004addab1384a238ea694d70b607 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Sat, 26 Nov 2022 02:41:06 +0200 Subject: [PATCH 21/54] check accepted domain active flag on urls --- .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +++++++++---------- .../bze/bze.scavenge/module/index.ts | 6 ++-- x/cointrunk/keeper/msg_server_add_article.go | 12 +++++-- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 0b1e1ca7..36486b56 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -247,33 +247,33 @@ export default { } } }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -291,29 +291,29 @@ export default { } } }, - async MsgRevealSolution({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 0e8c4c98..27b7f752 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -5,14 +5,14 @@ import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; -import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; +import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -46,8 +46,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/keeper/msg_server_add_article.go b/x/cointrunk/keeper/msg_server_add_article.go index 3c719d5d..40d308aa 100644 --- a/x/cointrunk/keeper/msg_server_add_article.go +++ b/x/cointrunk/keeper/msg_server_add_article.go @@ -61,11 +61,15 @@ func (k msgServer) validateMessageDomains(ctx sdk.Context, msg *types.MsgAddArti return errors.Newf("Invalid article url(%s)", err) } - _, found := k.GetAcceptedDomain(ctx, parsedUrl.Host) + acceptedDomain, found := k.GetAcceptedDomain(ctx, parsedUrl.Host) if !found { return errors.Newf("Provided url domain (%s) is not an accepted domain", parsedUrl.Host) } + if acceptedDomain.Active != true { + return errors.Newf("Provided url domain (%s) is NOT active", parsedUrl.Host) + } + //msg.Picture is optional so do not validate it unless needed if msg.Picture == "" { return nil @@ -76,10 +80,14 @@ func (k msgServer) validateMessageDomains(ctx sdk.Context, msg *types.MsgAddArti return errors.Newf("Invalid article picture url(%s)", err) } - _, found = k.GetAcceptedDomain(ctx, parsedUrl.Host) + acceptedDomain, found = k.GetAcceptedDomain(ctx, parsedUrl.Host) if !found { return errors.Newf("Provided picture domain (%s) is not an accepted domain", parsedUrl.Host) } + if acceptedDomain.Active != true { + return errors.Newf("Provided picture domain (%s) is NOT active", parsedUrl.Host) + } + return nil } From 8acbe5354906051fd288e0bab489c92efb30a5e1 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Sat, 26 Nov 2022 02:51:31 +0200 Subject: [PATCH 22/54] sanitize and validate add article message --- x/cointrunk/keeper/msg_server_add_article.go | 3 +-- x/cointrunk/types/message_add_article.go | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/x/cointrunk/keeper/msg_server_add_article.go b/x/cointrunk/keeper/msg_server_add_article.go index 40d308aa..9324b23a 100644 --- a/x/cointrunk/keeper/msg_server_add_article.go +++ b/x/cointrunk/keeper/msg_server_add_article.go @@ -6,7 +6,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "gopkg.in/errgo.v2/fmt/errors" - "strings" ) func (k msgServer) AddArticle(goCtx context.Context, msg *types.MsgAddArticle) (*types.MsgAddArticleResponse, error) { @@ -41,7 +40,7 @@ func (k msgServer) AddArticle(goCtx context.Context, msg *types.MsgAddArticle) ( } var article = types.Article{ - Title: strings.Trim(msg.Title, " "), + Title: msg.Title, Url: msg.Url, Picture: msg.Picture, Publisher: msg.Publisher, diff --git a/x/cointrunk/types/message_add_article.go b/x/cointrunk/types/message_add_article.go index f47ea021..b05815e4 100644 --- a/x/cointrunk/types/message_add_article.go +++ b/x/cointrunk/types/message_add_article.go @@ -15,9 +15,9 @@ var _ sdk.Msg = &MsgAddArticle{} func NewMsgAddArticle(publisher string, title string, url string, picture string) *MsgAddArticle { return &MsgAddArticle{ Publisher: publisher, - Title: title, - Url: url, - Picture: picture, + Title: strings.TrimSpace(title), + Url: strings.TrimSpace(url), + Picture: strings.TrimSpace(picture), } } @@ -48,14 +48,17 @@ func (msg *MsgAddArticle) ValidateBasic() error { return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid publisher address (%s)", err) } - if len(strings.Trim(msg.Title, " ")) < 10 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid title: expecting at least 10 characters") + if len(msg.Title) < 10 || len(msg.Title) > 140 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid title: expecting between 10 and 140 characters") } _, err = msg.ParseUrl(msg.Url) if err != nil { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid url provided (%s)", err) } + if len(msg.Url) > 2048 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid url: provided url exceeds 2048 characters") + } //validate picture only if it's provided if msg.Picture == "" { @@ -67,6 +70,10 @@ func (msg *MsgAddArticle) ValidateBasic() error { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid picture url provided (%s)", err) } + if len(msg.Picture) > 2048 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid picture url: provided url exceeds 2048 chars") + } + return nil } From d84b13c5504123d418abb2e9201966fc678ecc20 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Sun, 27 Nov 2022 01:24:33 +0200 Subject: [PATCH 23/54] added id to articles and fixed article sorting --- docs/static/openapi.yml | 9 ++ go.mod | 3 + go.sum | 5 + proto/cointrunk/article.proto | 11 ++- proto/cointrunk/genesis.proto | 1 + .../bze/bze.cointrunk/module/rest.ts | 2 + .../module/types/cointrunk/article.ts | 62 ++++++++++-- .../module/types/cointrunk/genesis.ts | 54 ++++++++++- .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +++---- .../bze/bze.scavenge/module/index.ts | 6 +- x/cointrunk/client/cli/query.go | 2 +- ...les_by_prefix.go => query_all_articles.go} | 2 +- x/cointrunk/genesis.go | 5 +- x/cointrunk/keeper/cointrunk.go | 24 ++++- x/cointrunk/keeper/msg_server_add_article.go | 1 + x/cointrunk/types/article.pb.go | 94 +++++++++++++------ x/cointrunk/types/genesis.pb.go | 82 +++++++++++----- 17 files changed, 300 insertions(+), 95 deletions(-) rename x/cointrunk/client/cli/{query_articles_by_prefix.go => query_all_articles.go} (95%) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index b1fdd672..ec27c14f 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -142,6 +142,9 @@ paths: items: type: object properties: + id: + type: string + format: uint64 title: type: string url: @@ -30600,6 +30603,9 @@ definitions: bze.cointrunk.Article: type: object properties: + id: + type: string + format: uint64 title: type: string url: @@ -30682,6 +30688,9 @@ definitions: items: type: object properties: + id: + type: string + format: uint64 title: type: string url: diff --git a/go.mod b/go.mod index 1136f44a..9d8788ad 100644 --- a/go.mod +++ b/go.mod @@ -51,11 +51,13 @@ require ( github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.4 // 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.5.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect + github.com/golang/glog v1.0.0 // indirect github.com/golang/snappy v0.0.3 // indirect github.com/google/btree v1.0.0 // indirect github.com/google/go-cmp v0.5.9 // indirect @@ -63,6 +65,7 @@ require ( github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.14.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect diff --git a/go.sum b/go.sum index bc97a6aa..e84bda23 100644 --- a/go.sum +++ b/go.sum @@ -526,6 +526,7 @@ github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASx github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +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= @@ -631,6 +632,8 @@ github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/ github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -787,6 +790,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= 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.14.0 h1:t7uX3JBHdVwAi3G7sSSdbsk8NfgA+LnUS88V/2EKaA0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.14.0/go.mod h1:4OGVnY4qf2+gw+ssiHbW+pq4mo2yko94YxxMmXZ7jCA= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= diff --git a/proto/cointrunk/article.proto b/proto/cointrunk/article.proto index a99b9761..01f58310 100644 --- a/proto/cointrunk/article.proto +++ b/proto/cointrunk/article.proto @@ -5,9 +5,10 @@ option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; message Article { - string title = 1; - string url = 2; - string picture = 3; - string publisher = 4; - bool paid = 5; + uint64 id = 1; + string title = 2; + string url = 3; + string picture = 4; + string publisher = 5; + bool paid = 6; } \ No newline at end of file diff --git a/proto/cointrunk/genesis.proto b/proto/cointrunk/genesis.proto index 980208f9..560f49d4 100644 --- a/proto/cointrunk/genesis.proto +++ b/proto/cointrunk/genesis.proto @@ -18,5 +18,6 @@ message GenesisState { repeated AcceptedDomain AcceptedDomainList = 3 [(gogoproto.nullable) = false]; repeated Article ArticleList = 4 [(gogoproto.nullable) = false]; repeated BurnedCoins BurnedCoinsList = 5 [(gogoproto.nullable) = false]; + uint64 articlesCounter = 6; // this line is used by starport scaffolding # genesis/proto/state } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts index 62ed3383..619b7d4f 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts @@ -15,6 +15,8 @@ export interface CointrunkAcceptedDomain { } export interface CointrunkArticle { + /** @format uint64 */ + id?: string; title?: string; url?: string; picture?: string; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/article.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/article.ts index 27538e17..ccc272a3 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/article.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/article.ts @@ -1,9 +1,11 @@ /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; export const protobufPackage = "bze.cointrunk"; export interface Article { + id: number; title: string; url: string; picture: string; @@ -12,6 +14,7 @@ export interface Article { } const baseArticle: object = { + id: 0, title: "", url: "", picture: "", @@ -21,20 +24,23 @@ const baseArticle: object = { export const Article = { encode(message: Article, writer: Writer = Writer.create()): Writer { + if (message.id !== 0) { + writer.uint32(8).uint64(message.id); + } if (message.title !== "") { - writer.uint32(10).string(message.title); + writer.uint32(18).string(message.title); } if (message.url !== "") { - writer.uint32(18).string(message.url); + writer.uint32(26).string(message.url); } if (message.picture !== "") { - writer.uint32(26).string(message.picture); + writer.uint32(34).string(message.picture); } if (message.publisher !== "") { - writer.uint32(34).string(message.publisher); + writer.uint32(42).string(message.publisher); } if (message.paid === true) { - writer.uint32(40).bool(message.paid); + writer.uint32(48).bool(message.paid); } return writer; }, @@ -47,18 +53,21 @@ export const Article = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.title = reader.string(); + message.id = longToNumber(reader.uint64() as Long); break; case 2: - message.url = reader.string(); + message.title = reader.string(); break; case 3: - message.picture = reader.string(); + message.url = reader.string(); break; case 4: - message.publisher = reader.string(); + message.picture = reader.string(); break; case 5: + message.publisher = reader.string(); + break; + case 6: message.paid = reader.bool(); break; default: @@ -71,6 +80,11 @@ export const Article = { fromJSON(object: any): Article { const message = { ...baseArticle } as Article; + if (object.id !== undefined && object.id !== null) { + message.id = Number(object.id); + } else { + message.id = 0; + } if (object.title !== undefined && object.title !== null) { message.title = String(object.title); } else { @@ -101,6 +115,7 @@ export const Article = { toJSON(message: Article): unknown { const obj: any = {}; + message.id !== undefined && (obj.id = message.id); message.title !== undefined && (obj.title = message.title); message.url !== undefined && (obj.url = message.url); message.picture !== undefined && (obj.picture = message.picture); @@ -111,6 +126,11 @@ export const Article = { fromPartial(object: DeepPartial
): Article { const message = { ...baseArticle } as Article; + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } else { + message.id = 0; + } if (object.title !== undefined && object.title !== null) { message.title = object.title; } else { @@ -140,6 +160,16 @@ export const Article = { }, }; +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + type Builtin = Date | Function | Uint8Array | string | number | undefined; export type DeepPartial = T extends Builtin ? T @@ -150,3 +180,15 @@ export type DeepPartial = T extends Builtin : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts index d910175c..cb01a352 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts @@ -1,10 +1,11 @@ /* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; import { Params } from "../cointrunk/params"; import { Publisher } from "../cointrunk/publisher"; import { AcceptedDomain } from "../cointrunk/accepted_domain"; import { Article } from "../cointrunk/article"; import { BurnedCoins } from "../cointrunk/burned_coins"; -import { Writer, Reader } from "protobufjs/minimal"; export const protobufPackage = "bze.cointrunk"; @@ -14,11 +15,12 @@ export interface GenesisState { PublisherList: Publisher[]; AcceptedDomainList: AcceptedDomain[]; ArticleList: Article[]; - /** this line is used by starport scaffolding # genesis/proto/state */ BurnedCoinsList: BurnedCoins[]; + /** this line is used by starport scaffolding # genesis/proto/state */ + articlesCounter: number; } -const baseGenesisState: object = {}; +const baseGenesisState: object = { articlesCounter: 0 }; export const GenesisState = { encode(message: GenesisState, writer: Writer = Writer.create()): Writer { @@ -37,6 +39,9 @@ export const GenesisState = { for (const v of message.BurnedCoinsList) { BurnedCoins.encode(v!, writer.uint32(42).fork()).ldelim(); } + if (message.articlesCounter !== 0) { + writer.uint32(48).uint64(message.articlesCounter); + } return writer; }, @@ -70,6 +75,9 @@ export const GenesisState = { BurnedCoins.decode(reader, reader.uint32()) ); break; + case 6: + message.articlesCounter = longToNumber(reader.uint64() as Long); + break; default: reader.skipType(tag & 7); break; @@ -115,6 +123,14 @@ export const GenesisState = { message.BurnedCoinsList.push(BurnedCoins.fromJSON(e)); } } + if ( + object.articlesCounter !== undefined && + object.articlesCounter !== null + ) { + message.articlesCounter = Number(object.articlesCounter); + } else { + message.articlesCounter = 0; + } return message; }, @@ -150,6 +166,8 @@ export const GenesisState = { } else { obj.BurnedCoinsList = []; } + message.articlesCounter !== undefined && + (obj.articlesCounter = message.articlesCounter); return obj; }, @@ -190,10 +208,28 @@ export const GenesisState = { message.BurnedCoinsList.push(BurnedCoins.fromPartial(e)); } } + if ( + object.articlesCounter !== undefined && + object.articlesCounter !== null + ) { + message.articlesCounter = object.articlesCounter; + } else { + message.articlesCounter = 0; + } return message; }, }; +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + type Builtin = Date | Function | Uint8Array | string | number | undefined; export type DeepPartial = T extends Builtin ? T @@ -204,3 +240,15 @@ export type DeepPartial = T extends Builtin : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 36486b56..40cc1ba4 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,33 +232,33 @@ export default { }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgSubmitScavenge(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, @@ -278,29 +278,29 @@ export default { } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgSubmitScavenge(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 27b7f752..c023b54d 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,14 +4,14 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; @@ -45,8 +45,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; diff --git a/x/cointrunk/client/cli/query.go b/x/cointrunk/client/cli/query.go index 91157874..1f5c6cc8 100644 --- a/x/cointrunk/client/cli/query.go +++ b/x/cointrunk/client/cli/query.go @@ -29,7 +29,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdPublisher()) cmd.AddCommand(CmdPublisherByIndex()) - cmd.AddCommand(CmdArticlesByPrefix()) + cmd.AddCommand(CmdAllArticles()) cmd.AddCommand(CmdAllBurnedCoins()) diff --git a/x/cointrunk/client/cli/query_articles_by_prefix.go b/x/cointrunk/client/cli/query_all_articles.go similarity index 95% rename from x/cointrunk/client/cli/query_articles_by_prefix.go rename to x/cointrunk/client/cli/query_all_articles.go index 645230e2..26ec5626 100644 --- a/x/cointrunk/client/cli/query_articles_by_prefix.go +++ b/x/cointrunk/client/cli/query_all_articles.go @@ -11,7 +11,7 @@ import ( var _ = strconv.Itoa(0) -func CmdArticlesByPrefix() *cobra.Command { +func CmdAllArticles() *cobra.Command { cmd := &cobra.Command{ Use: "all-articles", Short: "Query all articles", diff --git a/x/cointrunk/genesis.go b/x/cointrunk/genesis.go index 6a776525..542290a6 100644 --- a/x/cointrunk/genesis.go +++ b/x/cointrunk/genesis.go @@ -9,6 +9,9 @@ import ( // InitGenesis initializes the capability module's state from a provided genesis // state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + k.SetParams(ctx, genState.Params) + k.SetArticleCounter(ctx, genState.ArticlesCounter) + for _, publisher := range genState.PublisherList { k.SetPublisher(ctx, publisher) } @@ -26,7 +29,6 @@ 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 capability module's exported genesis. @@ -37,6 +39,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.AcceptedDomainList = k.GetAllAcceptedDomain(ctx) genesis.ArticleList = k.GetAllArticles(ctx) genesis.BurnedCoinsList = k.GetAllBurnedCoins(ctx) + genesis.ArticlesCounter = k.GetArticleCounter(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/cointrunk/keeper/cointrunk.go b/x/cointrunk/keeper/cointrunk.go index b1f57331..875776e0 100644 --- a/x/cointrunk/keeper/cointrunk.go +++ b/x/cointrunk/keeper/cointrunk.go @@ -2,10 +2,10 @@ package keeper import ( "encoding/binary" + "fmt" "github.com/bze-alphateam/bze/x/cointrunk/types" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "strconv" ) const ( @@ -98,8 +98,11 @@ func (k Keeper) GetAllArticles(ctx sdk.Context) (list []types.Article) { func (k Keeper) SetArticle(ctx sdk.Context, article types.Article) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ArticleKeyPrefix)) - articleCounter := k.incrementCounter(ctx, types.ArticleCounterKeyPrefix) - keyString := strconv.FormatUint(articleCounter, 10) + if article.Id == 0 { + article.Id = k.incrementCounter(ctx, types.ArticleCounterKeyPrefix) + } + keyString := fmt.Sprintf("%012d", article.Id) + record := k.cdc.MustMarshal(&article) store.Set( types.ArticleKey(keyString), @@ -115,6 +118,21 @@ func (k Keeper) GetMonthlyPaidArticleCounter(ctx sdk.Context) uint64 { return k.getCounter(ctx, types.GenerateMonthlyPaidArticleCounterPrefix(ctx)) } +func (k Keeper) GetArticleCounter(ctx sdk.Context) uint64 { + return k.getCounter(ctx, types.ArticleCounterKeyPrefix) +} + +func (k Keeper) SetArticleCounter(ctx sdk.Context, counter uint64) { + counterStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ArticleCounterKeyPrefix)) + record := make([]byte, 8) + binary.BigEndian.PutUint64(record, counter) + + counterStore.Set( + types.ArticleKey(CounterKey), + record, + ) +} + func (k Keeper) getCounter(ctx sdk.Context, storePrefix string) uint64 { counterStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(storePrefix)) counter := counterStore.Get(types.ArticleKey(CounterKey)) diff --git a/x/cointrunk/keeper/msg_server_add_article.go b/x/cointrunk/keeper/msg_server_add_article.go index 9324b23a..261f91c0 100644 --- a/x/cointrunk/keeper/msg_server_add_article.go +++ b/x/cointrunk/keeper/msg_server_add_article.go @@ -45,6 +45,7 @@ func (k msgServer) AddArticle(goCtx context.Context, msg *types.MsgAddArticle) ( Picture: msg.Picture, Publisher: msg.Publisher, Paid: paid, + Id: 0, } k.SetArticle(ctx, article) diff --git a/x/cointrunk/types/article.pb.go b/x/cointrunk/types/article.pb.go index 9de62f29..6534616b 100644 --- a/x/cointrunk/types/article.pb.go +++ b/x/cointrunk/types/article.pb.go @@ -23,11 +23,12 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Article struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - Picture string `protobuf:"bytes,3,opt,name=picture,proto3" json:"picture,omitempty"` - Publisher string `protobuf:"bytes,4,opt,name=publisher,proto3" json:"publisher,omitempty"` - Paid bool `protobuf:"varint,5,opt,name=paid,proto3" json:"paid,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` + Picture string `protobuf:"bytes,4,opt,name=picture,proto3" json:"picture,omitempty"` + Publisher string `protobuf:"bytes,5,opt,name=publisher,proto3" json:"publisher,omitempty"` + Paid bool `protobuf:"varint,6,opt,name=paid,proto3" json:"paid,omitempty"` } func (m *Article) Reset() { *m = Article{} } @@ -63,6 +64,13 @@ func (m *Article) XXX_DiscardUnknown() { var xxx_messageInfo_Article proto.InternalMessageInfo +func (m *Article) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + func (m *Article) GetTitle() string { if m != nil { return m.Title @@ -105,21 +113,22 @@ func init() { func init() { proto.RegisterFile("cointrunk/article.proto", fileDescriptor_b0f4352c8e9bdd9e) } var fileDescriptor_b0f4352c8e9bdd9e = []byte{ - // 216 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xce, 0xcf, 0xcc, - 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x2c, 0x2a, 0xc9, 0x4c, 0xce, 0x49, 0xd5, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x4b, 0x2a, 0xd5, 0x72, 0xb1, 0x3b, - 0x42, 0xe4, 0x85, 0x44, 0xb8, 0x58, 0x4b, 0x32, 0x4b, 0x72, 0x52, 0x25, 0x18, 0x15, 0x18, 0x35, - 0x38, 0x83, 0x20, 0x1c, 0x21, 0x01, 0x2e, 0xe6, 0xd2, 0xa2, 0x1c, 0x09, 0x26, 0xb0, 0x18, 0x88, - 0x29, 0x24, 0xc1, 0xc5, 0x5e, 0x90, 0x99, 0x5c, 0x52, 0x5a, 0x94, 0x2a, 0xc1, 0x0c, 0x16, 0x85, - 0x71, 0x85, 0x64, 0xb8, 0x38, 0x0b, 0x4a, 0x93, 0x72, 0x32, 0x8b, 0x33, 0x52, 0x8b, 0x24, 0x58, - 0xc0, 0x72, 0x08, 0x01, 0x21, 0x21, 0x2e, 0x96, 0x82, 0xc4, 0xcc, 0x14, 0x09, 0x56, 0x05, 0x46, - 0x0d, 0x8e, 0x20, 0x30, 0xdb, 0xc9, 0xe3, 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, 0xf4, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x93, 0xaa, 0x52, - 0x75, 0x13, 0x73, 0x0a, 0x32, 0x12, 0x4b, 0x52, 0x13, 0xc1, 0x3c, 0xfd, 0x0a, 0x7d, 0x84, 0xff, - 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xde, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, - 0x24, 0x57, 0x2a, 0x86, 0xf9, 0x00, 0x00, 0x00, + // 231 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x8f, 0xb1, 0x4e, 0xc3, 0x30, + 0x14, 0x45, 0xe3, 0x34, 0x6d, 0xa9, 0x25, 0x10, 0xb2, 0x90, 0xf0, 0x80, 0xac, 0x88, 0x29, 0x0b, + 0xc9, 0xc0, 0x17, 0xc0, 0xc4, 0x9c, 0x91, 0xcd, 0x4e, 0x9e, 0xc8, 0x13, 0xa6, 0xb6, 0xdc, 0x67, + 0x09, 0xfa, 0x0f, 0x48, 0x7c, 0x16, 0x63, 0x47, 0x46, 0x94, 0xfc, 0x08, 0xc2, 0x15, 0x64, 0xbb, + 0xe7, 0xdc, 0xbb, 0x5c, 0x7e, 0xd9, 0x39, 0xdc, 0x52, 0x88, 0xdb, 0xe7, 0x46, 0x07, 0xc2, 0xce, + 0x42, 0xed, 0x83, 0x23, 0x27, 0x4e, 0xcd, 0x1e, 0xea, 0xff, 0xf2, 0xfa, 0x9d, 0xf1, 0xf5, 0xdd, + 0x71, 0x20, 0xce, 0x78, 0x8e, 0xbd, 0x64, 0x25, 0xab, 0x8a, 0x36, 0xc7, 0x5e, 0x5c, 0xf0, 0x25, + 0x21, 0x59, 0x90, 0x79, 0xc9, 0xaa, 0x4d, 0x7b, 0x04, 0x71, 0xce, 0x17, 0x31, 0x58, 0xb9, 0x48, + 0xee, 0x37, 0x0a, 0xc9, 0xd7, 0x1e, 0x3b, 0x8a, 0x01, 0x64, 0x91, 0xec, 0x1f, 0x8a, 0x2b, 0xbe, + 0xf1, 0xd1, 0x58, 0xdc, 0x0d, 0x10, 0xe4, 0x32, 0x75, 0xb3, 0x10, 0x82, 0x17, 0x5e, 0x63, 0x2f, + 0x57, 0x25, 0xab, 0x4e, 0xda, 0x94, 0xef, 0x1f, 0x3e, 0x47, 0xc5, 0x0e, 0xa3, 0x62, 0xdf, 0xa3, + 0x62, 0x1f, 0x93, 0xca, 0x0e, 0x93, 0xca, 0xbe, 0x26, 0x95, 0x3d, 0xd6, 0x4f, 0x48, 0x43, 0x34, + 0x75, 0xe7, 0x5e, 0x1a, 0xb3, 0x87, 0x1b, 0x6d, 0xfd, 0xa0, 0x09, 0x74, 0xa2, 0xe6, 0xb5, 0x99, + 0x0f, 0xd3, 0x9b, 0x87, 0x9d, 0x59, 0xa5, 0xbf, 0xb7, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x54, + 0xd1, 0xe1, 0x23, 0x0a, 0x01, 0x00, 0x00, } func (m *Article) Marshal() (dAtA []byte, err error) { @@ -150,35 +159,40 @@ func (m *Article) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x28 + dAtA[i] = 0x30 } if len(m.Publisher) > 0 { i -= len(m.Publisher) copy(dAtA[i:], m.Publisher) i = encodeVarintArticle(dAtA, i, uint64(len(m.Publisher))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } if len(m.Picture) > 0 { i -= len(m.Picture) copy(dAtA[i:], m.Picture) i = encodeVarintArticle(dAtA, i, uint64(len(m.Picture))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } if len(m.Url) > 0 { i -= len(m.Url) copy(dAtA[i:], m.Url) i = encodeVarintArticle(dAtA, i, uint64(len(m.Url))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.Title) > 0 { i -= len(m.Title) copy(dAtA[i:], m.Title) i = encodeVarintArticle(dAtA, i, uint64(len(m.Title))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintArticle(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 } return len(dAtA) - i, nil } @@ -200,6 +214,9 @@ func (m *Article) Size() (n int) { } var l int _ = l + if m.Id != 0 { + n += 1 + sovArticle(uint64(m.Id)) + } l = len(m.Title) if l > 0 { n += 1 + l + sovArticle(uint64(l)) @@ -258,6 +275,25 @@ func (m *Article) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) } @@ -289,7 +325,7 @@ func (m *Article) Unmarshal(dAtA []byte) error { } m.Title = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) } @@ -321,7 +357,7 @@ func (m *Article) Unmarshal(dAtA []byte) error { } m.Url = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Picture", wireType) } @@ -353,7 +389,7 @@ func (m *Article) Unmarshal(dAtA []byte) error { } m.Picture = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Publisher", wireType) } @@ -385,7 +421,7 @@ func (m *Article) Unmarshal(dAtA []byte) error { } m.Publisher = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Paid", wireType) } diff --git a/x/cointrunk/types/genesis.pb.go b/x/cointrunk/types/genesis.pb.go index 19605b08..77c43927 100644 --- a/x/cointrunk/types/genesis.pb.go +++ b/x/cointrunk/types/genesis.pb.go @@ -30,6 +30,7 @@ type GenesisState struct { AcceptedDomainList []AcceptedDomain `protobuf:"bytes,3,rep,name=AcceptedDomainList,proto3" json:"AcceptedDomainList"` ArticleList []Article `protobuf:"bytes,4,rep,name=ArticleList,proto3" json:"ArticleList"` BurnedCoinsList []BurnedCoins `protobuf:"bytes,5,rep,name=BurnedCoinsList,proto3" json:"BurnedCoinsList"` + ArticlesCounter uint64 `protobuf:"varint,6,opt,name=articlesCounter,proto3" json:"articlesCounter,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -100,6 +101,13 @@ func (m *GenesisState) GetBurnedCoinsList() []BurnedCoins { return nil } +func (m *GenesisState) GetArticlesCounter() uint64 { + if m != nil { + return m.ArticlesCounter + } + return 0 +} + func init() { proto.RegisterType((*GenesisState)(nil), "bze.cointrunk.GenesisState") } @@ -107,29 +115,30 @@ func init() { func init() { proto.RegisterFile("cointrunk/genesis.proto", fileDescriptor_20104b77ac07c6a4) } var fileDescriptor_20104b77ac07c6a4 = []byte{ - // 347 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xb1, 0x4f, 0xc2, 0x40, - 0x14, 0xc6, 0x5b, 0x40, 0x86, 0x43, 0x62, 0x72, 0x51, 0xc4, 0x46, 0x0b, 0x71, 0x62, 0xb1, 0x4d, - 0x60, 0x37, 0x01, 0x49, 0x34, 0xc6, 0x81, 0xc8, 0xe6, 0x42, 0xae, 0xe5, 0xa5, 0x5c, 0x84, 0x5e, - 0x73, 0xbd, 0x26, 0xca, 0x5f, 0xe1, 0x9f, 0xc5, 0xc8, 0xe8, 0x64, 0x0c, 0x6c, 0xfe, 0x15, 0x86, - 0xd7, 0xc3, 0x96, 0xc6, 0xad, 0xbd, 0xef, 0xfb, 0x7e, 0xf7, 0xbe, 0x77, 0xe4, 0xdc, 0x17, 0x3c, - 0x54, 0x32, 0x09, 0x5f, 0xdd, 0x00, 0x42, 0x88, 0x79, 0xec, 0x44, 0x52, 0x28, 0x41, 0xeb, 0xde, - 0x12, 0x9c, 0x3f, 0xd1, 0x3a, 0x0d, 0x44, 0x20, 0x50, 0x71, 0x77, 0x5f, 0xa9, 0xc9, 0x6a, 0x64, - 0xe9, 0x88, 0x49, 0xb6, 0xd0, 0x61, 0xeb, 0x22, 0x77, 0x9e, 0x78, 0x73, 0x1e, 0xcf, 0x40, 0x6a, - 0xa9, 0x95, 0x49, 0xcc, 0xf7, 0x21, 0x52, 0x30, 0x9d, 0x4c, 0xc5, 0x82, 0xf1, 0x50, 0x1b, 0x72, - 0x13, 0x31, 0xa9, 0xb8, 0x3f, 0x07, 0x2d, 0x5c, 0x66, 0x82, 0x97, 0xc8, 0x10, 0xa6, 0x93, 0xdd, - 0x81, 0xbe, 0xf2, 0xfa, 0xa7, 0x44, 0x8e, 0xef, 0xd3, 0x06, 0x63, 0xc5, 0x14, 0xd0, 0x1e, 0xa9, - 0xa6, 0x33, 0x35, 0xcd, 0xb6, 0xd9, 0xa9, 0x75, 0xcf, 0x9c, 0x83, 0x46, 0xce, 0x08, 0xc5, 0x41, - 0x65, 0xf5, 0xd5, 0x32, 0x9e, 0xb5, 0x95, 0x0e, 0x49, 0x7d, 0xb4, 0x1f, 0xf8, 0x89, 0xc7, 0xaa, - 0x59, 0x6a, 0x97, 0x3b, 0xb5, 0x6e, 0xb3, 0x98, 0xdd, 0x7b, 0x74, 0xfc, 0x30, 0x44, 0xc7, 0x84, - 0xf6, 0x75, 0xb7, 0x21, 0x56, 0x43, 0x54, 0x19, 0x51, 0x57, 0x05, 0xd4, 0xa1, 0x51, 0xf3, 0xfe, - 0x89, 0xd3, 0x5b, 0x52, 0xeb, 0xa7, 0xfb, 0x40, 0x5a, 0x05, 0x69, 0x8d, 0x22, 0x2d, 0x75, 0x68, - 0x4c, 0x3e, 0x40, 0x1f, 0xc9, 0xc9, 0x00, 0xd7, 0x76, 0xb7, 0xdb, 0x1a, 0x32, 0x8e, 0x90, 0x61, - 0x15, 0x18, 0x39, 0x97, 0xe6, 0x14, 0x83, 0x83, 0x87, 0xd5, 0xc6, 0x36, 0xd7, 0x1b, 0xdb, 0xfc, - 0xde, 0xd8, 0xe6, 0xc7, 0xd6, 0x36, 0xd6, 0x5b, 0xdb, 0xf8, 0xdc, 0xda, 0xc6, 0x8b, 0x13, 0x70, - 0x35, 0x4b, 0x3c, 0xc7, 0x17, 0x0b, 0xd7, 0x5b, 0xc2, 0x0d, 0x9b, 0x47, 0x33, 0xa6, 0x80, 0xe1, - 0x9f, 0xfb, 0xe6, 0x66, 0x6f, 0xa8, 0xde, 0x23, 0x88, 0xbd, 0x2a, 0xbe, 0x5e, 0xef, 0x37, 0x00, - 0x00, 0xff, 0xff, 0x71, 0xa5, 0x9e, 0xe5, 0x88, 0x02, 0x00, 0x00, + // 365 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcb, 0x4e, 0xc2, 0x40, + 0x14, 0x86, 0x5b, 0x41, 0x16, 0x83, 0x84, 0x64, 0xa2, 0x58, 0x1b, 0x2d, 0xc4, 0x55, 0x37, 0xb6, + 0x09, 0xec, 0x4d, 0xb8, 0x24, 0x1a, 0xe3, 0x82, 0xc0, 0xce, 0x0d, 0x99, 0x96, 0x93, 0x32, 0x11, + 0x3a, 0xcd, 0x74, 0x9a, 0x28, 0x4f, 0xe1, 0xc2, 0x87, 0x62, 0xc9, 0xd2, 0x95, 0x31, 0xf0, 0x22, + 0x86, 0xe9, 0x60, 0x2f, 0x71, 0xd7, 0x9e, 0xff, 0xff, 0xbf, 0x39, 0x17, 0x74, 0xe9, 0x33, 0x1a, + 0x0a, 0x9e, 0x84, 0xaf, 0x6e, 0x00, 0x21, 0xc4, 0x34, 0x76, 0x22, 0xce, 0x04, 0xc3, 0x0d, 0x6f, + 0x0d, 0xce, 0x9f, 0x68, 0x9e, 0x07, 0x2c, 0x60, 0x52, 0x71, 0x0f, 0x5f, 0xa9, 0xc9, 0x6c, 0x65, + 0xe9, 0x88, 0x70, 0xb2, 0x52, 0x61, 0xf3, 0x2a, 0x57, 0x4f, 0xbc, 0x25, 0x8d, 0x17, 0xc0, 0x95, + 0xd4, 0xce, 0x24, 0xe2, 0xfb, 0x10, 0x09, 0x98, 0xcf, 0xe6, 0x6c, 0x45, 0x68, 0xa8, 0x0c, 0xb9, + 0x8e, 0x08, 0x17, 0xd4, 0x5f, 0x82, 0x12, 0xae, 0x33, 0xc1, 0x4b, 0x78, 0x08, 0xf3, 0xd9, 0xa1, + 0xa0, 0x9e, 0xbc, 0xfd, 0xac, 0xa0, 0xb3, 0x87, 0x74, 0x82, 0xa9, 0x20, 0x02, 0x70, 0x0f, 0xd5, + 0xd2, 0x9e, 0x0c, 0xbd, 0xa3, 0xdb, 0xf5, 0xee, 0x85, 0x53, 0x98, 0xc8, 0x19, 0x4b, 0x71, 0x50, + 0xdd, 0x7c, 0xb7, 0xb5, 0x89, 0xb2, 0xe2, 0x11, 0x6a, 0x8c, 0x8f, 0x0d, 0x3f, 0xd3, 0x58, 0x18, + 0x27, 0x9d, 0x8a, 0x5d, 0xef, 0x1a, 0xe5, 0xec, 0xd1, 0xa3, 0xe2, 0xc5, 0x10, 0x9e, 0x22, 0xdc, + 0x57, 0xb3, 0x8d, 0xe4, 0x68, 0x12, 0x55, 0x91, 0xa8, 0x9b, 0x12, 0xaa, 0x68, 0x54, 0xbc, 0x7f, + 0xe2, 0xf8, 0x1e, 0xd5, 0xfb, 0xe9, 0x3e, 0x24, 0xad, 0x2a, 0x69, 0xad, 0x32, 0x2d, 0x75, 0x28, + 0x4c, 0x3e, 0x80, 0x9f, 0x50, 0x73, 0x20, 0xd7, 0x36, 0x3c, 0x6c, 0x4d, 0x32, 0x4e, 0x25, 0xc3, + 0x2c, 0x31, 0x72, 0x2e, 0xc5, 0x29, 0x07, 0xb1, 0x8d, 0x9a, 0xea, 0x36, 0xf1, 0x90, 0x25, 0xa1, + 0x00, 0x6e, 0xd4, 0x3a, 0xba, 0x5d, 0x9d, 0x94, 0xcb, 0x83, 0xc7, 0xcd, 0xce, 0xd2, 0xb7, 0x3b, + 0x4b, 0xff, 0xd9, 0x59, 0xfa, 0xc7, 0xde, 0xd2, 0xb6, 0x7b, 0x4b, 0xfb, 0xda, 0x5b, 0xda, 0x8b, + 0x13, 0x50, 0xb1, 0x48, 0x3c, 0xc7, 0x67, 0x2b, 0xd7, 0x5b, 0xc3, 0x1d, 0x59, 0x46, 0x0b, 0x22, + 0x80, 0xc8, 0x3f, 0xf7, 0xcd, 0xcd, 0xae, 0x2d, 0xde, 0x23, 0x88, 0xbd, 0x9a, 0xbc, 0x73, 0xef, + 0x37, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x6c, 0x98, 0x62, 0xb2, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -152,6 +161,11 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ArticlesCounter != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.ArticlesCounter)) + i-- + dAtA[i] = 0x30 + } if len(m.BurnedCoinsList) > 0 { for iNdEx := len(m.BurnedCoinsList) - 1; iNdEx >= 0; iNdEx-- { { @@ -264,6 +278,9 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if m.ArticlesCounter != 0 { + n += 1 + sovGenesis(uint64(m.ArticlesCounter)) + } return n } @@ -471,6 +488,25 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ArticlesCounter", wireType) + } + m.ArticlesCounter = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ArticlesCounter |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) From 33f6e98d933226ca9587408b94d26184fd94eb41 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Sun, 27 Nov 2022 01:56:27 +0200 Subject: [PATCH 24/54] added anon articles counter query --- docs/static/openapi.yml | 170 ++++++ go.mod | 3 - go.sum | 5 - proto/cointrunk/anon_articles_counter.proto | 10 + proto/cointrunk/query.proto | 15 + .../bze-alphateam/bze/bze.cointrunk/index.ts | 37 +- .../bze/bze.cointrunk/module/rest.ts | 48 ++ .../types/cointrunk/anon_articles_counter.ts | 118 ++++ .../module/types/cointrunk/query.ts | 209 +++++++ .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +- .../bze/bze.scavenge/module/index.ts | 12 +- x/cointrunk/client/cli/query.go | 2 + .../cli/query_all_anon_articles_counters.go | 48 ++ .../grpc_query_all_anon_articles_counters.go | 40 ++ x/cointrunk/types/anon_articles_counter.pb.go | 353 +++++++++++ x/cointrunk/types/key_article.go | 7 +- x/cointrunk/types/query.pb.go | 562 ++++++++++++++++-- x/cointrunk/types/query.pb.gw.go | 83 +++ 18 files changed, 1671 insertions(+), 83 deletions(-) create mode 100644 proto/cointrunk/anon_articles_counter.proto create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/anon_articles_counter.ts create mode 100644 x/cointrunk/client/cli/query_all_anon_articles_counters.go create mode 100644 x/cointrunk/keeper/grpc_query_all_anon_articles_counters.go create mode 100644 x/cointrunk/types/anon_articles_counter.pb.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index ec27c14f..3e7d991f 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -121,6 +121,130 @@ paths: descending order. + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /bze/cointrunk/all_anon_articles_counters: + get: + summary: Queries a list of AllAnonArticlesCounters items. + operationId: BzeCointrunkAllAnonArticlesCounters + responses: + '200': + description: A successful response. + schema: + type: object + properties: + AnonArticlesCounters: + type: array + items: + type: object + properties: + key: + type: string + counter: + type: string + format: uint64 + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + default: + description: An unexpected 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 @@ -30600,6 +30724,14 @@ definitions: type: string active: type: boolean + bze.cointrunk.AnonArticlesCounter: + type: object + properties: + key: + type: string + counter: + type: string + format: uint64 bze.cointrunk.Article: type: object properties: @@ -30680,6 +30812,44 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + bze.cointrunk.QueryAllAnonArticlesCountersResponse: + type: object + properties: + AnonArticlesCounters: + type: array + items: + type: object + properties: + key: + type: string + counter: + type: string + format: uint64 + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } bze.cointrunk.QueryAllArticlesResponse: type: object properties: diff --git a/go.mod b/go.mod index 9d8788ad..1136f44a 100644 --- a/go.mod +++ b/go.mod @@ -51,13 +51,11 @@ require ( github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.4 // 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.5.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect - github.com/golang/glog v1.0.0 // indirect github.com/golang/snappy v0.0.3 // indirect github.com/google/btree v1.0.0 // indirect github.com/google/go-cmp v0.5.9 // indirect @@ -65,7 +63,6 @@ require ( github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.14.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect diff --git a/go.sum b/go.sum index e84bda23..bc97a6aa 100644 --- a/go.sum +++ b/go.sum @@ -526,7 +526,6 @@ github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASx github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -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= @@ -632,8 +631,6 @@ github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/ github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -790,8 +787,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= 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.14.0 h1:t7uX3JBHdVwAi3G7sSSdbsk8NfgA+LnUS88V/2EKaA0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.14.0/go.mod h1:4OGVnY4qf2+gw+ssiHbW+pq4mo2yko94YxxMmXZ7jCA= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= diff --git a/proto/cointrunk/anon_articles_counter.proto b/proto/cointrunk/anon_articles_counter.proto new file mode 100644 index 00000000..b74b7410 --- /dev/null +++ b/proto/cointrunk/anon_articles_counter.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +package bze.cointrunk; + +option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; + +message AnonArticlesCounter { + + string key = 1; + uint64 counter = 2; +} \ No newline at end of file diff --git a/proto/cointrunk/query.proto b/proto/cointrunk/query.proto index 66d0bb32..09c41dfd 100644 --- a/proto/cointrunk/query.proto +++ b/proto/cointrunk/query.proto @@ -8,6 +8,7 @@ import "cointrunk/params.proto"; import "cointrunk/accepted_domain.proto"; import "cointrunk/publisher.proto"; import "cointrunk/article.proto"; +import "cointrunk/anon_articles_counter.proto"; import "cointrunk/burned_coins.proto"; // this line is used by starport scaffolding # 1 @@ -44,6 +45,11 @@ service Query { option (google.api.http).get = "/bze/cointrunk/all_burned_coins"; } +// Queries a list of AllAnonArticlesCounters items. + rpc AllAnonArticlesCounters(QueryAllAnonArticlesCountersRequest) returns (QueryAllAnonArticlesCountersResponse) { + option (google.api.http).get = "/bze/cointrunk/all_anon_articles_counters"; + } + // this line is used by starport scaffolding # 2 } @@ -100,4 +106,13 @@ message QueryAllBurnedCoinsResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message QueryAllAnonArticlesCountersRequest { +cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllAnonArticlesCountersResponse { + repeated AnonArticlesCounter AnonArticlesCounters = 1 [(gogoproto.nullable) = false]; +cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + // this line is used by starport scaffolding # 3 diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts index 8e197c67..5b8bf214 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts @@ -2,6 +2,7 @@ import { txClient, queryClient, MissingWalletError , registry} from './module' import { AcceptedDomain } from "./module/types/cointrunk/accepted_domain" import { AcceptedDomainProposal } from "./module/types/cointrunk/accepted_domain_proposal" +import { AnonArticlesCounter } from "./module/types/cointrunk/anon_articles_counter" import { Article } from "./module/types/cointrunk/article" import { BurnCoinsProposal } from "./module/types/cointrunk/burn_coins_proposal" import { BurnedCoins } from "./module/types/cointrunk/burned_coins" @@ -10,7 +11,7 @@ import { Publisher } from "./module/types/cointrunk/publisher" import { PublisherProposal } from "./module/types/cointrunk/publisher_proposal" -export { AcceptedDomain, AcceptedDomainProposal, Article, BurnCoinsProposal, BurnedCoins, Params, Publisher, PublisherProposal }; +export { AcceptedDomain, AcceptedDomainProposal, AnonArticlesCounter, Article, BurnCoinsProposal, BurnedCoins, Params, Publisher, PublisherProposal }; async function initTxClient(vuexGetters) { return await txClient(vuexGetters['common/wallet/signer'], { @@ -54,10 +55,12 @@ const getDefaultState = () => { PublisherByIndex: {}, AllArticles: {}, AllBurnedCoins: {}, + AllAnonArticlesCounters: {}, _Structure: { AcceptedDomain: getStructure(AcceptedDomain.fromPartial({})), AcceptedDomainProposal: getStructure(AcceptedDomainProposal.fromPartial({})), + AnonArticlesCounter: getStructure(AnonArticlesCounter.fromPartial({})), Article: getStructure(Article.fromPartial({})), BurnCoinsProposal: getStructure(BurnCoinsProposal.fromPartial({})), BurnedCoins: getStructure(BurnedCoins.fromPartial({})), @@ -128,6 +131,12 @@ export default { } return state.AllBurnedCoins[JSON.stringify(params)] ?? {} }, + getAllAnonArticlesCounters: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.AllAnonArticlesCounters[JSON.stringify(params)] ?? {} + }, getTypeStructure: (state) => (type) => { return state._Structure[type].fields @@ -310,6 +319,32 @@ export default { }, + + + + + + async QueryAllAnonArticlesCounters({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryAllAnonArticlesCounters(query)).data + + + while (all && ( value).pagination && ( value).pagination.next_key!=null) { + let next_values=(await queryClient.queryAllAnonArticlesCounters({...query, 'pagination.key':( value).pagination.next_key})).data + value = mergeResults(value, next_values); + } + commit('QUERY', { query: 'AllAnonArticlesCounters', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllAnonArticlesCounters', payload: { options: { all }, params: {...key},query }}) + return getters['getAllAnonArticlesCounters']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryAllAnonArticlesCounters API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + async sendMsgAddArticle({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts index 619b7d4f..15b1aecd 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts @@ -14,6 +14,13 @@ export interface CointrunkAcceptedDomain { active?: boolean; } +export interface CointrunkAnonArticlesCounter { + key?: string; + + /** @format uint64 */ + counter?: string; +} + export interface CointrunkArticle { /** @format uint64 */ id?: string; @@ -61,6 +68,21 @@ export interface CointrunkQueryAcceptedDomainResponse { pagination?: V1Beta1PageResponse; } +export interface CointrunkQueryAllAnonArticlesCountersResponse { + AnonArticlesCounters?: CointrunkAnonArticlesCounter[]; + + /** + * 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; + * } + */ + pagination?: V1Beta1PageResponse; +} + export interface CointrunkQueryAllArticlesResponse { article?: CointrunkArticle[]; @@ -414,6 +436,32 @@ export class Api extends HttpClient + this.request({ + path: `/bze/cointrunk/all_anon_articles_counters`, + method: "GET", + query: query, + format: "json", + ...params, + }); + /** * No description * diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/anon_articles_counter.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/anon_articles_counter.ts new file mode 100644 index 00000000..4bfd4f25 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/anon_articles_counter.ts @@ -0,0 +1,118 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk"; + +export interface AnonArticlesCounter { + key: string; + counter: number; +} + +const baseAnonArticlesCounter: object = { key: "", counter: 0 }; + +export const AnonArticlesCounter = { + encode( + message: AnonArticlesCounter, + writer: Writer = Writer.create() + ): Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.counter !== 0) { + writer.uint32(16).uint64(message.counter); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): AnonArticlesCounter { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAnonArticlesCounter } as AnonArticlesCounter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.counter = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AnonArticlesCounter { + const message = { ...baseAnonArticlesCounter } as AnonArticlesCounter; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.counter !== undefined && object.counter !== null) { + message.counter = Number(object.counter); + } else { + message.counter = 0; + } + return message; + }, + + toJSON(message: AnonArticlesCounter): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.counter !== undefined && (obj.counter = message.counter); + return obj; + }, + + fromPartial(object: DeepPartial): AnonArticlesCounter { + const message = { ...baseAnonArticlesCounter } as AnonArticlesCounter; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.counter !== undefined && object.counter !== null) { + message.counter = object.counter; + } else { + message.counter = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts index f165049e..6e85f8ad 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts @@ -9,6 +9,7 @@ import { AcceptedDomain } from "../cointrunk/accepted_domain"; import { Publisher } from "../cointrunk/publisher"; import { Article } from "../cointrunk/article"; import { BurnedCoins } from "../cointrunk/burned_coins"; +import { AnonArticlesCounter } from "../cointrunk/anon_articles_counter"; export const protobufPackage = "bze.cointrunk"; @@ -65,6 +66,15 @@ export interface QueryAllBurnedCoinsResponse { pagination: PageResponse | undefined; } +export interface QueryAllAnonArticlesCountersRequest { + pagination: PageRequest | undefined; +} + +export interface QueryAllAnonArticlesCountersResponse { + AnonArticlesCounters: AnonArticlesCounter[]; + pagination: PageResponse | undefined; +} + const baseQueryParamsRequest: object = {}; export const QueryParamsRequest = { @@ -976,6 +986,187 @@ export const QueryAllBurnedCoinsResponse = { }, }; +const baseQueryAllAnonArticlesCountersRequest: object = {}; + +export const QueryAllAnonArticlesCountersRequest = { + encode( + message: QueryAllAnonArticlesCountersRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryAllAnonArticlesCountersRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAllAnonArticlesCountersRequest, + } as QueryAllAnonArticlesCountersRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllAnonArticlesCountersRequest { + const message = { + ...baseQueryAllAnonArticlesCountersRequest, + } as QueryAllAnonArticlesCountersRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllAnonArticlesCountersRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAllAnonArticlesCountersRequest { + const message = { + ...baseQueryAllAnonArticlesCountersRequest, + } as QueryAllAnonArticlesCountersRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAllAnonArticlesCountersResponse: object = {}; + +export const QueryAllAnonArticlesCountersResponse = { + encode( + message: QueryAllAnonArticlesCountersResponse, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.AnonArticlesCounters) { + AnonArticlesCounter.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryAllAnonArticlesCountersResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAllAnonArticlesCountersResponse, + } as QueryAllAnonArticlesCountersResponse; + message.AnonArticlesCounters = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.AnonArticlesCounters.push( + AnonArticlesCounter.decode(reader, reader.uint32()) + ); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllAnonArticlesCountersResponse { + const message = { + ...baseQueryAllAnonArticlesCountersResponse, + } as QueryAllAnonArticlesCountersResponse; + message.AnonArticlesCounters = []; + if ( + object.AnonArticlesCounters !== undefined && + object.AnonArticlesCounters !== null + ) { + for (const e of object.AnonArticlesCounters) { + message.AnonArticlesCounters.push(AnonArticlesCounter.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllAnonArticlesCountersResponse): unknown { + const obj: any = {}; + if (message.AnonArticlesCounters) { + obj.AnonArticlesCounters = message.AnonArticlesCounters.map((e) => + e ? AnonArticlesCounter.toJSON(e) : undefined + ); + } else { + obj.AnonArticlesCounters = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAllAnonArticlesCountersResponse { + const message = { + ...baseQueryAllAnonArticlesCountersResponse, + } as QueryAllAnonArticlesCountersResponse; + message.AnonArticlesCounters = []; + if ( + object.AnonArticlesCounters !== undefined && + object.AnonArticlesCounters !== null + ) { + for (const e of object.AnonArticlesCounters) { + message.AnonArticlesCounters.push(AnonArticlesCounter.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + /** Query defines the gRPC querier service. */ export interface Query { /** Parameters queries the parameters of the module. */ @@ -998,6 +1189,10 @@ export interface Query { AllBurnedCoins( request: QueryAllBurnedCoinsRequest ): Promise; + /** Queries a list of AllAnonArticlesCounters items. */ + AllAnonArticlesCounters( + request: QueryAllAnonArticlesCountersRequest + ): Promise; } export class QueryClientImpl implements Query { @@ -1074,6 +1269,20 @@ export class QueryClientImpl implements Query { QueryAllBurnedCoinsResponse.decode(new Reader(data)) ); } + + AllAnonArticlesCounters( + request: QueryAllAnonArticlesCountersRequest + ): Promise { + const data = QueryAllAnonArticlesCountersRequest.encode(request).finish(); + const promise = this.rpc.request( + "bze.cointrunk.Query", + "AllAnonArticlesCounters", + data + ); + return promise.then((data) => + QueryAllAnonArticlesCountersResponse.decode(new Reader(data)) + ); + } } interface Rpc { diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 40cc1ba4..474b327f 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,18 +232,18 @@ export default { }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -262,32 +262,32 @@ export default { } } }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, @@ -304,16 +304,16 @@ export default { } } }, - async MsgRevealSolution({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index c023b54d..5f72a96b 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgCommitSolution } from "./types/scavenge/tx"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; +import { MsgCommitSolution } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], + ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), + msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/client/cli/query.go b/x/cointrunk/client/cli/query.go index 1f5c6cc8..e584089f 100644 --- a/x/cointrunk/client/cli/query.go +++ b/x/cointrunk/client/cli/query.go @@ -33,6 +33,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdAllBurnedCoins()) + cmd.AddCommand(CmdAllAnonArticlesCounters()) + // this line is used by starport scaffolding # 1 return cmd diff --git a/x/cointrunk/client/cli/query_all_anon_articles_counters.go b/x/cointrunk/client/cli/query_all_anon_articles_counters.go new file mode 100644 index 00000000..0d2f42b9 --- /dev/null +++ b/x/cointrunk/client/cli/query_all_anon_articles_counters.go @@ -0,0 +1,48 @@ +package cli + +import ( + "strconv" + + "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdAllAnonArticlesCounters() *cobra.Command { + cmd := &cobra.Command{ + Use: "all-anon-articles-counters", + Short: "Query all-anon-articles-counters", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllAnonArticlesCountersRequest{} + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + params.Pagination = pageReq + + res, err := queryClient.AllAnonArticlesCounters(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/cointrunk/keeper/grpc_query_all_anon_articles_counters.go b/x/cointrunk/keeper/grpc_query_all_anon_articles_counters.go new file mode 100644 index 00000000..828eaad1 --- /dev/null +++ b/x/cointrunk/keeper/grpc_query_all_anon_articles_counters.go @@ -0,0 +1,40 @@ +package keeper + +import ( + "context" + "encoding/binary" + "github.com/cosmos/cosmos-sdk/store/prefix" + "github.com/cosmos/cosmos-sdk/types/query" + + "github.com/bze-alphateam/bze/x/cointrunk/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) AllAnonArticlesCounters(goCtx context.Context, req *types.QueryAllAnonArticlesCountersRequest) (*types.QueryAllAnonArticlesCountersResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + var counters []types.AnonArticlesCounter + store := ctx.KVStore(k.storeKey) + countersStore := prefix.NewStore(store, types.KeyPrefix(types.AnonArticlesCounterKeyPrefix)) + pageRes, err := query.Paginate(countersStore, req.Pagination, func(key []byte, value []byte) error { + var counter = types.AnonArticlesCounter{ + Key: string(key[:]), + Counter: binary.BigEndian.Uint64(value), + } + + counters = append(counters, counter) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + _ = ctx + + return &types.QueryAllAnonArticlesCountersResponse{AnonArticlesCounters: counters, Pagination: pageRes}, nil +} diff --git a/x/cointrunk/types/anon_articles_counter.pb.go b/x/cointrunk/types/anon_articles_counter.pb.go new file mode 100644 index 00000000..9ffb8495 --- /dev/null +++ b/x/cointrunk/types/anon_articles_counter.pb.go @@ -0,0 +1,353 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cointrunk/anon_articles_counter.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/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 AnonArticlesCounter struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Counter uint64 `protobuf:"varint,2,opt,name=counter,proto3" json:"counter,omitempty"` +} + +func (m *AnonArticlesCounter) Reset() { *m = AnonArticlesCounter{} } +func (m *AnonArticlesCounter) String() string { return proto.CompactTextString(m) } +func (*AnonArticlesCounter) ProtoMessage() {} +func (*AnonArticlesCounter) Descriptor() ([]byte, []int) { + return fileDescriptor_ca7739e73afa5661, []int{0} +} +func (m *AnonArticlesCounter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AnonArticlesCounter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AnonArticlesCounter.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 *AnonArticlesCounter) XXX_Merge(src proto.Message) { + xxx_messageInfo_AnonArticlesCounter.Merge(m, src) +} +func (m *AnonArticlesCounter) XXX_Size() int { + return m.Size() +} +func (m *AnonArticlesCounter) XXX_DiscardUnknown() { + xxx_messageInfo_AnonArticlesCounter.DiscardUnknown(m) +} + +var xxx_messageInfo_AnonArticlesCounter proto.InternalMessageInfo + +func (m *AnonArticlesCounter) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *AnonArticlesCounter) GetCounter() uint64 { + if m != nil { + return m.Counter + } + return 0 +} + +func init() { + proto.RegisterType((*AnonArticlesCounter)(nil), "bze.cointrunk.AnonArticlesCounter") +} + +func init() { + proto.RegisterFile("cointrunk/anon_articles_counter.proto", fileDescriptor_ca7739e73afa5661) +} + +var fileDescriptor_ca7739e73afa5661 = []byte{ + // 185 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xce, 0xcf, 0xcc, + 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0xcc, 0xcb, 0xcf, 0x8b, 0x4f, 0x2c, 0x2a, 0xc9, 0x4c, + 0xce, 0x49, 0x2d, 0x8e, 0x4f, 0xce, 0x2f, 0xcd, 0x2b, 0x49, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x2b, 0x55, 0x72, 0xe4, 0x12, 0x76, 0xcc, 0xcb, + 0xcf, 0x73, 0x84, 0x2a, 0x76, 0x86, 0xa8, 0x15, 0x12, 0xe0, 0x62, 0xce, 0x4e, 0xad, 0x94, 0x60, + 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0x31, 0x85, 0x24, 0xb8, 0xd8, 0xa1, 0x06, 0x49, 0x30, 0x29, + 0x30, 0x6a, 0xb0, 0x04, 0xc1, 0xb8, 0x4e, 0x1e, 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, 0xa5, 0x97, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x54, + 0x95, 0xaa, 0x9b, 0x98, 0x53, 0x90, 0x91, 0x58, 0x92, 0x9a, 0x08, 0xe6, 0xe9, 0x57, 0xe8, 0x23, + 0x5c, 0x5c, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0xa2, 0x31, 0x20, 0x00, 0x00, 0xff, + 0xff, 0x5a, 0x7a, 0x3d, 0xb1, 0xcb, 0x00, 0x00, 0x00, +} + +func (m *AnonArticlesCounter) 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 *AnonArticlesCounter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AnonArticlesCounter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Counter != 0 { + i = encodeVarintAnonArticlesCounter(dAtA, i, uint64(m.Counter)) + i-- + dAtA[i] = 0x10 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintAnonArticlesCounter(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintAnonArticlesCounter(dAtA []byte, offset int, v uint64) int { + offset -= sovAnonArticlesCounter(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AnonArticlesCounter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovAnonArticlesCounter(uint64(l)) + } + if m.Counter != 0 { + n += 1 + sovAnonArticlesCounter(uint64(m.Counter)) + } + return n +} + +func sovAnonArticlesCounter(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAnonArticlesCounter(x uint64) (n int) { + return sovAnonArticlesCounter(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AnonArticlesCounter) 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 ErrIntOverflowAnonArticlesCounter + } + 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: AnonArticlesCounter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AnonArticlesCounter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAnonArticlesCounter + } + 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 ErrInvalidLengthAnonArticlesCounter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAnonArticlesCounter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType) + } + m.Counter = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAnonArticlesCounter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Counter |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAnonArticlesCounter(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAnonArticlesCounter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAnonArticlesCounter(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, ErrIntOverflowAnonArticlesCounter + } + 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, ErrIntOverflowAnonArticlesCounter + } + 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, ErrIntOverflowAnonArticlesCounter + } + 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, ErrInvalidLengthAnonArticlesCounter + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAnonArticlesCounter + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAnonArticlesCounter + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAnonArticlesCounter = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAnonArticlesCounter = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAnonArticlesCounter = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/cointrunk/types/key_article.go b/x/cointrunk/types/key_article.go index 867905cd..36e7edca 100644 --- a/x/cointrunk/types/key_article.go +++ b/x/cointrunk/types/key_article.go @@ -9,8 +9,9 @@ var _ binary.ByteOrder const ( // ArticleKeyPrefix is the prefix to retrieve all Article - ArticleKeyPrefix = "Article/value/" - ArticleCounterKeyPrefix = "Article/counter/" + ArticleKeyPrefix = "Article/value/" + ArticleCounterKeyPrefix = "Article/counter/" + AnonArticlesCounterKeyPrefix = "Article/anon/counter/" ) // ArticleKey returns the store key to retrieve a Publisher from the index fields @@ -27,5 +28,5 @@ func ArticleKey( } func GenerateMonthlyPaidArticleCounterPrefix(ctx sdk.Context) (prefix string) { - return ctx.BlockHeader().Time.Format("200601") + return AnonArticlesCounterKeyPrefix + ctx.BlockHeader().Time.Format("200601") } diff --git a/x/cointrunk/types/query.pb.go b/x/cointrunk/types/query.pb.go index 99b6f08b..24e311b7 100644 --- a/x/cointrunk/types/query.pb.go +++ b/x/cointrunk/types/query.pb.go @@ -585,6 +585,102 @@ func (m *QueryAllBurnedCoinsResponse) GetPagination() *query.PageResponse { return nil } +type QueryAllAnonArticlesCountersRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllAnonArticlesCountersRequest) Reset() { *m = QueryAllAnonArticlesCountersRequest{} } +func (m *QueryAllAnonArticlesCountersRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllAnonArticlesCountersRequest) ProtoMessage() {} +func (*QueryAllAnonArticlesCountersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_12b6eb50b0e9fa00, []int{12} +} +func (m *QueryAllAnonArticlesCountersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllAnonArticlesCountersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllAnonArticlesCountersRequest.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 *QueryAllAnonArticlesCountersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllAnonArticlesCountersRequest.Merge(m, src) +} +func (m *QueryAllAnonArticlesCountersRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllAnonArticlesCountersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllAnonArticlesCountersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllAnonArticlesCountersRequest proto.InternalMessageInfo + +func (m *QueryAllAnonArticlesCountersRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllAnonArticlesCountersResponse struct { + AnonArticlesCounters []AnonArticlesCounter `protobuf:"bytes,1,rep,name=AnonArticlesCounters,proto3" json:"AnonArticlesCounters"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllAnonArticlesCountersResponse) Reset() { *m = QueryAllAnonArticlesCountersResponse{} } +func (m *QueryAllAnonArticlesCountersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllAnonArticlesCountersResponse) ProtoMessage() {} +func (*QueryAllAnonArticlesCountersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_12b6eb50b0e9fa00, []int{13} +} +func (m *QueryAllAnonArticlesCountersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllAnonArticlesCountersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllAnonArticlesCountersResponse.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 *QueryAllAnonArticlesCountersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllAnonArticlesCountersResponse.Merge(m, src) +} +func (m *QueryAllAnonArticlesCountersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllAnonArticlesCountersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllAnonArticlesCountersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllAnonArticlesCountersResponse proto.InternalMessageInfo + +func (m *QueryAllAnonArticlesCountersResponse) GetAnonArticlesCounters() []AnonArticlesCounter { + if m != nil { + return m.AnonArticlesCounters + } + return nil +} + +func (m *QueryAllAnonArticlesCountersResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "bze.cointrunk.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "bze.cointrunk.QueryParamsResponse") @@ -598,60 +694,68 @@ func init() { proto.RegisterType((*QueryAllArticlesResponse)(nil), "bze.cointrunk.QueryAllArticlesResponse") proto.RegisterType((*QueryAllBurnedCoinsRequest)(nil), "bze.cointrunk.QueryAllBurnedCoinsRequest") proto.RegisterType((*QueryAllBurnedCoinsResponse)(nil), "bze.cointrunk.QueryAllBurnedCoinsResponse") + proto.RegisterType((*QueryAllAnonArticlesCountersRequest)(nil), "bze.cointrunk.QueryAllAnonArticlesCountersRequest") + proto.RegisterType((*QueryAllAnonArticlesCountersResponse)(nil), "bze.cointrunk.QueryAllAnonArticlesCountersResponse") } func init() { proto.RegisterFile("cointrunk/query.proto", fileDescriptor_12b6eb50b0e9fa00) } var fileDescriptor_12b6eb50b0e9fa00 = []byte{ - // 760 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x3d, 0x6f, 0xd3, 0x40, - 0x18, 0xc7, 0xe3, 0x42, 0x83, 0x7a, 0x11, 0x15, 0x3a, 0x9a, 0x36, 0x75, 0x1b, 0x37, 0x35, 0xd0, - 0x96, 0x02, 0xb6, 0xda, 0x22, 0x26, 0x96, 0x06, 0xc4, 0xeb, 0x52, 0x32, 0x22, 0xa1, 0xe8, 0x9c, - 0x9c, 0x5c, 0x0b, 0xc7, 0xe7, 0xda, 0x0e, 0xea, 0x8b, 0x58, 0xe0, 0x03, 0x50, 0x89, 0x81, 0x81, - 0x81, 0x9d, 0x95, 0x89, 0x6f, 0xd0, 0xb1, 0x12, 0x0b, 0x13, 0x42, 0x2d, 0x1f, 0x04, 0xf9, 0xee, - 0x71, 0x62, 0x5f, 0x9d, 0xb6, 0xa0, 0x6c, 0xb1, 0x9f, 0xb7, 0xdf, 0xfd, 0x9f, 0x7b, 0x9e, 0x18, - 0x95, 0x5b, 0xcc, 0xf1, 0xa2, 0xa0, 0xeb, 0xbd, 0x36, 0xb7, 0xba, 0x34, 0xd8, 0x31, 0xfc, 0x80, - 0x45, 0x0c, 0x5f, 0xb6, 0x76, 0xa9, 0xd1, 0x33, 0xa9, 0x13, 0x36, 0xb3, 0x19, 0xb7, 0x98, 0xf1, - 0x2f, 0xe1, 0xa4, 0xce, 0xda, 0x8c, 0xd9, 0x2e, 0x35, 0x89, 0xef, 0x98, 0xc4, 0xf3, 0x58, 0x44, - 0x22, 0x87, 0x79, 0x21, 0x58, 0x97, 0x5b, 0x2c, 0xec, 0xb0, 0xd0, 0xb4, 0x48, 0x48, 0x45, 0x6e, - 0xf3, 0xcd, 0x8a, 0x45, 0x23, 0xb2, 0x62, 0xfa, 0xc4, 0x76, 0x3c, 0xee, 0x0c, 0xbe, 0x93, 0x7d, - 0x0a, 0x9f, 0x04, 0xa4, 0x93, 0xe4, 0x98, 0xeb, 0xbf, 0x27, 0xad, 0x16, 0xf5, 0x23, 0xda, 0x6e, - 0xb6, 0x59, 0x87, 0x38, 0x49, 0xe0, 0x74, 0x2a, 0xb0, 0x6b, 0xb9, 0x4e, 0xb8, 0x49, 0x03, 0x30, - 0x4d, 0xa5, 0x62, 0x83, 0xc8, 0x69, 0xb9, 0x34, 0xc1, 0xee, 0x1b, 0xac, 0x6e, 0xe0, 0xd1, 0x76, - 0x33, 0x7e, 0x01, 0x25, 0xf5, 0x09, 0x84, 0x5f, 0xc4, 0xb0, 0x1b, 0x9c, 0xa3, 0x41, 0xb7, 0xba, - 0x34, 0x8c, 0xf4, 0x67, 0xe8, 0x6a, 0xe6, 0x6d, 0xe8, 0x33, 0x2f, 0xa4, 0x78, 0x0d, 0x15, 0x05, - 0x6f, 0x45, 0xa9, 0x29, 0x4b, 0xa5, 0xd5, 0xb2, 0x91, 0xd1, 0xcd, 0x10, 0xee, 0xf5, 0x8b, 0x07, - 0xbf, 0xe6, 0x0a, 0x0d, 0x70, 0xd5, 0xdb, 0x48, 0xe5, 0xb9, 0xd6, 0xe1, 0x44, 0x0f, 0xf9, 0x81, - 0xa0, 0x12, 0x7e, 0x84, 0x50, 0x5f, 0x1e, 0x48, 0xbb, 0x60, 0x08, 0x2d, 0x8d, 0x58, 0x4b, 0x43, - 0xf4, 0x09, 0xb4, 0x34, 0x36, 0x88, 0x4d, 0x21, 0xb6, 0x91, 0x8a, 0xd4, 0xbf, 0x29, 0x68, 0x26, - 0xb7, 0x0c, 0xa0, 0x3f, 0x47, 0xe3, 0x24, 0x63, 0xa9, 0x28, 0xb5, 0x0b, 0x4b, 0xa5, 0xd5, 0xaa, - 0x74, 0x84, 0x6c, 0x38, 0x1c, 0x45, 0x0a, 0xc5, 0x8f, 0x33, 0xd0, 0x23, 0x1c, 0x7a, 0xf1, 0x4c, - 0x68, 0x41, 0x92, 0xa1, 0x6e, 0xa2, 0xb2, 0xd0, 0x39, 0x69, 0xe6, 0xb0, 0x65, 0xf9, 0xa2, 0xa0, - 0x49, 0xb9, 0x02, 0x28, 0x72, 0x1f, 0x8d, 0xf5, 0xee, 0x10, 0x88, 0x51, 0x91, 0xfb, 0x99, 0xd8, - 0x41, 0x87, 0x7e, 0xc0, 0xf0, 0x24, 0xb8, 0x8b, 0x66, 0xb3, 0x80, 0xf5, 0x9d, 0xa7, 0x5e, 0x9b, - 0x6e, 0x27, 0x4a, 0x4c, 0xa0, 0x51, 0x27, 0x7e, 0xe6, 0x22, 0x8c, 0x35, 0xc4, 0x83, 0xfe, 0x0a, - 0x55, 0x07, 0x44, 0xe5, 0x9f, 0x4e, 0xf9, 0xa7, 0xd3, 0xe9, 0x04, 0x4d, 0x89, 0xcb, 0xe4, 0xba, - 0xeb, 0x62, 0x98, 0xc2, 0xfc, 0xce, 0x8c, 0xfc, 0x77, 0x67, 0x3e, 0x2b, 0xa8, 0x72, 0xb2, 0x06, - 0xd0, 0xdf, 0x43, 0x97, 0x60, 0x88, 0xa1, 0x33, 0x93, 0xf2, 0x35, 0x15, 0x56, 0x20, 0x4f, 0x9c, - 0x87, 0xd7, 0x95, 0xde, 0xd0, 0xba, 0x6e, 0x9d, 0x2f, 0x8d, 0x07, 0xf1, 0xce, 0x18, 0xf6, 0xed, - 0xfc, 0xda, 0x1b, 0x5a, 0xa9, 0x0c, 0xc8, 0x50, 0x47, 0x25, 0xab, 0xff, 0x1a, 0xa4, 0x50, 0x25, - 0x29, 0x52, 0x81, 0x20, 0x47, 0x3a, 0x68, 0x68, 0x92, 0xac, 0x7e, 0x2f, 0xa2, 0x51, 0x0e, 0x8b, - 0x3d, 0x54, 0x14, 0x9b, 0x0e, 0xcf, 0x4b, 0x2c, 0x27, 0x57, 0xa9, 0xaa, 0x9f, 0xe6, 0x22, 0xca, - 0xe8, 0xd5, 0x77, 0x3f, 0xfe, 0x7c, 0x1c, 0x99, 0xc2, 0x65, 0xd3, 0xda, 0xa5, 0xa6, 0xfc, 0xe7, - 0x80, 0x3f, 0x28, 0x68, 0x3c, 0xbb, 0x97, 0xf0, 0xcd, 0xbc, 0xac, 0xb9, 0x1b, 0x56, 0x5d, 0x3e, - 0x8f, 0x2b, 0x80, 0x2c, 0x70, 0x90, 0x1a, 0xd6, 0x24, 0x10, 0xe9, 0xdf, 0x08, 0xef, 0xa1, 0xb1, - 0xde, 0xf4, 0xe0, 0xeb, 0xb9, 0x27, 0x94, 0x36, 0x9a, 0x7a, 0xe3, 0x0c, 0x2f, 0x20, 0x98, 0xe7, - 0x04, 0x33, 0x78, 0x5a, 0x96, 0x22, 0xf1, 0x0c, 0xf1, 0x27, 0x05, 0x5d, 0x91, 0xe7, 0x1e, 0xdf, - 0x3a, 0x35, 0x7d, 0x76, 0xa7, 0xa8, 0xb7, 0xcf, 0xe7, 0x0c, 0x48, 0x4b, 0x1c, 0x49, 0xc7, 0xb5, - 0x41, 0x48, 0xe6, 0x1e, 0x5f, 0x4a, 0x6f, 0xf1, 0x7b, 0x05, 0x95, 0x52, 0xe3, 0x8c, 0x17, 0x72, - 0xa5, 0x3f, 0xb1, 0x53, 0xd4, 0xc5, 0x33, 0xfd, 0x00, 0xe5, 0x1a, 0x47, 0xa9, 0xe2, 0x19, 0xb9, - 0x3f, 0xae, 0xdb, 0x24, 0x49, 0xd5, 0xfd, 0xf8, 0xba, 0x64, 0x06, 0x6a, 0xc0, 0x75, 0xc9, 0x9b, - 0xed, 0x01, 0xd7, 0x25, 0x77, 0x3e, 0xf5, 0x45, 0x8e, 0x33, 0x8f, 0xe7, 0x72, 0x70, 0xd2, 0xdf, - 0x1a, 0xf5, 0x27, 0x07, 0x47, 0x9a, 0x72, 0x78, 0xa4, 0x29, 0xbf, 0x8f, 0x34, 0x65, 0xff, 0x58, - 0x2b, 0x1c, 0x1e, 0x6b, 0x85, 0x9f, 0xc7, 0x5a, 0xe1, 0xa5, 0x61, 0x3b, 0xd1, 0x66, 0xd7, 0x32, - 0x5a, 0xac, 0x13, 0x27, 0xb9, 0x43, 0x5c, 0x7f, 0x93, 0x44, 0x94, 0xf0, 0x27, 0x73, 0x3b, 0x95, - 0x34, 0xda, 0xf1, 0x69, 0x68, 0x15, 0xf9, 0x67, 0xcb, 0xda, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xa7, 0x83, 0x9b, 0x9a, 0xc9, 0x09, 0x00, 0x00, + // 851 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcb, 0x6e, 0xd3, 0x4c, + 0x14, 0x8e, 0xfb, 0xff, 0x6d, 0xd5, 0x89, 0xa8, 0xd0, 0x90, 0x34, 0xa9, 0xdb, 0xa4, 0xa9, 0x7b, + 0x6f, 0xc1, 0x56, 0x53, 0xc4, 0x8a, 0x4d, 0x53, 0xc4, 0x75, 0x53, 0xb2, 0x44, 0xa0, 0x68, 0x9c, + 0x8c, 0x52, 0x0b, 0xc7, 0xe3, 0xc6, 0x0e, 0xea, 0x45, 0x6c, 0xe0, 0x01, 0xa8, 0xc4, 0x82, 0x05, + 0x0b, 0xf6, 0x6c, 0x11, 0xef, 0xd0, 0x0d, 0x52, 0x25, 0x36, 0xac, 0x10, 0x6a, 0x79, 0x01, 0xde, + 0x00, 0x79, 0x7c, 0xec, 0xd8, 0x13, 0xa7, 0x17, 0x94, 0x9d, 0x3d, 0xe7, 0x32, 0xdf, 0xf9, 0xce, + 0x99, 0x6f, 0x06, 0x65, 0xeb, 0xcc, 0xb0, 0xdc, 0x76, 0xc7, 0x7a, 0xa9, 0xed, 0x76, 0x68, 0x7b, + 0x5f, 0xb5, 0xdb, 0xcc, 0x65, 0xf8, 0x9a, 0x7e, 0x40, 0xd5, 0xd0, 0x24, 0x67, 0x9a, 0xac, 0xc9, + 0xb8, 0x45, 0xf3, 0xbe, 0x7c, 0x27, 0x79, 0xba, 0xc9, 0x58, 0xd3, 0xa4, 0x1a, 0xb1, 0x0d, 0x8d, + 0x58, 0x16, 0x73, 0x89, 0x6b, 0x30, 0xcb, 0x01, 0xeb, 0x6a, 0x9d, 0x39, 0x2d, 0xe6, 0x68, 0x3a, + 0x71, 0xa8, 0x9f, 0x5b, 0x7b, 0xb5, 0xae, 0x53, 0x97, 0xac, 0x6b, 0x36, 0x69, 0x1a, 0x16, 0x77, + 0x06, 0xdf, 0x89, 0x2e, 0x0a, 0x9b, 0xb4, 0x49, 0x2b, 0xc8, 0x31, 0xd3, 0x5d, 0x27, 0xf5, 0x3a, + 0xb5, 0x5d, 0xda, 0xa8, 0x35, 0x58, 0x8b, 0x18, 0x41, 0xe0, 0x64, 0x24, 0xb0, 0xa3, 0x9b, 0x86, + 0xb3, 0x43, 0xdb, 0x60, 0xca, 0x45, 0x62, 0xdb, 0xae, 0x51, 0x37, 0x29, 0x18, 0x16, 0x22, 0x06, + 0x8b, 0x59, 0x35, 0xb0, 0x3a, 0xb5, 0x3a, 0xeb, 0x58, 0x6e, 0x18, 0x3f, 0xdd, 0x75, 0xd3, 0x3b, + 0x6d, 0x8b, 0x36, 0x6a, 0xde, 0x02, 0x20, 0x53, 0x32, 0x08, 0x3f, 0xf5, 0x6a, 0xda, 0xe6, 0x70, + 0xab, 0x74, 0xb7, 0x43, 0x1d, 0x57, 0x79, 0x8c, 0x6e, 0xc4, 0x56, 0x1d, 0x9b, 0x59, 0x0e, 0xc5, + 0x1b, 0x68, 0xc4, 0x2f, 0x2b, 0x2f, 0x95, 0xa4, 0xe5, 0x74, 0x39, 0xab, 0xc6, 0xe8, 0x55, 0x7d, + 0xf7, 0xca, 0xff, 0xc7, 0x3f, 0x67, 0x52, 0x55, 0x70, 0x55, 0x1a, 0x48, 0xe6, 0xb9, 0x36, 0xa1, + 0xf0, 0x7b, 0xbc, 0x6e, 0xd8, 0x09, 0xdf, 0x47, 0xa8, 0xcb, 0x22, 0xa4, 0x5d, 0x54, 0x7d, 0xca, + 0x55, 0x8f, 0x72, 0xd5, 0x6f, 0x27, 0x50, 0xae, 0x6e, 0x93, 0x26, 0x85, 0xd8, 0x6a, 0x24, 0x52, + 0xf9, 0x22, 0xa1, 0xa9, 0xc4, 0x6d, 0x00, 0xfa, 0x13, 0x34, 0x4e, 0x62, 0x96, 0xbc, 0x54, 0xfa, + 0x6f, 0x39, 0x5d, 0x2e, 0x08, 0x25, 0xc4, 0xc3, 0xa1, 0x14, 0x21, 0x14, 0x3f, 0x88, 0x81, 0x1e, + 0xe2, 0xa0, 0x97, 0x2e, 0x04, 0xed, 0x23, 0x89, 0xa1, 0xae, 0xa1, 0xac, 0xcf, 0x73, 0xd0, 0xf3, + 0x41, 0xd3, 0xf2, 0x49, 0x42, 0x13, 0xe2, 0x0e, 0xc0, 0xc8, 0x5d, 0x34, 0x16, 0x8e, 0x1a, 0x90, + 0x91, 0x17, 0xfb, 0x19, 0xd8, 0x81, 0x87, 0x6e, 0xc0, 0xe0, 0x28, 0xb8, 0x8d, 0xa6, 0xe3, 0x00, + 0x2b, 0xfb, 0x8f, 0xac, 0x06, 0xdd, 0x0b, 0x98, 0xc8, 0xa0, 0x61, 0xc3, 0xfb, 0xe7, 0x24, 0x8c, + 0x55, 0xfd, 0x1f, 0xe5, 0x05, 0x2a, 0xf4, 0x89, 0x4a, 0xae, 0x4e, 0xba, 0x52, 0x75, 0x0a, 0x41, + 0x39, 0x7f, 0x98, 0x4c, 0x73, 0x13, 0x4e, 0x55, 0x72, 0x67, 0x86, 0xfe, 0xb9, 0x33, 0x1f, 0x25, + 0x94, 0xef, 0xdd, 0x03, 0xd0, 0xdf, 0x41, 0xa3, 0x70, 0x9a, 0xa1, 0x33, 0x13, 0xe2, 0x98, 0xfa, + 0x56, 0x40, 0x1e, 0x38, 0x0f, 0xae, 0x2b, 0xe1, 0xa1, 0x35, 0xcd, 0x0a, 0x17, 0x8d, 0x2d, 0x4f, + 0x33, 0x06, 0x3d, 0x9d, 0x9f, 0xc3, 0x43, 0x2b, 0x6c, 0x03, 0x34, 0x54, 0x50, 0x5a, 0xef, 0x2e, + 0x03, 0x15, 0xb2, 0x40, 0x45, 0x24, 0x10, 0xe8, 0x88, 0x06, 0x0d, 0x8e, 0x92, 0x16, 0x9a, 0x0b, + 0xfb, 0x65, 0x31, 0x2b, 0xe8, 0xd9, 0x96, 0x2f, 0xb6, 0x03, 0xe7, 0xe6, 0x9b, 0x84, 0xe6, 0xcf, + 0xdf, 0x0f, 0x48, 0x7a, 0x8e, 0x32, 0x49, 0x76, 0x60, 0x4b, 0x11, 0x07, 0xa7, 0xd7, 0x15, 0x58, + 0x4b, 0xcc, 0x32, 0x30, 0xfa, 0xca, 0x7f, 0x46, 0xd1, 0x30, 0xaf, 0x07, 0x5b, 0x68, 0xc4, 0xbf, + 0x28, 0xf0, 0xac, 0x00, 0xae, 0xf7, 0x26, 0x92, 0x95, 0xf3, 0x5c, 0xfc, 0x6d, 0x94, 0xc2, 0x9b, + 0xef, 0xbf, 0xdf, 0x0f, 0xe5, 0x70, 0x56, 0xd3, 0x0f, 0xa8, 0x26, 0x5e, 0xc1, 0xf8, 0x9d, 0x84, + 0xc6, 0xe3, 0xb2, 0x8e, 0x57, 0x92, 0xb2, 0x26, 0x5e, 0x50, 0xf2, 0xea, 0x65, 0x5c, 0x01, 0xc8, + 0x22, 0x07, 0x52, 0xc2, 0x45, 0x01, 0x88, 0x70, 0xe7, 0xe3, 0x43, 0x34, 0x16, 0x8a, 0x0f, 0x9e, + 0x4f, 0xac, 0x50, 0xb8, 0x10, 0xe4, 0x85, 0x0b, 0xbc, 0x00, 0xc1, 0x2c, 0x47, 0x30, 0x85, 0x27, + 0x45, 0x2a, 0x02, 0x4f, 0x07, 0x7f, 0x90, 0xd0, 0x75, 0x51, 0x36, 0xf1, 0xda, 0xb9, 0xe9, 0xe3, + 0x92, 0x2c, 0xdf, 0xbc, 0x9c, 0x33, 0x40, 0x5a, 0xe6, 0x90, 0x14, 0x5c, 0xea, 0x07, 0x49, 0x3b, + 0xe4, 0x9a, 0xfe, 0x1a, 0xbf, 0x95, 0x50, 0x3a, 0xa2, 0x86, 0x78, 0x31, 0x91, 0xfa, 0x1e, 0x49, + 0x96, 0x97, 0x2e, 0xf4, 0x03, 0x28, 0x73, 0x1c, 0x4a, 0x01, 0x4f, 0x89, 0xfd, 0x31, 0xcd, 0xf0, + 0xf5, 0x84, 0x8f, 0xbc, 0x71, 0x89, 0xe9, 0x51, 0x9f, 0x71, 0x49, 0x92, 0xc6, 0x3e, 0xe3, 0x92, + 0x28, 0x6f, 0xca, 0x12, 0x87, 0x33, 0x8b, 0x67, 0x12, 0xe0, 0x44, 0x9f, 0x6a, 0xf8, 0xab, 0x84, + 0x72, 0x7d, 0x64, 0x00, 0x97, 0xfb, 0x15, 0xdf, 0x5f, 0xa3, 0xe4, 0x8d, 0x2b, 0xc5, 0x00, 0xda, + 0x75, 0x8e, 0x76, 0x0d, 0xaf, 0x24, 0x91, 0x97, 0xf4, 0xfe, 0x74, 0x2a, 0x0f, 0x8f, 0x4f, 0x8b, + 0xd2, 0xc9, 0x69, 0x51, 0xfa, 0x75, 0x5a, 0x94, 0x8e, 0xce, 0x8a, 0xa9, 0x93, 0xb3, 0x62, 0xea, + 0xc7, 0x59, 0x31, 0xf5, 0x4c, 0x6d, 0x1a, 0xee, 0x4e, 0x47, 0x57, 0xeb, 0xac, 0xe5, 0xa5, 0xbb, + 0x45, 0x4c, 0x7b, 0x87, 0xb8, 0x94, 0xf0, 0x3f, 0x6d, 0x2f, 0x92, 0xde, 0xdd, 0xb7, 0xa9, 0xa3, + 0x8f, 0xf0, 0xd7, 0xea, 0xc6, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x50, 0x4a, 0x3d, 0xf6, 0xe7, + 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -678,6 +782,8 @@ type QueryClient interface { AllArticles(ctx context.Context, in *QueryAllArticlesRequest, opts ...grpc.CallOption) (*QueryAllArticlesResponse, error) // Queries a list of CoinsBurnEvents items. AllBurnedCoins(ctx context.Context, in *QueryAllBurnedCoinsRequest, opts ...grpc.CallOption) (*QueryAllBurnedCoinsResponse, error) + // Queries a list of AllAnonArticlesCounters items. + AllAnonArticlesCounters(ctx context.Context, in *QueryAllAnonArticlesCountersRequest, opts ...grpc.CallOption) (*QueryAllAnonArticlesCountersResponse, error) } type queryClient struct { @@ -742,6 +848,15 @@ func (c *queryClient) AllBurnedCoins(ctx context.Context, in *QueryAllBurnedCoin return out, nil } +func (c *queryClient) AllAnonArticlesCounters(ctx context.Context, in *QueryAllAnonArticlesCountersRequest, opts ...grpc.CallOption) (*QueryAllAnonArticlesCountersResponse, error) { + out := new(QueryAllAnonArticlesCountersResponse) + err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/AllAnonArticlesCounters", 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. @@ -756,6 +871,8 @@ type QueryServer interface { AllArticles(context.Context, *QueryAllArticlesRequest) (*QueryAllArticlesResponse, error) // Queries a list of CoinsBurnEvents items. AllBurnedCoins(context.Context, *QueryAllBurnedCoinsRequest) (*QueryAllBurnedCoinsResponse, error) + // Queries a list of AllAnonArticlesCounters items. + AllAnonArticlesCounters(context.Context, *QueryAllAnonArticlesCountersRequest) (*QueryAllAnonArticlesCountersResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -780,6 +897,9 @@ func (*UnimplementedQueryServer) AllArticles(ctx context.Context, req *QueryAllA func (*UnimplementedQueryServer) AllBurnedCoins(ctx context.Context, req *QueryAllBurnedCoinsRequest) (*QueryAllBurnedCoinsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AllBurnedCoins not implemented") } +func (*UnimplementedQueryServer) AllAnonArticlesCounters(ctx context.Context, req *QueryAllAnonArticlesCountersRequest) (*QueryAllAnonArticlesCountersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllAnonArticlesCounters not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -893,6 +1013,24 @@ func _Query_AllBurnedCoins_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Query_AllAnonArticlesCounters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllAnonArticlesCountersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllAnonArticlesCounters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bze.cointrunk.Query/AllAnonArticlesCounters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllAnonArticlesCounters(ctx, req.(*QueryAllAnonArticlesCountersRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "bze.cointrunk.Query", HandlerType: (*QueryServer)(nil), @@ -921,6 +1059,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "AllBurnedCoins", Handler: _Query_AllBurnedCoins_Handler, }, + { + MethodName: "AllAnonArticlesCounters", + Handler: _Query_AllAnonArticlesCounters_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cointrunk/query.proto", @@ -1381,6 +1523,90 @@ func (m *QueryAllBurnedCoinsResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } +func (m *QueryAllAnonArticlesCountersRequest) 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 *QueryAllAnonArticlesCountersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllAnonArticlesCountersRequest) 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 *QueryAllAnonArticlesCountersResponse) 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 *QueryAllAnonArticlesCountersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllAnonArticlesCountersResponse) 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.AnonArticlesCounters) > 0 { + for iNdEx := len(m.AnonArticlesCounters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AnonArticlesCounters[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 @@ -1564,6 +1790,38 @@ func (m *QueryAllBurnedCoinsResponse) Size() (n int) { return n } +func (m *QueryAllAnonArticlesCountersRequest) 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 *QueryAllAnonArticlesCountersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AnonArticlesCounters) > 0 { + for _, e := range m.AnonArticlesCounters { + 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 } @@ -2692,6 +2950,212 @@ func (m *QueryAllBurnedCoinsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryAllAnonArticlesCountersRequest) 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: QueryAllAnonArticlesCountersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllAnonArticlesCountersRequest: 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 *QueryAllAnonArticlesCountersResponse) 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: QueryAllAnonArticlesCountersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllAnonArticlesCountersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AnonArticlesCounters", 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.AnonArticlesCounters = append(m.AnonArticlesCounters, AnonArticlesCounter{}) + if err := m.AnonArticlesCounters[len(m.AnonArticlesCounters)-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/cointrunk/types/query.pb.gw.go b/x/cointrunk/types/query.pb.gw.go index dd018336..d8e3edbd 100644 --- a/x/cointrunk/types/query.pb.gw.go +++ b/x/cointrunk/types/query.pb.gw.go @@ -249,6 +249,42 @@ func local_request_Query_AllBurnedCoins_0(ctx context.Context, marshaler runtime } +var ( + filter_Query_AllAnonArticlesCounters_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AllAnonArticlesCounters_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllAnonArticlesCountersRequest + 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_AllAnonArticlesCounters_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllAnonArticlesCounters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllAnonArticlesCounters_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllAnonArticlesCountersRequest + 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_AllAnonArticlesCounters_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllAnonArticlesCounters(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. @@ -393,6 +429,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_AllAnonArticlesCounters_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_AllAnonArticlesCounters_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_AllAnonArticlesCounters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -554,6 +613,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_AllAnonArticlesCounters_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_AllAnonArticlesCounters_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_AllAnonArticlesCounters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -569,6 +648,8 @@ var ( pattern_Query_AllArticles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "all_articles"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_AllBurnedCoins_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "all_burned_coins"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_AllAnonArticlesCounters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "all_anon_articles_counters"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -583,4 +664,6 @@ var ( forward_Query_AllArticles_0 = runtime.ForwardResponseMessage forward_Query_AllBurnedCoins_0 = runtime.ForwardResponseMessage + + forward_Query_AllAnonArticlesCounters_0 = runtime.ForwardResponseMessage ) From 881169c90f287de8b0792680c7764ed88e7a4b72 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Sat, 3 Dec 2022 01:53:01 +0200 Subject: [PATCH 25/54] sanitize articles title --- app/app.go | 16 ++-------- bzeutils/htmlSanitizer.go | 32 +++++++++++++++++++ go.mod | 4 +++ go.sum | 4 +++ .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +++++++++---------- .../bze/bze.scavenge/module/index.ts | 6 ++-- x/cointrunk/types/message_add_article.go | 3 +- 7 files changed, 64 insertions(+), 33 deletions(-) create mode 100644 bzeutils/htmlSanitizer.go diff --git a/app/app.go b/app/app.go index 9fdf1267..6b347080 100644 --- a/app/app.go +++ b/app/app.go @@ -1,8 +1,6 @@ package app import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" - ibcclientclient "github.com/cosmos/ibc-go/v2/modules/core/02-client/client" "io" "net/http" "os" @@ -76,8 +74,8 @@ import ( ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types" ibc "github.com/cosmos/ibc-go/v2/modules/core" ibcclient "github.com/cosmos/ibc-go/v2/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/modules/core/02-client/types" + ibcclientclient "github.com/cosmos/ibc-go/v2/modules/core/02-client/client" + ibcclienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types" ibcporttypes "github.com/cosmos/ibc-go/v2/modules/core/05-port/types" ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host" ibckeeper "github.com/cosmos/ibc-go/v2/modules/core/keeper" @@ -333,14 +331,6 @@ func New( appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, ) - // register the proposal types - govRouter := govtypes.NewRouter() - govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) - // Create Transfer Keepers app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), @@ -383,7 +373,7 @@ func New( AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). + AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). AddRoute(cointrunkmoduletypes.RouterKey, cointrunkmodule.NewCointrunkProposalHandler(app.CointrunkKeeper)) app.GovKeeper = govkeeper.NewKeeper( diff --git a/bzeutils/htmlSanitizer.go b/bzeutils/htmlSanitizer.go new file mode 100644 index 00000000..b79012d7 --- /dev/null +++ b/bzeutils/htmlSanitizer.go @@ -0,0 +1,32 @@ +package bzeutils + +import ( + "github.com/microcosm-cc/bluemonday" + "sync" +) + +var ( + once sync.Once + sanitizer *Sanitizer +) + +type Sanitizer struct { + policy *bluemonday.Policy +} + +func GetSanitizer() *Sanitizer { + // Do this once for each unique policy, and use the policy for the life of the program + // Policy creation/editing is not safe to use in multiple goroutines + // https://github.com/microcosm-cc/bluemonday#usage + once.Do(func() { + sanitizer = &Sanitizer{ + policy: bluemonday.StrictPolicy(), + } + }) + + return sanitizer +} + +func (s Sanitizer) SanitizeHtml(html string) string { + return s.policy.Sanitize(html) +} diff --git a/go.mod b/go.mod index 1136f44a..700c3ef9 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/golang/protobuf v1.5.2 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/microcosm-cc/bluemonday v1.0.4 github.com/spf13/cast v1.5.0 github.com/spf13/cobra v1.5.0 github.com/stretchr/testify v1.8.0 @@ -28,11 +29,13 @@ require ( github.com/DataDog/zstd v1.4.5 // indirect github.com/Workiva/go-datastructures v1.0.53 // indirect github.com/armon/go-metrics v0.3.10 // indirect + github.com/aymerick/douceur v0.2.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/btcsuite/btcd v0.22.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/chris-ramon/douceur v0.2.0 // indirect github.com/coinbase/rosetta-sdk-go v0.7.0 // indirect github.com/confio/ics23/go v0.7.0 // indirect github.com/cosmos/btcutil v1.0.4 // indirect @@ -60,6 +63,7 @@ require ( github.com/google/btree v1.0.0 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/orderedcode v0.0.1 // indirect + github.com/gorilla/css v1.0.0 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect diff --git a/go.sum b/go.sum index bc97a6aa..95a7fdc5 100644 --- a/go.sum +++ b/go.sum @@ -186,6 +186,7 @@ github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpi github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.36.30/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -255,6 +256,7 @@ github.com/charmbracelet/glow v1.4.0/go.mod h1:PmzpVs6fvXd60PmqRkbKtSz412SfDFPD3 github.com/chavacava/garif v0.0.0-20210405164556-e8a0a408d6af/go.mod h1:Qjyv4H3//PWVzTeCezG2b9IRn6myJxJSr4TD/xo6ojU= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= +github.com/chris-ramon/douceur v0.2.0 h1:IDMEdxlEUUBYBKE4z/mJnFyVXox+MjuEVDJNN27glkU= github.com/chris-ramon/douceur v0.2.0/go.mod h1:wDW5xjJdeoMm1mRt4sD4c/LbF/mWdEpRXQKjTR8nIBE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -744,6 +746,7 @@ github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1: github.com/gordonklaus/ineffassign v0.0.0-20210225214923-2e10b2664254/go.mod h1:M9mZEtGIsR1oDaZagNPNG9iq9n2HrhZ17dsXk73V3Lw= github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= @@ -1011,6 +1014,7 @@ github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81/go.mod h1:KQ7+USdGKfp github.com/mgechev/revive v1.1.1/go.mod h1:PKqk4L74K6wVNwY2b6fr+9Qqr/3hIsHVfZCJdbvozrY= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= +github.com/microcosm-cc/bluemonday v1.0.4 h1:p0L+CTpo/PLFdkoPcJemLXG+fpMD7pYOoDEq1axMbGg= github.com/microcosm-cc/bluemonday v1.0.4/go.mod h1:8iwZnFn2CDDNZ0r6UXhF4xawGvzaqzCRa1n3/lO3W2w= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 474b327f..0b1e1ca7 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,33 +232,33 @@ export default { }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgSubmitScavenge(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgRevealSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -278,29 +278,29 @@ export default { } }, - async MsgRevealSolution({ rootGetters }, { value }) { + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgSubmitScavenge(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgRevealSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 5f72a96b..0e8c4c98 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,14 +4,14 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; +import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ]; @@ -45,8 +45,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), }; diff --git a/x/cointrunk/types/message_add_article.go b/x/cointrunk/types/message_add_article.go index b05815e4..ce9b8fd7 100644 --- a/x/cointrunk/types/message_add_article.go +++ b/x/cointrunk/types/message_add_article.go @@ -2,6 +2,7 @@ package types import ( "errors" + "github.com/bze-alphateam/bze/bzeutils" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "net/url" @@ -15,7 +16,7 @@ var _ sdk.Msg = &MsgAddArticle{} func NewMsgAddArticle(publisher string, title string, url string, picture string) *MsgAddArticle { return &MsgAddArticle{ Publisher: publisher, - Title: strings.TrimSpace(title), + Title: strings.TrimSpace(bzeutils.GetSanitizer().SanitizeHtml(title)), Url: strings.TrimSpace(url), Picture: strings.TrimSpace(picture), } From ea9044f2ab269040fc36f45c99bd62180cfe478f Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 8 Dec 2022 18:14:15 +0200 Subject: [PATCH 26/54] scaffold and register burner module --- app/app.go | 48 +- docs/static/openapi.yml | 46 + proto/burner/genesis.proto | 14 + proto/burner/params.proto | 12 + proto/burner/query.proto | 30 + proto/burner/tx.proto | 13 + testutil/keeper/burner.go | 53 + .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +- .../bze/bze.scavenge/module/index.ts | 12 +- .../bze/bzealphateam.bze.burner/index.ts | 141 + .../bzealphateam.bze.burner/module/index.ts | 57 + .../bzealphateam.bze.burner/module/rest.ts | 247 + .../module/types/burner/genesis.ts | 78 + .../module/types/burner/params.ts | 56 + .../module/types/burner/query.ts | 152 + .../module/types/burner/tx.ts | 20 + .../cosmos/base/query/v1beta1/pagination.ts | 328 + .../module/types/gogoproto/gogo.ts | 2 + .../module/types/google/api/annotations.ts | 2 + .../module/types/google/api/http.ts | 706 +++ .../types/google/protobuf/descriptor.ts | 5314 +++++++++++++++++ .../bze/bzealphateam.bze.burner/package.json | 18 + .../bze/bzealphateam.bze.burner/vuex-root | 1 + vue/src/store/generated/index.ts | 2 + x/burner/client/cli/query.go | 31 + x/burner/client/cli/query_params.go | 34 + x/burner/client/cli/tx.go | 36 + x/burner/genesis.go | 24 + x/burner/genesis_test.go | 29 + x/burner/handler.go | 26 + x/burner/keeper/grpc_query.go | 7 + x/burner/keeper/grpc_query_params.go | 19 + x/burner/keeper/grpc_query_params_test.go | 21 + x/burner/keeper/keeper.go | 53 + x/burner/keeper/msg_server.go | 17 + x/burner/keeper/msg_server_test.go | 16 + x/burner/keeper/params.go | 16 + x/burner/keeper/params_test.go | 18 + x/burner/module.go | 175 + x/burner/module_simulation.go | 64 + x/burner/simulation/simap.go | 15 + x/burner/types/codec.go | 23 + x/burner/types/errors.go | 12 + x/burner/types/expected_keepers.go | 18 + x/burner/types/genesis.go | 24 + x/burner/types/genesis.pb.go | 321 + x/burner/types/genesis_test.go | 40 + x/burner/types/keys.go | 22 + x/burner/types/params.go | 39 + x/burner/types/params.pb.go | 264 + x/burner/types/query.pb.go | 537 ++ x/burner/types/query.pb.gw.go | 153 + x/burner/types/tx.pb.go | 81 + x/burner/types/types.go | 1 + 54 files changed, 9491 insertions(+), 29 deletions(-) create mode 100644 proto/burner/genesis.proto create mode 100644 proto/burner/params.proto create mode 100644 proto/burner/query.proto create mode 100644 proto/burner/tx.proto create mode 100644 testutil/keeper/burner.go create mode 100755 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/index.ts create mode 100755 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/index.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/rest.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/genesis.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/params.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/query.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/tx.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/cosmos/base/query/v1beta1/pagination.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/gogoproto/gogo.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/google/api/annotations.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/google/api/http.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/google/protobuf/descriptor.ts create mode 100755 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/package.json create mode 100755 vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/vuex-root create mode 100644 x/burner/client/cli/query.go create mode 100644 x/burner/client/cli/query_params.go create mode 100644 x/burner/client/cli/tx.go create mode 100644 x/burner/genesis.go create mode 100644 x/burner/genesis_test.go create mode 100644 x/burner/handler.go create mode 100644 x/burner/keeper/grpc_query.go create mode 100644 x/burner/keeper/grpc_query_params.go create mode 100644 x/burner/keeper/grpc_query_params_test.go create mode 100644 x/burner/keeper/keeper.go create mode 100644 x/burner/keeper/msg_server.go create mode 100644 x/burner/keeper/msg_server_test.go create mode 100644 x/burner/keeper/params.go create mode 100644 x/burner/keeper/params_test.go create mode 100644 x/burner/module.go create mode 100644 x/burner/module_simulation.go create mode 100644 x/burner/simulation/simap.go create mode 100644 x/burner/types/codec.go create mode 100644 x/burner/types/errors.go create mode 100644 x/burner/types/expected_keepers.go create mode 100644 x/burner/types/genesis.go create mode 100644 x/burner/types/genesis.pb.go create mode 100644 x/burner/types/genesis_test.go create mode 100644 x/burner/types/keys.go create mode 100644 x/burner/types/params.go create mode 100644 x/burner/types/params.pb.go create mode 100644 x/burner/types/query.pb.go create mode 100644 x/burner/types/query.pb.gw.go create mode 100644 x/burner/types/tx.pb.go create mode 100644 x/burner/types/types.go diff --git a/app/app.go b/app/app.go index 6b347080..37014a23 100644 --- a/app/app.go +++ b/app/app.go @@ -98,6 +98,10 @@ import ( cointrunkmoduleclient "github.com/bze-alphateam/bze/x/cointrunk/client" cointrunkmodulekeeper "github.com/bze-alphateam/bze/x/cointrunk/keeper" cointrunkmoduletypes "github.com/bze-alphateam/bze/x/cointrunk/types" + + burnermodule "github.com/bze-alphateam/bze/x/burner" + burnermodulekeeper "github.com/bze-alphateam/bze/x/burner/keeper" + burnermoduletypes "github.com/bze-alphateam/bze/x/burner/types" // this line is used by starport scaffolding # stargate/app/moduleImport ) @@ -155,6 +159,7 @@ var ( vesting.AppModuleBasic{}, scavengemodule.AppModuleBasic{}, cointrunkmodule.AppModuleBasic{}, + burnermodule.AppModuleBasic{}, // this line is used by starport scaffolding # stargate/app/moduleBasic ) @@ -167,8 +172,9 @@ var ( stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, govtypes.ModuleName: {authtypes.Burner}, ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - scavengemoduletypes.ModuleName: {authtypes.Burner, authtypes.Staking}, - cointrunkmoduletypes.ModuleName: {authtypes.Burner}, + scavengemoduletypes.ModuleName: nil, + cointrunkmoduletypes.ModuleName: nil, + burnermoduletypes.ModuleName: {authtypes.Burner}, // this line is used by starport scaffolding # stargate/app/maccPerms } ) @@ -227,6 +233,7 @@ type App struct { ScavengeKeeper scavengemodulekeeper.Keeper CointrunkKeeper cointrunkmodulekeeper.Keeper + BurnerKeeper burnermodulekeeper.Keeper // this line is used by starport scaffolding # stargate/app/keeperDeclaration // the module manager @@ -256,11 +263,23 @@ func New( bApp.SetInterfaceRegistry(interfaceRegistry) keys := sdk.NewKVStoreKeys( - authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, - minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, - evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, - scavengemoduletypes.StoreKey, cointrunkmoduletypes.StoreKey, + authtypes.StoreKey, + banktypes.StoreKey, + stakingtypes.StoreKey, + minttypes.StoreKey, + distrtypes.StoreKey, + slashingtypes.StoreKey, + govtypes.StoreKey, + paramstypes.StoreKey, + ibchost.StoreKey, + upgradetypes.StoreKey, + feegrant.StoreKey, + evidencetypes.StoreKey, + ibctransfertypes.StoreKey, + capabilitytypes.StoreKey, + scavengemoduletypes.StoreKey, + cointrunkmoduletypes.StoreKey, + burnermoduletypes.StoreKey, // this line is used by starport scaffolding # stargate/app/storeKey ) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) @@ -363,8 +382,18 @@ func New( app.AccountKeeper, ) + app.BurnerKeeper = *burnermodulekeeper.NewKeeper( + appCodec, + keys[burnermoduletypes.StoreKey], + keys[burnermoduletypes.MemStoreKey], + app.GetSubspace(burnermoduletypes.ModuleName), + app.BankKeeper, + app.AccountKeeper, + ) + scavengeModule := scavengemodule.NewAppModule(appCodec, app.ScavengeKeeper) cointrunkModule := cointrunkmodule.NewAppModule(appCodec, app.CointrunkKeeper, app.AccountKeeper, app.BankKeeper) + burnerModule := burnermodule.NewAppModule(appCodec, app.BurnerKeeper, app.AccountKeeper, app.BankKeeper) // this line is used by starport scaffolding # stargate/app/keeperDefinition // register the proposal types @@ -419,6 +448,7 @@ func New( transferModule, scavengeModule, cointrunkModule, + burnerModule, // this line is used by starport scaffolding # stargate/app/appModule ) @@ -446,6 +476,7 @@ func New( vestingtypes.ModuleName, ibctransfertypes.ModuleName, cointrunkmoduletypes.ModuleName, + burnermoduletypes.ModuleName, ) app.mm.SetOrderEndBlockers( @@ -468,6 +499,7 @@ func New( vestingtypes.ModuleName, ibctransfertypes.ModuleName, cointrunkmoduletypes.ModuleName, + burnermoduletypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -495,6 +527,7 @@ func New( vestingtypes.ModuleName, paramstypes.ModuleName, cointrunkmoduletypes.ModuleName, + burnermoduletypes.ModuleName, // this line is used by starport scaffolding # stargate/app/initGenesis ) @@ -696,6 +729,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(ibchost.ModuleName) paramsKeeper.Subspace(scavengemoduletypes.ModuleName) paramsKeeper.Subspace(cointrunkmoduletypes.ModuleName) + paramsKeeper.Subspace(burnermoduletypes.ModuleName) // this line is used by starport scaffolding # stargate/app/paramSubspace return paramsKeeper diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 3e7d991f..fd396c7b 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -1067,6 +1067,42 @@ paths: type: string tags: - Query + /bzealphateam/bze/burner/params: + get: + summary: Parameters queries the parameters of the module. + operationId: BzealphateamBzeBurnerParams + 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 /cosmos/auth/v1beta1/accounts: get: summary: Accounts returns all the existing accounts @@ -31540,6 +31576,16 @@ definitions: type: string scavenger: type: string + bzealphateam.bze.burner.Params: + type: object + description: Params defines the parameters for the module. + bzealphateam.bze.burner.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. cosmos.auth.v1beta1.Params: type: object properties: diff --git a/proto/burner/genesis.proto b/proto/burner/genesis.proto new file mode 100644 index 00000000..a8566309 --- /dev/null +++ b/proto/burner/genesis.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package bze.burner.v1; + +import "gogoproto/gogo.proto"; +import "burner/params.proto"; +// this line is used by starport scaffolding # genesis/proto/import + +option go_package = "github.com/bze-alphateam/bze/x/burner/types"; + +// GenesisState defines the burner module's genesis state. +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + // this line is used by starport scaffolding # genesis/proto/state +} diff --git a/proto/burner/params.proto b/proto/burner/params.proto new file mode 100644 index 00000000..6d642f3b --- /dev/null +++ b/proto/burner/params.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package bze.burner.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/bze-alphateam/bze/x/burner/types"; + +// Params defines the parameters for the module. +message Params { + option (gogoproto.goproto_stringer) = false; + +} \ No newline at end of file diff --git a/proto/burner/query.proto b/proto/burner/query.proto new file mode 100644 index 00000000..95ef6513 --- /dev/null +++ b/proto/burner/query.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package bze.burner.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "burner/params.proto"; +// this line is used by starport scaffolding # 1 + +option go_package = "github.com/bze-alphateam/bze/x/burner/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 = "/bzealphateam/bze/burner/params"; + } + // this line is used by starport scaffolding # 2 +} + +// 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]; +} + +// this line is used by starport scaffolding # 3 diff --git a/proto/burner/tx.proto b/proto/burner/tx.proto new file mode 100644 index 00000000..b3f60415 --- /dev/null +++ b/proto/burner/tx.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package bze.burner.v1; + +// this line is used by starport scaffolding # proto/tx/import + +option go_package = "github.com/bze-alphateam/bze/x/burner/types"; + +// Msg defines the Msg service. +service Msg { + // this line is used by starport scaffolding # proto/tx/rpc +} + +// this line is used by starport scaffolding # proto/tx/message \ No newline at end of file diff --git a/testutil/keeper/burner.go b/testutil/keeper/burner.go new file mode 100644 index 00000000..c13b9912 --- /dev/null +++ b/testutil/keeper/burner.go @@ -0,0 +1,53 @@ +package keeper + +import ( + "testing" + + "github.com/bze-alphateam/bze/x/burner/keeper" + "github.com/bze-alphateam/bze/x/burner/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" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmdb "github.com/tendermint/tm-db" +) + +func BurnerKeeper(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, sdk.StoreTypeIAVL, db) + stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) + require.NoError(t, stateStore.LoadLatestVersion()) + + registry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(registry) + + paramsSubspace := typesparams.NewSubspace(cdc, + types.Amino, + storeKey, + memStoreKey, + "BurnerParams", + ) + k := keeper.NewKeeper( + cdc, + storeKey, + memStoreKey, + paramsSubspace, + nil, + ) + + ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) + + // Initialize params + k.SetParams(ctx, types.DefaultParams()) + + return k, ctx +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 0b1e1ca7..0a633940 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,18 +232,18 @@ export default { }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -262,32 +262,32 @@ export default { } } }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgSubmitScavenge(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, @@ -304,16 +304,16 @@ export default { } } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgSubmitScavenge(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 0e8c4c98..44bd4fda 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; -import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; +import { MsgRevealSolution } from "./types/scavenge/tx"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), }; }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/index.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/index.ts new file mode 100755 index 00000000..5b0e8d35 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/index.ts @@ -0,0 +1,141 @@ +import { txClient, queryClient, MissingWalletError , registry} from './module' + +import { Params } from "./module/types/burner/params" + + +export { Params }; + +async function initTxClient(vuexGetters) { + return await txClient(vuexGetters['common/wallet/signer'], { + addr: vuexGetters['common/env/apiTendermint'] + }) +} + +async function initQueryClient(vuexGetters) { + return await queryClient({ + addr: vuexGetters['common/env/apiCosmos'] + }) +} + +function mergeResults(value, next_values) { + for (let prop of Object.keys(next_values)) { + if (Array.isArray(next_values[prop])) { + value[prop]=[...value[prop], ...next_values[prop]] + }else{ + value[prop]=next_values[prop] + } + } + return value +} + +function getStructure(template) { + let structure = { fields: [] } + for (const [key, value] of Object.entries(template)) { + let field: any = {} + field.name = key + field.type = typeof value + structure.fields.push(field) + } + return structure +} + +const getDefaultState = () => { + return { + Params: {}, + + _Structure: { + Params: getStructure(Params.fromPartial({})), + + }, + _Registry: registry, + _Subscriptions: new Set(), + } +} + +// initial state +const state = getDefaultState() + +export default { + namespaced: true, + state, + mutations: { + RESET_STATE(state) { + Object.assign(state, getDefaultState()) + }, + QUERY(state, { query, key, value }) { + state[query][JSON.stringify(key)] = value + }, + SUBSCRIBE(state, subscription) { + state._Subscriptions.add(JSON.stringify(subscription)) + }, + UNSUBSCRIBE(state, subscription) { + state._Subscriptions.delete(JSON.stringify(subscription)) + } + }, + getters: { + getParams: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.Params[JSON.stringify(params)] ?? {} + }, + + getTypeStructure: (state) => (type) => { + return state._Structure[type].fields + }, + getRegistry: (state) => { + return state._Registry + } + }, + actions: { + init({ dispatch, rootGetters }) { + console.log('Vuex module: bzealphateam.bze.burner initialized!') + if (rootGetters['common/env/client']) { + rootGetters['common/env/client'].on('newblock', () => { + dispatch('StoreUpdate') + }) + } + }, + resetState({ commit }) { + commit('RESET_STATE') + }, + unsubscribe({ commit }, subscription) { + commit('UNSUBSCRIBE', subscription) + }, + async StoreUpdate({ state, dispatch }) { + state._Subscriptions.forEach(async (subscription) => { + try { + const sub=JSON.parse(subscription) + await dispatch(sub.action, sub.payload) + }catch(e) { + throw new Error('Subscriptions: ' + e.message) + } + }) + }, + + + + + + + async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryParams()).data + + + commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) + return getters['getParams']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + + + + } +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/index.ts new file mode 100755 index 00000000..67d4b093 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/index.ts @@ -0,0 +1,57 @@ +// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient } from "@cosmjs/stargate"; +import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; +import { Api } from "./rest"; + + +const types = [ + +]; +export const MissingWalletError = new Error("wallet is required"); + +export const registry = new Registry(types); + +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string +} + +interface SignAndBroadcastOptions { + fee: StdFee, + memo?: string +} + +const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { + if (!wallet) throw MissingWalletError; + let client; + if (addr) { + client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); + }else{ + client = await SigningStargateClient.offline( wallet, { registry }); + } + const { address } = (await wallet.getAccounts())[0]; + + return { + signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + + }; +}; + +interface QueryClientOptions { + addr: string +} + +const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseUrl: addr }); +}; + +export { + txClient, + queryClient, +}; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/rest.ts new file mode 100644 index 00000000..94dcecc1 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/rest.ts @@ -0,0 +1,247 @@ +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +/** + * Params defines the parameters for the module. + */ +export type BurnerParams = object; + +/** + * QueryParamsResponse is response type for the Query/Params RPC method. + */ +export interface BurnerQueryParamsResponse { + /** params holds all the parameters of this module. */ + params?: BurnerParams; +} + +export interface ProtobufAny { + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: keyof Omit; + /** request body */ + body?: unknown; + /** base url */ + baseUrl?: string; + /** request cancellation token */ + cancelToken?: CancelToken; +} + +export type RequestParams = Omit; + +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: (securityData: SecurityDataType) => RequestParams | void; +} + +export interface HttpResponse extends Response { + data: D; + error: E; +} + +type CancelToken = Symbol | string | number; + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public baseUrl: string = ""; + private securityData: SecurityDataType = null as any; + private securityWorker: null | ApiConfig["securityWorker"] = null; + private abortControllers = new Map(); + + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; + + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } + + public setSecurityData = (data: SecurityDataType) => { + this.securityData = data; + }; + + private addQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + + return ( + encodeURIComponent(key) + + "=" + + encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) + ); + } + + protected toQueryString(rawQuery?: QueryParamsType): string { + const query = rawQuery || {}; + const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + return keys + .map((key) => + typeof query[key] === "object" && !Array.isArray(query[key]) + ? this.toQueryString(query[key] as QueryParamsType) + : this.addQueryParam(query, key), + ) + .join("&"); + } + + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? `?${queryString}` : ""; + } + + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, + [ContentType.FormData]: (input: any) => + Object.keys(input || {}).reduce((data, key) => { + data.append(key, input[key]); + return data; + }, new FormData()), + [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), + }; + + private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + if (this.abortControllers.has(cancelToken)) { + const abortController = this.abortControllers.get(cancelToken); + if (abortController) { + return abortController.signal; + } + return void 0; + } + + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; + + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); + + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; + + public request = ({ + body, + secure, + path, + type, + query, + format = "json", + baseUrl, + cancelToken, + ...params + }: FullRequestParams): Promise> => { + const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const queryString = query && this.toQueryString(query); + const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + + return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), + }).then(async (response) => { + const r = response as HttpResponse; + r.data = (null as unknown) as T; + r.error = (null as unknown) as E; + + const data = await response[format]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); + + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } + + if (!response.ok) throw data; + return data; + }); + }; +} + +/** + * @title burner/genesis.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryParams + * @summary Parameters queries the parameters of the module. + * @request GET:/bzealphateam/bze/burner/params + */ + queryParams = (params: RequestParams = {}) => + this.request({ + path: `/bzealphateam/bze/burner/params`, + method: "GET", + format: "json", + ...params, + }); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/genesis.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/genesis.ts new file mode 100644 index 00000000..b2158e37 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/genesis.ts @@ -0,0 +1,78 @@ +/* eslint-disable */ +import { Params } from "../burner/params"; +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bzealphateam.bze.burner"; + +/** GenesisState defines the burner module's genesis state. */ +export interface GenesisState { + /** this line is used by starport scaffolding # genesis/proto/state */ + params: Params | undefined; +} + +const baseGenesisState: object = {}; + +export const GenesisState = { + encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/params.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/params.ts new file mode 100644 index 00000000..747171e5 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/params.ts @@ -0,0 +1,56 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bzealphateam.bze.burner"; + +/** Params defines the parameters for the module. */ +export interface Params {} + +const baseParams: object = {}; + +export const Params = { + encode(_: Params, writer: Writer = Writer.create()): Writer { + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Params { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): Params { + const message = { ...baseParams } as Params; + return message; + }, + + toJSON(_: Params): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): Params { + const message = { ...baseParams } as Params; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/query.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/query.ts new file mode 100644 index 00000000..ce80387c --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/query.ts @@ -0,0 +1,152 @@ +/* eslint-disable */ +import { Reader, Writer } from "protobufjs/minimal"; +import { Params } from "../burner/params"; + +export const protobufPackage = "bzealphateam.bze.burner"; + +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} + +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params | undefined; +} + +const baseQueryParamsRequest: object = {}; + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, +}; + +const baseQueryParamsResponse: object = {}; + +export const QueryParamsResponse = { + encode( + message: QueryParamsResponse, + writer: Writer = Writer.create() + ): Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** Parameters queries the parameters of the module. */ + Params(request: QueryParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request( + "bzealphateam.bze.burner.Query", + "Params", + data + ); + return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/tx.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/tx.ts new file mode 100644 index 00000000..9636636a --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/burner/tx.ts @@ -0,0 +1,20 @@ +/* eslint-disable */ +export const protobufPackage = "bzealphateam.bze.burner"; + +/** Msg defines the Msg service. */ +export interface Msg {} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 00000000..9c87ac0c --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,328 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.query.v1beta1"; + +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequest { + /** + * 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. + */ + key: Uint8Array; + /** + * 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. + */ + offset: number; + /** + * 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. + */ + limit: number; + /** + * 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. + */ + count_total: boolean; + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse: boolean; +} + +/** + * 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; + * } + */ +export interface PageResponse { + /** + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently + */ + next_key: Uint8Array; + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + */ + total: number; +} + +const basePageRequest: object = { + offset: 0, + limit: 0, + count_total: false, + reverse: false, +}; + +export const PageRequest = { + encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.offset !== 0) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== 0) { + writer.uint32(24).uint64(message.limit); + } + if (message.count_total === true) { + writer.uint32(32).bool(message.count_total); + } + if (message.reverse === true) { + writer.uint32(40).bool(message.reverse); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PageRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePageRequest } as PageRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.offset = longToNumber(reader.uint64() as Long); + break; + case 3: + message.limit = longToNumber(reader.uint64() as Long); + break; + case 4: + message.count_total = reader.bool(); + break; + case 5: + message.reverse = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PageRequest { + const message = { ...basePageRequest } as PageRequest; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = Number(object.offset); + } else { + message.offset = 0; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = Number(object.limit); + } else { + message.limit = 0; + } + if (object.count_total !== undefined && object.count_total !== null) { + message.count_total = Boolean(object.count_total); + } else { + message.count_total = false; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = Boolean(object.reverse); + } else { + message.reverse = false; + } + return message; + }, + + toJSON(message: PageRequest): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array() + )); + message.offset !== undefined && (obj.offset = message.offset); + message.limit !== undefined && (obj.limit = message.limit); + message.count_total !== undefined && + (obj.count_total = message.count_total); + message.reverse !== undefined && (obj.reverse = message.reverse); + return obj; + }, + + fromPartial(object: DeepPartial): PageRequest { + const message = { ...basePageRequest } as PageRequest; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = object.offset; + } else { + message.offset = 0; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = object.limit; + } else { + message.limit = 0; + } + if (object.count_total !== undefined && object.count_total !== null) { + message.count_total = object.count_total; + } else { + message.count_total = false; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = object.reverse; + } else { + message.reverse = false; + } + return message; + }, +}; + +const basePageResponse: object = { total: 0 }; + +export const PageResponse = { + encode(message: PageResponse, writer: Writer = Writer.create()): Writer { + if (message.next_key.length !== 0) { + writer.uint32(10).bytes(message.next_key); + } + if (message.total !== 0) { + writer.uint32(16).uint64(message.total); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PageResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePageResponse } as PageResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.next_key = reader.bytes(); + break; + case 2: + message.total = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PageResponse { + const message = { ...basePageResponse } as PageResponse; + if (object.next_key !== undefined && object.next_key !== null) { + message.next_key = bytesFromBase64(object.next_key); + } + if (object.total !== undefined && object.total !== null) { + message.total = Number(object.total); + } else { + message.total = 0; + } + return message; + }, + + toJSON(message: PageResponse): unknown { + const obj: any = {}; + message.next_key !== undefined && + (obj.next_key = base64FromBytes( + message.next_key !== undefined ? message.next_key : new Uint8Array() + )); + message.total !== undefined && (obj.total = message.total); + return obj; + }, + + fromPartial(object: DeepPartial): PageResponse { + const message = { ...basePageResponse } as PageResponse; + if (object.next_key !== undefined && object.next_key !== null) { + message.next_key = object.next_key; + } else { + message.next_key = new Uint8Array(); + } + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } else { + message.total = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/gogoproto/gogo.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/gogoproto/gogo.ts new file mode 100644 index 00000000..3f41a047 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/gogoproto/gogo.ts @@ -0,0 +1,2 @@ +/* eslint-disable */ +export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/google/api/annotations.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/google/api/annotations.ts new file mode 100644 index 00000000..aace4787 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/google/api/annotations.ts @@ -0,0 +1,2 @@ +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/google/api/http.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/google/api/http.ts new file mode 100644 index 00000000..ccadff68 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/google/api/http.ts @@ -0,0 +1,706 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "google.api"; + +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path parmeters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fully_decode_reserved_expansion: boolean; +} + +/** + * `HttpRule` defines the mapping of an RPC method to one or more HTTP + * REST API methods. The mapping specifies how different portions of the RPC + * request message are mapped to URL path, URL query parameters, and + * HTTP request body. The mapping is typically specified as an + * `google.api.http` annotation on the RPC method, + * see "google/api/annotations.proto" for details. + * + * The mapping consists of a field specifying the path template and + * method kind. The path template can refer to fields in the request + * message, as in the example below which describes a REST GET + * operation on a resource collection of messages: + * + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * SubMessage sub = 2; // `sub.subfield` is url-mapped + * } + * message Message { + * string text = 1; // content of the resource + * } + * + * The same http annotation can alternatively be expressed inside the + * `GRPC API Configuration` YAML file. + * + * http: + * rules: + * - selector: .Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * This definition enables an automatic, bidrectional mapping of HTTP + * JSON to RPC. Example: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` + * + * In general, not only fields but also field paths can be referenced + * from a path pattern. Fields mapped to the path pattern cannot be + * repeated and must have a primitive (non-message) type. + * + * Any fields in the request message which are not bound by the path + * pattern automatically become (optional) HTTP query + * parameters. Assume the following definition of the request message: + * + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * int64 revision = 2; // becomes a parameter + * SubMessage sub = 3; // `sub.subfield` becomes a parameter + * } + * + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` + * + * Note that fields which are mapped to HTTP parameters must have a + * primitive type or a repeated primitive type. Message types are not + * allowed. In the case of a repeated type, the parameter can be + * repeated in the URL, as in `...?param=A¶m=B`. + * + * For HTTP method kinds which allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | RPC + * -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | RPC + * -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice of + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * + * This enables the following two alternative HTTP JSON to RPC + * mappings: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` + * + * # Rules for HTTP mapping + * + * The rules for mapping HTTP path, query parameters, and body fields + * to the request message are as follows: + * + * 1. The `body` field specifies either `*` or a field path, or is + * omitted. If omitted, it indicates there is no HTTP request body. + * 2. Leaf fields (recursive expansion of nested messages in the + * request) can be classified into three types: + * (a) Matched in the URL template. + * (b) Covered by body (if body is `*`, everything except (a) fields; + * else everything under the body field) + * (c) All other fields. + * 3. URL query parameters found in the HTTP request are mapped to (c) fields. + * 4. Any body sent with an HTTP request can contain only (b) fields. + * + * The syntax of the path template is as follows: + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single path segment. The syntax `**` matches zero + * or more path segments, which must be the last part of the path except the + * `Verb`. The syntax `LITERAL` matches literal text in the path. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path, all characters + * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the + * Discovery Document as `{var}`. + * + * If a variable contains one or more path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path, all + * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables + * show up in the Discovery Document as `{+var}`. + * + * NOTE: While the single segment variable matches the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 + * Simple String Expansion, the multi segment variable **does not** match + * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. + * + * NOTE: the field paths in variables and in the `body` must not refer to + * repeated fields or map fields. + */ +export interface HttpRule { + /** + * Selects methods to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + */ + selector: string; + /** Used for listing and getting information about resources. */ + get: string | undefined; + /** Used for updating a resource. */ + put: string | undefined; + /** Used for creating a resource. */ + post: string | undefined; + /** Used for deleting a resource. */ + delete: string | undefined; + /** Used for updating a resource. */ + patch: string | undefined; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom: CustomHttpPattern | undefined; + /** + * The name of the request field whose value is mapped to the HTTP body, or + * `*` for mapping all fields not captured by the path pattern to the HTTP + * body. NOTE: the referred field must not be a repeated field and must be + * present at the top-level of request message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * body of response. Other response fields are ignored. When + * not set, the response message will be used as HTTP body of response. + */ + response_body: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additional_bindings: HttpRule[]; +} + +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPattern { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} + +const baseHttp: object = { fully_decode_reserved_expansion: false }; + +export const Http = { + encode(message: Http, writer: Writer = Writer.create()): Writer { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fully_decode_reserved_expansion === true) { + writer.uint32(16).bool(message.fully_decode_reserved_expansion); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Http { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHttp } as Http; + message.rules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rules.push(HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fully_decode_reserved_expansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromJSON(e)); + } + } + if ( + object.fully_decode_reserved_expansion !== undefined && + object.fully_decode_reserved_expansion !== null + ) { + message.fully_decode_reserved_expansion = Boolean( + object.fully_decode_reserved_expansion + ); + } else { + message.fully_decode_reserved_expansion = false; + } + return message; + }, + + toJSON(message: Http): unknown { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map((e) => + e ? HttpRule.toJSON(e) : undefined + ); + } else { + obj.rules = []; + } + message.fully_decode_reserved_expansion !== undefined && + (obj.fully_decode_reserved_expansion = + message.fully_decode_reserved_expansion); + return obj; + }, + + fromPartial(object: DeepPartial): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromPartial(e)); + } + } + if ( + object.fully_decode_reserved_expansion !== undefined && + object.fully_decode_reserved_expansion !== null + ) { + message.fully_decode_reserved_expansion = + object.fully_decode_reserved_expansion; + } else { + message.fully_decode_reserved_expansion = false; + } + return message; + }, +}; + +const baseHttpRule: object = { selector: "", body: "", response_body: "" }; + +export const HttpRule = { + encode(message: HttpRule, writer: Writer = Writer.create()): Writer { + if (message.selector !== "") { + writer.uint32(10).string(message.selector); + } + if (message.get !== undefined) { + writer.uint32(18).string(message.get); + } + if (message.put !== undefined) { + writer.uint32(26).string(message.put); + } + if (message.post !== undefined) { + writer.uint32(34).string(message.post); + } + if (message.delete !== undefined) { + writer.uint32(42).string(message.delete); + } + if (message.patch !== undefined) { + writer.uint32(50).string(message.patch); + } + if (message.custom !== undefined) { + CustomHttpPattern.encode( + message.custom, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.body !== "") { + writer.uint32(58).string(message.body); + } + if (message.response_body !== "") { + writer.uint32(98).string(message.response_body); + } + for (const v of message.additional_bindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): HttpRule { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message.delete = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.response_body = reader.string(); + break; + case 11: + message.additional_bindings.push( + HttpRule.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = String(object.selector); + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = String(object.get); + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = String(object.put); + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = String(object.post); + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = String(object.delete); + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = String(object.patch); + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromJSON(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = String(object.body); + } else { + message.body = ""; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.response_body = String(object.response_body); + } else { + message.response_body = ""; + } + if ( + object.additional_bindings !== undefined && + object.additional_bindings !== null + ) { + for (const e of object.additional_bindings) { + message.additional_bindings.push(HttpRule.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: HttpRule): unknown { + const obj: any = {}; + message.selector !== undefined && (obj.selector = message.selector); + message.get !== undefined && (obj.get = message.get); + message.put !== undefined && (obj.put = message.put); + message.post !== undefined && (obj.post = message.post); + message.delete !== undefined && (obj.delete = message.delete); + message.patch !== undefined && (obj.patch = message.patch); + message.custom !== undefined && + (obj.custom = message.custom + ? CustomHttpPattern.toJSON(message.custom) + : undefined); + message.body !== undefined && (obj.body = message.body); + message.response_body !== undefined && + (obj.response_body = message.response_body); + if (message.additional_bindings) { + obj.additional_bindings = message.additional_bindings.map((e) => + e ? HttpRule.toJSON(e) : undefined + ); + } else { + obj.additional_bindings = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromPartial(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } else { + message.body = ""; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.response_body = object.response_body; + } else { + message.response_body = ""; + } + if ( + object.additional_bindings !== undefined && + object.additional_bindings !== null + ) { + for (const e of object.additional_bindings) { + message.additional_bindings.push(HttpRule.fromPartial(e)); + } + } + return message; + }, +}; + +const baseCustomHttpPattern: object = { kind: "", path: "" }; + +export const CustomHttpPattern = { + encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + if (message.kind !== "") { + writer.uint32(10).string(message.kind); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = String(object.kind); + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = String(object.path); + } else { + message.path = ""; + } + return message; + }, + + toJSON(message: CustomHttpPattern): unknown { + const obj: any = {}; + message.kind !== undefined && (obj.kind = message.kind); + message.path !== undefined && (obj.path = message.path); + return obj; + }, + + fromPartial(object: DeepPartial): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/google/protobuf/descriptor.ts new file mode 100644 index 00000000..a0167cb2 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/module/types/google/protobuf/descriptor.ts @@ -0,0 +1,5314 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} + +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name: string; + /** e.g. "foo", "foo.bar", etc. */ + package: string; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + public_dependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weak_dependency: number[]; + /** All top-level definitions in this file. */ + message_type: DescriptorProto[]; + enum_type: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options: FileOptions | undefined; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + source_code_info: SourceCodeInfo | undefined; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax: string; +} + +/** Describes a message type. */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nested_type: DescriptorProto[]; + enum_type: EnumDescriptorProto[]; + extension_range: DescriptorProto_ExtensionRange[]; + oneof_decl: OneofDescriptorProto[]; + options: MessageOptions | undefined; + reserved_range: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reserved_name: string[]; +} + +export interface DescriptorProto_ExtensionRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; + options: ExtensionRangeOptions | undefined; +} + +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; +} + +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + type_name: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * TODO(kenton): Base-64 encode? + */ + default_value: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneof_index: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + json_name: string; + options: FieldOptions | undefined; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + */ + proto3_optional: boolean; +} + +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_TypeFromJSON( + object: any +): FieldDescriptorProto_Type { + switch (object) { + case 1: + case "TYPE_DOUBLE": + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case "TYPE_FLOAT": + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case "TYPE_INT64": + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case "TYPE_UINT64": + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case "TYPE_INT32": + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case "TYPE_FIXED64": + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case "TYPE_FIXED32": + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case "TYPE_BOOL": + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case "TYPE_STRING": + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case "TYPE_GROUP": + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case "TYPE_MESSAGE": + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case "TYPE_BYTES": + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case "TYPE_UINT32": + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case "TYPE_ENUM": + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case "TYPE_SFIXED32": + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case "TYPE_SFIXED64": + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case "TYPE_SINT32": + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case "TYPE_SINT64": + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_TypeToJSON( + object: FieldDescriptorProto_Type +): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return "TYPE_DOUBLE"; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return "TYPE_FLOAT"; + case FieldDescriptorProto_Type.TYPE_INT64: + return "TYPE_INT64"; + case FieldDescriptorProto_Type.TYPE_UINT64: + return "TYPE_UINT64"; + case FieldDescriptorProto_Type.TYPE_INT32: + return "TYPE_INT32"; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return "TYPE_FIXED64"; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return "TYPE_FIXED32"; + case FieldDescriptorProto_Type.TYPE_BOOL: + return "TYPE_BOOL"; + case FieldDescriptorProto_Type.TYPE_STRING: + return "TYPE_STRING"; + case FieldDescriptorProto_Type.TYPE_GROUP: + return "TYPE_GROUP"; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return "TYPE_MESSAGE"; + case FieldDescriptorProto_Type.TYPE_BYTES: + return "TYPE_BYTES"; + case FieldDescriptorProto_Type.TYPE_UINT32: + return "TYPE_UINT32"; + case FieldDescriptorProto_Type.TYPE_ENUM: + return "TYPE_ENUM"; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return "TYPE_SFIXED32"; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return "TYPE_SFIXED64"; + case FieldDescriptorProto_Type.TYPE_SINT32: + return "TYPE_SINT32"; + case FieldDescriptorProto_Type.TYPE_SINT64: + return "TYPE_SINT64"; + default: + return "UNKNOWN"; + } +} + +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_LabelFromJSON( + object: any +): FieldDescriptorProto_Label { + switch (object) { + case 1: + case "LABEL_OPTIONAL": + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_LabelToJSON( + object: FieldDescriptorProto_Label +): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return "LABEL_OPTIONAL"; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + default: + return "UNKNOWN"; + } +} + +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name: string; + options: OneofOptions | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: EnumOptions | undefined; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reserved_range: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reserved_name: string[]; +} + +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} + +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options: EnumValueOptions | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + input_type: string; + output_type: string; + options: MethodOptions | undefined; + /** Identifies if client streams multiple client messages */ + client_streaming: boolean; + /** Identifies if server streams multiple server messages */ + server_streaming: boolean; +} + +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + java_package: string; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + */ + java_outer_classname: string; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + java_multiple_files: boolean; + /** + * This option does nothing. + * + * @deprecated + */ + java_generate_equals_and_hash: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + java_string_check_utf8: boolean; + optimize_for: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + go_package: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + cc_generic_services: boolean; + java_generic_services: boolean; + py_generic_services: boolean; + php_generic_services: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + cc_enable_arenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objc_class_prefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharp_namespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swift_prefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + php_class_prefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + php_namespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + php_metadata_namespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + ruby_package: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpreted_option: UninterpretedOption[]; +} + +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, */ + SPEED = 1, + /** CODE_SIZE - etc. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} + +export function fileOptions_OptimizeModeFromJSON( + object: any +): FileOptions_OptimizeMode { + switch (object) { + case 1: + case "SPEED": + return FileOptions_OptimizeMode.SPEED; + case 2: + case "CODE_SIZE": + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case "LITE_RUNTIME": + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} + +export function fileOptions_OptimizeModeToJSON( + object: FileOptions_OptimizeMode +): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return "SPEED"; + case FileOptions_OptimizeMode.CODE_SIZE: + return "CODE_SIZE"; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return "LITE_RUNTIME"; + default: + return "UNKNOWN"; + } +} + +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + message_set_wire_format: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + no_standard_descriptor_accessor: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + map_entry: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + */ + lazy: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated: boolean; + /** For Google-internal migration only. Do not use. */ + weak: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case "STRING": + return FieldOptions_CType.STRING; + case 1: + case "CORD": + return FieldOptions_CType.CORD; + case 2: + case "STRING_PIECE": + return FieldOptions_CType.STRING_PIECE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} + +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return "STRING"; + case FieldOptions_CType.CORD: + return "CORD"; + case FieldOptions_CType.STRING_PIECE: + return "STRING_PIECE"; + default: + return "UNKNOWN"; + } +} + +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case "JS_NORMAL": + return FieldOptions_JSType.JS_NORMAL; + case 1: + case "JS_STRING": + return FieldOptions_JSType.JS_STRING; + case 2: + case "JS_NUMBER": + return FieldOptions_JSType.JS_NUMBER; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} + +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return "JS_NORMAL"; + case FieldOptions_JSType.JS_STRING: + return "JS_STRING"; + case FieldOptions_JSType.JS_NUMBER: + return "JS_NUMBER"; + default: + return "UNKNOWN"; + } +} + +export interface OneofOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allow_alias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface ServiceOptions { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated: boolean; + idempotency_level: MethodOptions_IdempotencyLevel; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} + +export function methodOptions_IdempotencyLevelFromJSON( + object: any +): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case "IDEMPOTENCY_UNKNOWN": + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case "NO_SIDE_EFFECTS": + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case "IDEMPOTENT": + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case "UNRECOGNIZED": + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} + +export function methodOptions_IdempotencyLevelToJSON( + object: MethodOptions_IdempotencyLevel +): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return "IDEMPOTENCY_UNKNOWN"; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return "NO_SIDE_EFFECTS"; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return "IDEMPOTENT"; + default: + return "UNKNOWN"; + } +} + +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifier_value: string; + positive_int_value: number; + negative_int_value: number; + double_value: number; + string_value: Uint8Array; + aggregate_value: string; +} + +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePart { + name_part: string; + is_extension: boolean; +} + +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} + +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition. For + * example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. * / + * /* Block comment attached to + * * grault. * / + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leading_comments: string; + trailing_comments: string; + leading_detached_comments: string[]; +} + +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} + +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + source_file: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end: number; +} + +const baseFileDescriptorSet: object = {}; + +export const FileDescriptorSet = { + encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.file.push( + FileDescriptorProto.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FileDescriptorSet): unknown { + const obj: any = {}; + if (message.file) { + obj.file = message.file.map((e) => + e ? FileDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.file = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFileDescriptorProto: object = { + name: "", + package: "", + dependency: "", + public_dependency: 0, + weak_dependency: 0, + syntax: "", +}; + +export const FileDescriptorProto = { + encode( + message: FileDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.package !== "") { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.public_dependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weak_dependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.message_type) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enum_type) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.source_code_info !== undefined) { + SourceCodeInfo.encode( + message.source_code_info, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.syntax !== "") { + writer.uint32(98).string(message.syntax); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.package = reader.string(); + break; + case 3: + message.dependency.push(reader.string()); + break; + case 10: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.public_dependency.push(reader.int32()); + } + } else { + message.public_dependency.push(reader.int32()); + } + break; + case 11: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weak_dependency.push(reader.int32()); + } + } else { + message.weak_dependency.push(reader.int32()); + } + break; + case 4: + message.message_type.push( + DescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 5: + message.enum_type.push( + EnumDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 6: + message.service.push( + ServiceDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 7: + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 8: + message.options = FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.source_code_info = SourceCodeInfo.decode( + reader, + reader.uint32() + ); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = String(object.package); + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(String(e)); + } + } + if ( + object.public_dependency !== undefined && + object.public_dependency !== null + ) { + for (const e of object.public_dependency) { + message.public_dependency.push(Number(e)); + } + } + if ( + object.weak_dependency !== undefined && + object.weak_dependency !== null + ) { + for (const e of object.weak_dependency) { + message.weak_dependency.push(Number(e)); + } + } + if (object.message_type !== undefined && object.message_type !== null) { + for (const e of object.message_type) { + message.message_type.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromJSON(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.source_code_info !== undefined && + object.source_code_info !== null + ) { + message.source_code_info = SourceCodeInfo.fromJSON( + object.source_code_info + ); + } else { + message.source_code_info = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = String(object.syntax); + } else { + message.syntax = ""; + } + return message; + }, + + toJSON(message: FileDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.package !== undefined && (obj.package = message.package); + if (message.dependency) { + obj.dependency = message.dependency.map((e) => e); + } else { + obj.dependency = []; + } + if (message.public_dependency) { + obj.public_dependency = message.public_dependency.map((e) => e); + } else { + obj.public_dependency = []; + } + if (message.weak_dependency) { + obj.weak_dependency = message.weak_dependency.map((e) => e); + } else { + obj.weak_dependency = []; + } + if (message.message_type) { + obj.message_type = message.message_type.map((e) => + e ? DescriptorProto.toJSON(e) : undefined + ); + } else { + obj.message_type = []; + } + if (message.enum_type) { + obj.enum_type = message.enum_type.map((e) => + e ? EnumDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.enum_type = []; + } + if (message.service) { + obj.service = message.service.map((e) => + e ? ServiceDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.service = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.extension = []; + } + message.options !== undefined && + (obj.options = message.options + ? FileOptions.toJSON(message.options) + : undefined); + message.source_code_info !== undefined && + (obj.source_code_info = message.source_code_info + ? SourceCodeInfo.toJSON(message.source_code_info) + : undefined); + message.syntax !== undefined && (obj.syntax = message.syntax); + return obj; + }, + + fromPartial(object: DeepPartial): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(e); + } + } + if ( + object.public_dependency !== undefined && + object.public_dependency !== null + ) { + for (const e of object.public_dependency) { + message.public_dependency.push(e); + } + } + if ( + object.weak_dependency !== undefined && + object.weak_dependency !== null + ) { + for (const e of object.weak_dependency) { + message.weak_dependency.push(e); + } + } + if (object.message_type !== undefined && object.message_type !== null) { + for (const e of object.message_type) { + message.message_type.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromPartial(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.source_code_info !== undefined && + object.source_code_info !== null + ) { + message.source_code_info = SourceCodeInfo.fromPartial( + object.source_code_info + ); + } else { + message.source_code_info = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } else { + message.syntax = ""; + } + return message; + }, +}; + +const baseDescriptorProto: object = { name: "", reserved_name: "" }; + +export const DescriptorProto = { + encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nested_type) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enum_type) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extension_range) { + DescriptorProto_ExtensionRange.encode( + v!, + writer.uint32(42).fork() + ).ldelim(); + } + for (const v of message.oneof_decl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reserved_range) { + DescriptorProto_ReservedRange.encode( + v!, + writer.uint32(74).fork() + ).ldelim(); + } + for (const v of message.reserved_name) { + writer.uint32(82).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.field.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 6: + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.nested_type.push( + DescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 4: + message.enum_type.push( + EnumDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 5: + message.extension_range.push( + DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) + ); + break; + case 8: + message.oneof_decl.push( + OneofDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 7: + message.options = MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + message.reserved_range.push( + DescriptorProto_ReservedRange.decode(reader, reader.uint32()) + ); + break; + case 10: + message.reserved_name.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.nested_type !== undefined && object.nested_type !== null) { + for (const e of object.nested_type) { + message.nested_type.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromJSON(e)); + } + } + if ( + object.extension_range !== undefined && + object.extension_range !== null + ) { + for (const e of object.extension_range) { + message.extension_range.push( + DescriptorProto_ExtensionRange.fromJSON(e) + ); + } + } + if (object.oneof_decl !== undefined && object.oneof_decl !== null) { + for (const e of object.oneof_decl) { + message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(String(e)); + } + } + return message; + }, + + toJSON(message: DescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.field) { + obj.field = message.field.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.field = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.extension = []; + } + if (message.nested_type) { + obj.nested_type = message.nested_type.map((e) => + e ? DescriptorProto.toJSON(e) : undefined + ); + } else { + obj.nested_type = []; + } + if (message.enum_type) { + obj.enum_type = message.enum_type.map((e) => + e ? EnumDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.enum_type = []; + } + if (message.extension_range) { + obj.extension_range = message.extension_range.map((e) => + e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined + ); + } else { + obj.extension_range = []; + } + if (message.oneof_decl) { + obj.oneof_decl = message.oneof_decl.map((e) => + e ? OneofDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.oneof_decl = []; + } + message.options !== undefined && + (obj.options = message.options + ? MessageOptions.toJSON(message.options) + : undefined); + if (message.reserved_range) { + obj.reserved_range = message.reserved_range.map((e) => + e ? DescriptorProto_ReservedRange.toJSON(e) : undefined + ); + } else { + obj.reserved_range = []; + } + if (message.reserved_name) { + obj.reserved_name = message.reserved_name.map((e) => e); + } else { + obj.reserved_name = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.nested_type !== undefined && object.nested_type !== null) { + for (const e of object.nested_type) { + message.nested_type.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromPartial(e)); + } + } + if ( + object.extension_range !== undefined && + object.extension_range !== null + ) { + for (const e of object.extension_range) { + message.extension_range.push( + DescriptorProto_ExtensionRange.fromPartial(e) + ); + } + } + if (object.oneof_decl !== undefined && object.oneof_decl !== null) { + for (const e of object.oneof_decl) { + message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + DescriptorProto_ReservedRange.fromPartial(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(e); + } + } + return message; + }, +}; + +const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; + +export const DescriptorProto_ExtensionRange = { + encode( + message: DescriptorProto_ExtensionRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode( + message.options, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): DescriptorProto_ExtensionRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = ExtensionRangeOptions.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ExtensionRange { + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: DescriptorProto_ExtensionRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + message.options !== undefined && + (obj.options = message.options + ? ExtensionRangeOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): DescriptorProto_ExtensionRange { + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; + +export const DescriptorProto_ReservedRange = { + encode( + message: DescriptorProto_ReservedRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): DescriptorProto_ReservedRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ReservedRange { + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: DescriptorProto_ReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): DescriptorProto_ReservedRange { + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +const baseExtensionRangeOptions: object = {}; + +export const ExtensionRangeOptions = { + encode( + message: ExtensionRangeOptions, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ExtensionRangeOptions): unknown { + const obj: any = {}; + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial( + object: DeepPartial + ): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFieldDescriptorProto: object = { + name: "", + number: 0, + label: 1, + type: 1, + type_name: "", + extendee: "", + default_value: "", + oneof_index: 0, + json_name: "", + proto3_optional: false, +}; + +export const FieldDescriptorProto = { + encode( + message: FieldDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.type_name !== "") { + writer.uint32(50).string(message.type_name); + } + if (message.extendee !== "") { + writer.uint32(18).string(message.extendee); + } + if (message.default_value !== "") { + writer.uint32(58).string(message.default_value); + } + if (message.oneof_index !== 0) { + writer.uint32(72).int32(message.oneof_index); + } + if (message.json_name !== "") { + writer.uint32(82).string(message.json_name); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.proto3_optional === true) { + writer.uint32(136).bool(message.proto3_optional); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32() as any; + break; + case 5: + message.type = reader.int32() as any; + break; + case 6: + message.type_name = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.default_value = reader.string(); + break; + case 9: + message.oneof_index = reader.int32(); + break; + case 10: + message.json_name = reader.string(); + break; + case 8: + message.options = FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3_optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = fieldDescriptorProto_LabelFromJSON(object.label); + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = fieldDescriptorProto_TypeFromJSON(object.type); + } else { + message.type = 1; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.type_name = String(object.type_name); + } else { + message.type_name = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = String(object.extendee); + } else { + message.extendee = ""; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.default_value = String(object.default_value); + } else { + message.default_value = ""; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneof_index = Number(object.oneof_index); + } else { + message.oneof_index = 0; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.json_name = String(object.json_name); + } else { + message.json_name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.proto3_optional !== undefined && + object.proto3_optional !== null + ) { + message.proto3_optional = Boolean(object.proto3_optional); + } else { + message.proto3_optional = false; + } + return message; + }, + + toJSON(message: FieldDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.label !== undefined && + (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); + message.type !== undefined && + (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); + message.type_name !== undefined && (obj.type_name = message.type_name); + message.extendee !== undefined && (obj.extendee = message.extendee); + message.default_value !== undefined && + (obj.default_value = message.default_value); + message.oneof_index !== undefined && + (obj.oneof_index = message.oneof_index); + message.json_name !== undefined && (obj.json_name = message.json_name); + message.options !== undefined && + (obj.options = message.options + ? FieldOptions.toJSON(message.options) + : undefined); + message.proto3_optional !== undefined && + (obj.proto3_optional = message.proto3_optional); + return obj; + }, + + fromPartial(object: DeepPartial): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 1; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.type_name = object.type_name; + } else { + message.type_name = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } else { + message.extendee = ""; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.default_value = object.default_value; + } else { + message.default_value = ""; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneof_index = object.oneof_index; + } else { + message.oneof_index = 0; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.json_name = object.json_name; + } else { + message.json_name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.proto3_optional !== undefined && + object.proto3_optional !== null + ) { + message.proto3_optional = object.proto3_optional; + } else { + message.proto3_optional = false; + } + return message; + }, +}; + +const baseOneofDescriptorProto: object = { name: "" }; + +export const OneofDescriptorProto = { + encode( + message: OneofDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: OneofDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.options !== undefined && + (obj.options = message.options + ? OneofOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; + +export const EnumDescriptorProto = { + encode( + message: EnumDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reserved_range) { + EnumDescriptorProto_EnumReservedRange.encode( + v!, + writer.uint32(34).fork() + ).ldelim(); + } + for (const v of message.reserved_name) { + writer.uint32(42).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value.push( + EnumValueDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.options = EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.decode( + reader, + reader.uint32() + ) + ); + break; + case 5: + message.reserved_name.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.fromJSON(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(String(e)); + } + } + return message; + }, + + toJSON(message: EnumDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.value) { + obj.value = message.value.map((e) => + e ? EnumValueDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.value = []; + } + message.options !== undefined && + (obj.options = message.options + ? EnumOptions.toJSON(message.options) + : undefined); + if (message.reserved_range) { + obj.reserved_range = message.reserved_range.map((e) => + e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined + ); + } else { + obj.reserved_range = []; + } + if (message.reserved_name) { + obj.reserved_name = message.reserved_name.map((e) => e); + } else { + obj.reserved_name = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.fromPartial(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(e); + } + } + return message; + }, +}; + +const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; + +export const EnumDescriptorProto_EnumReservedRange = { + encode( + message: EnumDescriptorProto_EnumReservedRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): EnumDescriptorProto_EnumReservedRange { + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; + +export const EnumValueDescriptorProto = { + encode( + message: EnumValueDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode( + message.options, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): EnumValueDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumValueDescriptorProto { + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: EnumValueDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.options !== undefined && + (obj.options = message.options + ? EnumValueOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): EnumValueDescriptorProto { + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseServiceDescriptorProto: object = { name: "" }; + +export const ServiceDescriptorProto = { + encode( + message: ServiceDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.method.push( + MethodDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.options = ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: ServiceDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.method) { + obj.method = message.method.map((e) => + e ? MethodDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.method = []; + } + message.options !== undefined && + (obj.options = message.options + ? ServiceOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseMethodDescriptorProto: object = { + name: "", + input_type: "", + output_type: "", + client_streaming: false, + server_streaming: false, +}; + +export const MethodDescriptorProto = { + encode( + message: MethodDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.input_type !== "") { + writer.uint32(18).string(message.input_type); + } + if (message.output_type !== "") { + writer.uint32(26).string(message.output_type); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + if (message.client_streaming === true) { + writer.uint32(40).bool(message.client_streaming); + } + if (message.server_streaming === true) { + writer.uint32(48).bool(message.server_streaming); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.input_type = reader.string(); + break; + case 3: + message.output_type = reader.string(); + break; + case 4: + message.options = MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.client_streaming = reader.bool(); + break; + case 6: + message.server_streaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.input_type = String(object.input_type); + } else { + message.input_type = ""; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.output_type = String(object.output_type); + } else { + message.output_type = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.client_streaming !== undefined && + object.client_streaming !== null + ) { + message.client_streaming = Boolean(object.client_streaming); + } else { + message.client_streaming = false; + } + if ( + object.server_streaming !== undefined && + object.server_streaming !== null + ) { + message.server_streaming = Boolean(object.server_streaming); + } else { + message.server_streaming = false; + } + return message; + }, + + toJSON(message: MethodDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.input_type !== undefined && (obj.input_type = message.input_type); + message.output_type !== undefined && + (obj.output_type = message.output_type); + message.options !== undefined && + (obj.options = message.options + ? MethodOptions.toJSON(message.options) + : undefined); + message.client_streaming !== undefined && + (obj.client_streaming = message.client_streaming); + message.server_streaming !== undefined && + (obj.server_streaming = message.server_streaming); + return obj; + }, + + fromPartial( + object: DeepPartial + ): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.input_type = object.input_type; + } else { + message.input_type = ""; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.output_type = object.output_type; + } else { + message.output_type = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.client_streaming !== undefined && + object.client_streaming !== null + ) { + message.client_streaming = object.client_streaming; + } else { + message.client_streaming = false; + } + if ( + object.server_streaming !== undefined && + object.server_streaming !== null + ) { + message.server_streaming = object.server_streaming; + } else { + message.server_streaming = false; + } + return message; + }, +}; + +const baseFileOptions: object = { + java_package: "", + java_outer_classname: "", + java_multiple_files: false, + java_generate_equals_and_hash: false, + java_string_check_utf8: false, + optimize_for: 1, + go_package: "", + cc_generic_services: false, + java_generic_services: false, + py_generic_services: false, + php_generic_services: false, + deprecated: false, + cc_enable_arenas: false, + objc_class_prefix: "", + csharp_namespace: "", + swift_prefix: "", + php_class_prefix: "", + php_namespace: "", + php_metadata_namespace: "", + ruby_package: "", +}; + +export const FileOptions = { + encode(message: FileOptions, writer: Writer = Writer.create()): Writer { + if (message.java_package !== "") { + writer.uint32(10).string(message.java_package); + } + if (message.java_outer_classname !== "") { + writer.uint32(66).string(message.java_outer_classname); + } + if (message.java_multiple_files === true) { + writer.uint32(80).bool(message.java_multiple_files); + } + if (message.java_generate_equals_and_hash === true) { + writer.uint32(160).bool(message.java_generate_equals_and_hash); + } + if (message.java_string_check_utf8 === true) { + writer.uint32(216).bool(message.java_string_check_utf8); + } + if (message.optimize_for !== 1) { + writer.uint32(72).int32(message.optimize_for); + } + if (message.go_package !== "") { + writer.uint32(90).string(message.go_package); + } + if (message.cc_generic_services === true) { + writer.uint32(128).bool(message.cc_generic_services); + } + if (message.java_generic_services === true) { + writer.uint32(136).bool(message.java_generic_services); + } + if (message.py_generic_services === true) { + writer.uint32(144).bool(message.py_generic_services); + } + if (message.php_generic_services === true) { + writer.uint32(336).bool(message.php_generic_services); + } + if (message.deprecated === true) { + writer.uint32(184).bool(message.deprecated); + } + if (message.cc_enable_arenas === true) { + writer.uint32(248).bool(message.cc_enable_arenas); + } + if (message.objc_class_prefix !== "") { + writer.uint32(290).string(message.objc_class_prefix); + } + if (message.csharp_namespace !== "") { + writer.uint32(298).string(message.csharp_namespace); + } + if (message.swift_prefix !== "") { + writer.uint32(314).string(message.swift_prefix); + } + if (message.php_class_prefix !== "") { + writer.uint32(322).string(message.php_class_prefix); + } + if (message.php_namespace !== "") { + writer.uint32(330).string(message.php_namespace); + } + if (message.php_metadata_namespace !== "") { + writer.uint32(354).string(message.php_metadata_namespace); + } + if (message.ruby_package !== "") { + writer.uint32(362).string(message.ruby_package); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.java_package = reader.string(); + break; + case 8: + message.java_outer_classname = reader.string(); + break; + case 10: + message.java_multiple_files = reader.bool(); + break; + case 20: + message.java_generate_equals_and_hash = reader.bool(); + break; + case 27: + message.java_string_check_utf8 = reader.bool(); + break; + case 9: + message.optimize_for = reader.int32() as any; + break; + case 11: + message.go_package = reader.string(); + break; + case 16: + message.cc_generic_services = reader.bool(); + break; + case 17: + message.java_generic_services = reader.bool(); + break; + case 18: + message.py_generic_services = reader.bool(); + break; + case 42: + message.php_generic_services = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.cc_enable_arenas = reader.bool(); + break; + case 36: + message.objc_class_prefix = reader.string(); + break; + case 37: + message.csharp_namespace = reader.string(); + break; + case 39: + message.swift_prefix = reader.string(); + break; + case 40: + message.php_class_prefix = reader.string(); + break; + case 41: + message.php_namespace = reader.string(); + break; + case 44: + message.php_metadata_namespace = reader.string(); + break; + case 45: + message.ruby_package = reader.string(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + if (object.java_package !== undefined && object.java_package !== null) { + message.java_package = String(object.java_package); + } else { + message.java_package = ""; + } + if ( + object.java_outer_classname !== undefined && + object.java_outer_classname !== null + ) { + message.java_outer_classname = String(object.java_outer_classname); + } else { + message.java_outer_classname = ""; + } + if ( + object.java_multiple_files !== undefined && + object.java_multiple_files !== null + ) { + message.java_multiple_files = Boolean(object.java_multiple_files); + } else { + message.java_multiple_files = false; + } + if ( + object.java_generate_equals_and_hash !== undefined && + object.java_generate_equals_and_hash !== null + ) { + message.java_generate_equals_and_hash = Boolean( + object.java_generate_equals_and_hash + ); + } else { + message.java_generate_equals_and_hash = false; + } + if ( + object.java_string_check_utf8 !== undefined && + object.java_string_check_utf8 !== null + ) { + message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); + } else { + message.java_string_check_utf8 = false; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimize_for = fileOptions_OptimizeModeFromJSON( + object.optimize_for + ); + } else { + message.optimize_for = 1; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.go_package = String(object.go_package); + } else { + message.go_package = ""; + } + if ( + object.cc_generic_services !== undefined && + object.cc_generic_services !== null + ) { + message.cc_generic_services = Boolean(object.cc_generic_services); + } else { + message.cc_generic_services = false; + } + if ( + object.java_generic_services !== undefined && + object.java_generic_services !== null + ) { + message.java_generic_services = Boolean(object.java_generic_services); + } else { + message.java_generic_services = false; + } + if ( + object.py_generic_services !== undefined && + object.py_generic_services !== null + ) { + message.py_generic_services = Boolean(object.py_generic_services); + } else { + message.py_generic_services = false; + } + if ( + object.php_generic_services !== undefined && + object.php_generic_services !== null + ) { + message.php_generic_services = Boolean(object.php_generic_services); + } else { + message.php_generic_services = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.cc_enable_arenas !== undefined && + object.cc_enable_arenas !== null + ) { + message.cc_enable_arenas = Boolean(object.cc_enable_arenas); + } else { + message.cc_enable_arenas = false; + } + if ( + object.objc_class_prefix !== undefined && + object.objc_class_prefix !== null + ) { + message.objc_class_prefix = String(object.objc_class_prefix); + } else { + message.objc_class_prefix = ""; + } + if ( + object.csharp_namespace !== undefined && + object.csharp_namespace !== null + ) { + message.csharp_namespace = String(object.csharp_namespace); + } else { + message.csharp_namespace = ""; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swift_prefix = String(object.swift_prefix); + } else { + message.swift_prefix = ""; + } + if ( + object.php_class_prefix !== undefined && + object.php_class_prefix !== null + ) { + message.php_class_prefix = String(object.php_class_prefix); + } else { + message.php_class_prefix = ""; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.php_namespace = String(object.php_namespace); + } else { + message.php_namespace = ""; + } + if ( + object.php_metadata_namespace !== undefined && + object.php_metadata_namespace !== null + ) { + message.php_metadata_namespace = String(object.php_metadata_namespace); + } else { + message.php_metadata_namespace = ""; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.ruby_package = String(object.ruby_package); + } else { + message.ruby_package = ""; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FileOptions): unknown { + const obj: any = {}; + message.java_package !== undefined && + (obj.java_package = message.java_package); + message.java_outer_classname !== undefined && + (obj.java_outer_classname = message.java_outer_classname); + message.java_multiple_files !== undefined && + (obj.java_multiple_files = message.java_multiple_files); + message.java_generate_equals_and_hash !== undefined && + (obj.java_generate_equals_and_hash = + message.java_generate_equals_and_hash); + message.java_string_check_utf8 !== undefined && + (obj.java_string_check_utf8 = message.java_string_check_utf8); + message.optimize_for !== undefined && + (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); + message.go_package !== undefined && (obj.go_package = message.go_package); + message.cc_generic_services !== undefined && + (obj.cc_generic_services = message.cc_generic_services); + message.java_generic_services !== undefined && + (obj.java_generic_services = message.java_generic_services); + message.py_generic_services !== undefined && + (obj.py_generic_services = message.py_generic_services); + message.php_generic_services !== undefined && + (obj.php_generic_services = message.php_generic_services); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.cc_enable_arenas !== undefined && + (obj.cc_enable_arenas = message.cc_enable_arenas); + message.objc_class_prefix !== undefined && + (obj.objc_class_prefix = message.objc_class_prefix); + message.csharp_namespace !== undefined && + (obj.csharp_namespace = message.csharp_namespace); + message.swift_prefix !== undefined && + (obj.swift_prefix = message.swift_prefix); + message.php_class_prefix !== undefined && + (obj.php_class_prefix = message.php_class_prefix); + message.php_namespace !== undefined && + (obj.php_namespace = message.php_namespace); + message.php_metadata_namespace !== undefined && + (obj.php_metadata_namespace = message.php_metadata_namespace); + message.ruby_package !== undefined && + (obj.ruby_package = message.ruby_package); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + if (object.java_package !== undefined && object.java_package !== null) { + message.java_package = object.java_package; + } else { + message.java_package = ""; + } + if ( + object.java_outer_classname !== undefined && + object.java_outer_classname !== null + ) { + message.java_outer_classname = object.java_outer_classname; + } else { + message.java_outer_classname = ""; + } + if ( + object.java_multiple_files !== undefined && + object.java_multiple_files !== null + ) { + message.java_multiple_files = object.java_multiple_files; + } else { + message.java_multiple_files = false; + } + if ( + object.java_generate_equals_and_hash !== undefined && + object.java_generate_equals_and_hash !== null + ) { + message.java_generate_equals_and_hash = + object.java_generate_equals_and_hash; + } else { + message.java_generate_equals_and_hash = false; + } + if ( + object.java_string_check_utf8 !== undefined && + object.java_string_check_utf8 !== null + ) { + message.java_string_check_utf8 = object.java_string_check_utf8; + } else { + message.java_string_check_utf8 = false; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimize_for = object.optimize_for; + } else { + message.optimize_for = 1; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.go_package = object.go_package; + } else { + message.go_package = ""; + } + if ( + object.cc_generic_services !== undefined && + object.cc_generic_services !== null + ) { + message.cc_generic_services = object.cc_generic_services; + } else { + message.cc_generic_services = false; + } + if ( + object.java_generic_services !== undefined && + object.java_generic_services !== null + ) { + message.java_generic_services = object.java_generic_services; + } else { + message.java_generic_services = false; + } + if ( + object.py_generic_services !== undefined && + object.py_generic_services !== null + ) { + message.py_generic_services = object.py_generic_services; + } else { + message.py_generic_services = false; + } + if ( + object.php_generic_services !== undefined && + object.php_generic_services !== null + ) { + message.php_generic_services = object.php_generic_services; + } else { + message.php_generic_services = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.cc_enable_arenas !== undefined && + object.cc_enable_arenas !== null + ) { + message.cc_enable_arenas = object.cc_enable_arenas; + } else { + message.cc_enable_arenas = false; + } + if ( + object.objc_class_prefix !== undefined && + object.objc_class_prefix !== null + ) { + message.objc_class_prefix = object.objc_class_prefix; + } else { + message.objc_class_prefix = ""; + } + if ( + object.csharp_namespace !== undefined && + object.csharp_namespace !== null + ) { + message.csharp_namespace = object.csharp_namespace; + } else { + message.csharp_namespace = ""; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swift_prefix = object.swift_prefix; + } else { + message.swift_prefix = ""; + } + if ( + object.php_class_prefix !== undefined && + object.php_class_prefix !== null + ) { + message.php_class_prefix = object.php_class_prefix; + } else { + message.php_class_prefix = ""; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.php_namespace = object.php_namespace; + } else { + message.php_namespace = ""; + } + if ( + object.php_metadata_namespace !== undefined && + object.php_metadata_namespace !== null + ) { + message.php_metadata_namespace = object.php_metadata_namespace; + } else { + message.php_metadata_namespace = ""; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.ruby_package = object.ruby_package; + } else { + message.ruby_package = ""; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMessageOptions: object = { + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + deprecated: false, + map_entry: false, +}; + +export const MessageOptions = { + encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { + if (message.message_set_wire_format === true) { + writer.uint32(8).bool(message.message_set_wire_format); + } + if (message.no_standard_descriptor_accessor === true) { + writer.uint32(16).bool(message.no_standard_descriptor_accessor); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.map_entry === true) { + writer.uint32(56).bool(message.map_entry); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message_set_wire_format = reader.bool(); + break; + case 2: + message.no_standard_descriptor_accessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.map_entry = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + if ( + object.message_set_wire_format !== undefined && + object.message_set_wire_format !== null + ) { + message.message_set_wire_format = Boolean(object.message_set_wire_format); + } else { + message.message_set_wire_format = false; + } + if ( + object.no_standard_descriptor_accessor !== undefined && + object.no_standard_descriptor_accessor !== null + ) { + message.no_standard_descriptor_accessor = Boolean( + object.no_standard_descriptor_accessor + ); + } else { + message.no_standard_descriptor_accessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.map_entry = Boolean(object.map_entry); + } else { + message.map_entry = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MessageOptions): unknown { + const obj: any = {}; + message.message_set_wire_format !== undefined && + (obj.message_set_wire_format = message.message_set_wire_format); + message.no_standard_descriptor_accessor !== undefined && + (obj.no_standard_descriptor_accessor = + message.no_standard_descriptor_accessor); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.map_entry !== undefined && (obj.map_entry = message.map_entry); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + if ( + object.message_set_wire_format !== undefined && + object.message_set_wire_format !== null + ) { + message.message_set_wire_format = object.message_set_wire_format; + } else { + message.message_set_wire_format = false; + } + if ( + object.no_standard_descriptor_accessor !== undefined && + object.no_standard_descriptor_accessor !== null + ) { + message.no_standard_descriptor_accessor = + object.no_standard_descriptor_accessor; + } else { + message.no_standard_descriptor_accessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.map_entry = object.map_entry; + } else { + message.map_entry = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFieldOptions: object = { + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + deprecated: false, + weak: false, +}; + +export const FieldOptions = { + encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + if (message.ctype !== 0) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed === true) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== 0) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy === true) { + writer.uint32(40).bool(message.lazy); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak === true) { + writer.uint32(80).bool(message.weak); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32() as any; + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32() as any; + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = fieldOptions_CTypeFromJSON(object.ctype); + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = Boolean(object.packed); + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = Boolean(object.lazy); + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = Boolean(object.weak); + } else { + message.weak = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FieldOptions): unknown { + const obj: any = {}; + message.ctype !== undefined && + (obj.ctype = fieldOptions_CTypeToJSON(message.ctype)); + message.packed !== undefined && (obj.packed = message.packed); + message.jstype !== undefined && + (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); + message.lazy !== undefined && (obj.lazy = message.lazy); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.weak !== undefined && (obj.weak = message.weak); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = object.ctype; + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = object.jstype; + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } else { + message.weak = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseOneofOptions: object = {}; + +export const OneofOptions = { + encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: OneofOptions): unknown { + const obj: any = {}; + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseEnumOptions: object = { allow_alias: false, deprecated: false }; + +export const EnumOptions = { + encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { + if (message.allow_alias === true) { + writer.uint32(16).bool(message.allow_alias); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allow_alias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allow_alias = Boolean(object.allow_alias); + } else { + message.allow_alias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: EnumOptions): unknown { + const obj: any = {}; + message.allow_alias !== undefined && + (obj.allow_alias = message.allow_alias); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allow_alias = object.allow_alias; + } else { + message.allow_alias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseEnumValueOptions: object = { deprecated: false }; + +export const EnumValueOptions = { + encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(8).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: EnumValueOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseServiceOptions: object = { deprecated: false }; + +export const ServiceOptions = { + encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ServiceOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; + +export const MethodOptions = { + encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + if (message.idempotency_level !== 0) { + writer.uint32(272).int32(message.idempotency_level); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotency_level = reader.int32() as any; + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.idempotency_level !== undefined && + object.idempotency_level !== null + ) { + message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( + object.idempotency_level + ); + } else { + message.idempotency_level = 0; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MethodOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.idempotency_level !== undefined && + (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( + message.idempotency_level + )); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.idempotency_level !== undefined && + object.idempotency_level !== null + ) { + message.idempotency_level = object.idempotency_level; + } else { + message.idempotency_level = 0; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseUninterpretedOption: object = { + identifier_value: "", + positive_int_value: 0, + negative_int_value: 0, + double_value: 0, + aggregate_value: "", +}; + +export const UninterpretedOption = { + encode( + message: UninterpretedOption, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.name) { + UninterpretedOption_NamePart.encode( + v!, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.identifier_value !== "") { + writer.uint32(26).string(message.identifier_value); + } + if (message.positive_int_value !== 0) { + writer.uint32(32).uint64(message.positive_int_value); + } + if (message.negative_int_value !== 0) { + writer.uint32(40).int64(message.negative_int_value); + } + if (message.double_value !== 0) { + writer.uint32(49).double(message.double_value); + } + if (message.string_value.length !== 0) { + writer.uint32(58).bytes(message.string_value); + } + if (message.aggregate_value !== "") { + writer.uint32(66).string(message.aggregate_value); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.name.push( + UninterpretedOption_NamePart.decode(reader, reader.uint32()) + ); + break; + case 3: + message.identifier_value = reader.string(); + break; + case 4: + message.positive_int_value = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negative_int_value = longToNumber(reader.int64() as Long); + break; + case 6: + message.double_value = reader.double(); + break; + case 7: + message.string_value = reader.bytes(); + break; + case 8: + message.aggregate_value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromJSON(e)); + } + } + if ( + object.identifier_value !== undefined && + object.identifier_value !== null + ) { + message.identifier_value = String(object.identifier_value); + } else { + message.identifier_value = ""; + } + if ( + object.positive_int_value !== undefined && + object.positive_int_value !== null + ) { + message.positive_int_value = Number(object.positive_int_value); + } else { + message.positive_int_value = 0; + } + if ( + object.negative_int_value !== undefined && + object.negative_int_value !== null + ) { + message.negative_int_value = Number(object.negative_int_value); + } else { + message.negative_int_value = 0; + } + if (object.double_value !== undefined && object.double_value !== null) { + message.double_value = Number(object.double_value); + } else { + message.double_value = 0; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.string_value = bytesFromBase64(object.string_value); + } + if ( + object.aggregate_value !== undefined && + object.aggregate_value !== null + ) { + message.aggregate_value = String(object.aggregate_value); + } else { + message.aggregate_value = ""; + } + return message; + }, + + toJSON(message: UninterpretedOption): unknown { + const obj: any = {}; + if (message.name) { + obj.name = message.name.map((e) => + e ? UninterpretedOption_NamePart.toJSON(e) : undefined + ); + } else { + obj.name = []; + } + message.identifier_value !== undefined && + (obj.identifier_value = message.identifier_value); + message.positive_int_value !== undefined && + (obj.positive_int_value = message.positive_int_value); + message.negative_int_value !== undefined && + (obj.negative_int_value = message.negative_int_value); + message.double_value !== undefined && + (obj.double_value = message.double_value); + message.string_value !== undefined && + (obj.string_value = base64FromBytes( + message.string_value !== undefined + ? message.string_value + : new Uint8Array() + )); + message.aggregate_value !== undefined && + (obj.aggregate_value = message.aggregate_value); + return obj; + }, + + fromPartial(object: DeepPartial): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromPartial(e)); + } + } + if ( + object.identifier_value !== undefined && + object.identifier_value !== null + ) { + message.identifier_value = object.identifier_value; + } else { + message.identifier_value = ""; + } + if ( + object.positive_int_value !== undefined && + object.positive_int_value !== null + ) { + message.positive_int_value = object.positive_int_value; + } else { + message.positive_int_value = 0; + } + if ( + object.negative_int_value !== undefined && + object.negative_int_value !== null + ) { + message.negative_int_value = object.negative_int_value; + } else { + message.negative_int_value = 0; + } + if (object.double_value !== undefined && object.double_value !== null) { + message.double_value = object.double_value; + } else { + message.double_value = 0; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.string_value = object.string_value; + } else { + message.string_value = new Uint8Array(); + } + if ( + object.aggregate_value !== undefined && + object.aggregate_value !== null + ) { + message.aggregate_value = object.aggregate_value; + } else { + message.aggregate_value = ""; + } + return message; + }, +}; + +const baseUninterpretedOption_NamePart: object = { + name_part: "", + is_extension: false, +}; + +export const UninterpretedOption_NamePart = { + encode( + message: UninterpretedOption_NamePart, + writer: Writer = Writer.create() + ): Writer { + if (message.name_part !== "") { + writer.uint32(10).string(message.name_part); + } + if (message.is_extension === true) { + writer.uint32(16).bool(message.is_extension); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): UninterpretedOption_NamePart { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name_part = reader.string(); + break; + case 2: + message.is_extension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninterpretedOption_NamePart { + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + if (object.name_part !== undefined && object.name_part !== null) { + message.name_part = String(object.name_part); + } else { + message.name_part = ""; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.is_extension = Boolean(object.is_extension); + } else { + message.is_extension = false; + } + return message; + }, + + toJSON(message: UninterpretedOption_NamePart): unknown { + const obj: any = {}; + message.name_part !== undefined && (obj.name_part = message.name_part); + message.is_extension !== undefined && + (obj.is_extension = message.is_extension); + return obj; + }, + + fromPartial( + object: DeepPartial + ): UninterpretedOption_NamePart { + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + if (object.name_part !== undefined && object.name_part !== null) { + message.name_part = object.name_part; + } else { + message.name_part = ""; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.is_extension = object.is_extension; + } else { + message.is_extension = false; + } + return message; + }, +}; + +const baseSourceCodeInfo: object = {}; + +export const SourceCodeInfo = { + encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location.push( + SourceCodeInfo_Location.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: SourceCodeInfo): unknown { + const obj: any = {}; + if (message.location) { + obj.location = message.location.map((e) => + e ? SourceCodeInfo_Location.toJSON(e) : undefined + ); + } else { + obj.location = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromPartial(e)); + } + } + return message; + }, +}; + +const baseSourceCodeInfo_Location: object = { + path: 0, + span: 0, + leading_comments: "", + trailing_comments: "", + leading_detached_comments: "", +}; + +export const SourceCodeInfo_Location = { + encode( + message: SourceCodeInfo_Location, + writer: Writer = Writer.create() + ): Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + if (message.leading_comments !== "") { + writer.uint32(26).string(message.leading_comments); + } + if (message.trailing_comments !== "") { + writer.uint32(34).string(message.trailing_comments); + } + for (const v of message.leading_detached_comments) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + } else { + message.span.push(reader.int32()); + } + break; + case 3: + message.leading_comments = reader.string(); + break; + case 4: + message.trailing_comments = reader.string(); + break; + case 6: + message.leading_detached_comments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo_Location { + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(Number(e)); + } + } + if ( + object.leading_comments !== undefined && + object.leading_comments !== null + ) { + message.leading_comments = String(object.leading_comments); + } else { + message.leading_comments = ""; + } + if ( + object.trailing_comments !== undefined && + object.trailing_comments !== null + ) { + message.trailing_comments = String(object.trailing_comments); + } else { + message.trailing_comments = ""; + } + if ( + object.leading_detached_comments !== undefined && + object.leading_detached_comments !== null + ) { + for (const e of object.leading_detached_comments) { + message.leading_detached_comments.push(String(e)); + } + } + return message; + }, + + toJSON(message: SourceCodeInfo_Location): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + if (message.span) { + obj.span = message.span.map((e) => e); + } else { + obj.span = []; + } + message.leading_comments !== undefined && + (obj.leading_comments = message.leading_comments); + message.trailing_comments !== undefined && + (obj.trailing_comments = message.trailing_comments); + if (message.leading_detached_comments) { + obj.leading_detached_comments = message.leading_detached_comments.map( + (e) => e + ); + } else { + obj.leading_detached_comments = []; + } + return obj; + }, + + fromPartial( + object: DeepPartial + ): SourceCodeInfo_Location { + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(e); + } + } + if ( + object.leading_comments !== undefined && + object.leading_comments !== null + ) { + message.leading_comments = object.leading_comments; + } else { + message.leading_comments = ""; + } + if ( + object.trailing_comments !== undefined && + object.trailing_comments !== null + ) { + message.trailing_comments = object.trailing_comments; + } else { + message.trailing_comments = ""; + } + if ( + object.leading_detached_comments !== undefined && + object.leading_detached_comments !== null + ) { + for (const e of object.leading_detached_comments) { + message.leading_detached_comments.push(e); + } + } + return message; + }, +}; + +const baseGeneratedCodeInfo: object = {}; + +export const GeneratedCodeInfo = { + encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode( + v!, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annotation.push( + GeneratedCodeInfo_Annotation.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: GeneratedCodeInfo): unknown { + const obj: any = {}; + if (message.annotation) { + obj.annotation = message.annotation.map((e) => + e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined + ); + } else { + obj.annotation = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); + } + } + return message; + }, +}; + +const baseGeneratedCodeInfo_Annotation: object = { + path: 0, + source_file: "", + begin: 0, + end: 0, +}; + +export const GeneratedCodeInfo_Annotation = { + encode( + message: GeneratedCodeInfo_Annotation, + writer: Writer = Writer.create() + ): Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + if (message.source_file !== "") { + writer.uint32(18).string(message.source_file); + } + if (message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== 0) { + writer.uint32(32).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): GeneratedCodeInfo_Annotation { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + message.source_file = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo_Annotation { + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.source_file !== undefined && object.source_file !== null) { + message.source_file = String(object.source_file); + } else { + message.source_file = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = Number(object.begin); + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: GeneratedCodeInfo_Annotation): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + message.source_file !== undefined && + (obj.source_file = message.source_file); + message.begin !== undefined && (obj.begin = message.begin); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): GeneratedCodeInfo_Annotation { + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.source_file !== undefined && object.source_file !== null) { + message.source_file = object.source_file; + } else { + message.source_file = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/package.json b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/package.json new file mode 100755 index 00000000..9174875d --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/package.json @@ -0,0 +1,18 @@ +{ + "name": "bzealphateam-bze-burner-js", + "version": "0.1.0", + "description": "Autogenerated vuex store for Cosmos module bzealphateam.bze.burner", + "author": "Starport Codegen ", + "homepage": "http://github.com/bze-alphateam/bze/x/burner/types", + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "main": "index.js", + "publishConfig": { + "access": "public" + } +} \ No newline at end of file diff --git a/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/vuex-root b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/vuex-root new file mode 100755 index 00000000..0fcc121a --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bzealphateam.bze.burner/vuex-root @@ -0,0 +1 @@ +THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/index.ts b/vue/src/store/generated/index.ts index c4ddf6bd..69aa8028 100755 --- a/vue/src/store/generated/index.ts +++ b/vue/src/store/generated/index.ts @@ -2,6 +2,7 @@ import BzeAlphateamBzeBzeCointrunk from './bze-alphateam/bze/bze.cointrunk' import BzeAlphateamBzeBzeScavenge from './bze-alphateam/bze/bze.scavenge' +import BzeAlphateamBzeBzealphateamBzeBurner from './bze-alphateam/bze/bzealphateam.bze.burner' import BzeAlphateamBzeBzealphateamBzeCointrunk from './bze-alphateam/bze/bzealphateam.bze.cointrunk' import CosmosCosmosSdkCosmosAuthzV1Beta1 from './cosmos/cosmos-sdk/cosmos.authz.v1beta1' import CosmosCosmosSdkCosmosBankV1Beta1 from './cosmos/cosmos-sdk/cosmos.bank.v1beta1' @@ -19,6 +20,7 @@ import CosmosIbcGoIbcApplicationsTransferV1 from './cosmos/ibc-go/ibc.applicatio export default { BzeAlphateamBzeBzeCointrunk: load(BzeAlphateamBzeBzeCointrunk, 'bze.cointrunk'), BzeAlphateamBzeBzeScavenge: load(BzeAlphateamBzeBzeScavenge, 'bze.scavenge'), + BzeAlphateamBzeBzealphateamBzeBurner: load(BzeAlphateamBzeBzealphateamBzeBurner, 'bzealphateam.bze.burner'), BzeAlphateamBzeBzealphateamBzeCointrunk: load(BzeAlphateamBzeBzealphateamBzeCointrunk, 'bzealphateam.bze.cointrunk'), CosmosCosmosSdkCosmosAuthzV1Beta1: load(CosmosCosmosSdkCosmosAuthzV1Beta1, 'cosmos.authz.v1beta1'), CosmosCosmosSdkCosmosBankV1Beta1: load(CosmosCosmosSdkCosmosBankV1Beta1, 'cosmos.bank.v1beta1'), diff --git a/x/burner/client/cli/query.go b/x/burner/client/cli/query.go new file mode 100644 index 00000000..9805ca60 --- /dev/null +++ b/x/burner/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/bze-alphateam/bze/x/burner/types" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd(queryRoute string) *cobra.Command { + // Group burner 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/burner/client/cli/query_params.go b/x/burner/client/cli/query_params.go new file mode 100644 index 00000000..b9318d87 --- /dev/null +++ b/x/burner/client/cli/query_params.go @@ -0,0 +1,34 @@ +package cli + +import ( + "context" + + "github.com/bze-alphateam/bze/x/burner/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" +) + +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 := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/burner/client/cli/tx.go b/x/burner/client/cli/tx.go new file mode 100644 index 00000000..62bf9e5d --- /dev/null +++ b/x/burner/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/bze-alphateam/bze/x/burner/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/burner/genesis.go b/x/burner/genesis.go new file mode 100644 index 00000000..732c52b1 --- /dev/null +++ b/x/burner/genesis.go @@ -0,0 +1,24 @@ +package burner + +import ( + "github.com/bze-alphateam/bze/x/burner/keeper" + "github.com/bze-alphateam/bze/x/burner/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// InitGenesis initializes the capability 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 capability 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/burner/genesis_test.go b/x/burner/genesis_test.go new file mode 100644 index 00000000..ced4bc30 --- /dev/null +++ b/x/burner/genesis_test.go @@ -0,0 +1,29 @@ +package burner_test + +import ( + "testing" + + keepertest "github.com/bze-alphateam/bze/testutil/keeper" + "github.com/bze-alphateam/bze/testutil/nullify" + "github.com/bze-alphateam/bze/x/burner" + "github.com/bze-alphateam/bze/x/burner/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.BurnerKeeper(t) + burner.InitGenesis(ctx, *k, genesisState) + got := burner.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/burner/handler.go b/x/burner/handler.go new file mode 100644 index 00000000..bf58a2ea --- /dev/null +++ b/x/burner/handler.go @@ -0,0 +1,26 @@ +package burner + +import ( + "fmt" + + "github.com/bze-alphateam/bze/x/burner/keeper" + "github.com/bze-alphateam/bze/x/burner/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// NewHandler ... +func NewHandler(k keeper.Keeper) sdk.Handler { + // this line is used by starport scaffolding # handler/msgServer + + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { + ctx = ctx.WithEventManager(sdk.NewEventManager()) + + switch msg := msg.(type) { + // this line is used by starport scaffolding # 1 + default: + errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + } + } +} diff --git a/x/burner/keeper/grpc_query.go b/x/burner/keeper/grpc_query.go new file mode 100644 index 00000000..e817cd8a --- /dev/null +++ b/x/burner/keeper/grpc_query.go @@ -0,0 +1,7 @@ +package keeper + +import ( + "github.com/bze-alphateam/bze/x/burner/types" +) + +var _ types.QueryServer = Keeper{} diff --git a/x/burner/keeper/grpc_query_params.go b/x/burner/keeper/grpc_query_params.go new file mode 100644 index 00000000..52671fe1 --- /dev/null +++ b/x/burner/keeper/grpc_query_params.go @@ -0,0 +1,19 @@ +package keeper + +import ( + "context" + + "github.com/bze-alphateam/bze/x/burner/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} diff --git a/x/burner/keeper/grpc_query_params_test.go b/x/burner/keeper/grpc_query_params_test.go new file mode 100644 index 00000000..c2a07ece --- /dev/null +++ b/x/burner/keeper/grpc_query_params_test.go @@ -0,0 +1,21 @@ +package keeper_test + +import ( + "testing" + + testkeeper "github.com/bze-alphateam/bze/testutil/keeper" + "github.com/bze-alphateam/bze/x/burner/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +func TestParamsQuery(t *testing.T) { + keeper, ctx := testkeeper.BurnerKeeper(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/burner/keeper/keeper.go b/x/burner/keeper/keeper.go new file mode 100644 index 00000000..976aea2a --- /dev/null +++ b/x/burner/keeper/keeper.go @@ -0,0 +1,53 @@ +package keeper + +import ( + "fmt" + + "github.com/tendermint/tendermint/libs/log" + + "github.com/bze-alphateam/bze/x/burner/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +type ( + Keeper struct { + cdc codec.BinaryCodec + storeKey sdk.StoreKey + memKey sdk.StoreKey + paramstore paramtypes.Subspace + + bankKeeper types.BankKeeper + accKeeper types.AccountKeeper + } +) + +func NewKeeper( + cdc codec.BinaryCodec, + storeKey, + memKey sdk.StoreKey, + ps paramtypes.Subspace, + + bankKeeper types.BankKeeper, + accKeeper types.AccountKeeper, +) *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, + bankKeeper: bankKeeper, + accKeeper: accKeeper, + } +} + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} diff --git a/x/burner/keeper/msg_server.go b/x/burner/keeper/msg_server.go new file mode 100644 index 00000000..edae7402 --- /dev/null +++ b/x/burner/keeper/msg_server.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/bze-alphateam/bze/x/burner/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/burner/keeper/msg_server_test.go b/x/burner/keeper/msg_server_test.go new file mode 100644 index 00000000..20f4abc9 --- /dev/null +++ b/x/burner/keeper/msg_server_test.go @@ -0,0 +1,16 @@ +package keeper_test + +import ( + "context" + "testing" + + keepertest "github.com/bze-alphateam/bze/testutil/keeper" + "github.com/bze-alphateam/bze/x/burner/keeper" + "github.com/bze-alphateam/bze/x/burner/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { + k, ctx := keepertest.BurnerKeeper(t) + return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) +} diff --git a/x/burner/keeper/params.go b/x/burner/keeper/params.go new file mode 100644 index 00000000..ab10af6d --- /dev/null +++ b/x/burner/keeper/params.go @@ -0,0 +1,16 @@ +package keeper + +import ( + "github.com/bze-alphateam/bze/x/burner/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/burner/keeper/params_test.go b/x/burner/keeper/params_test.go new file mode 100644 index 00000000..01cd2fce --- /dev/null +++ b/x/burner/keeper/params_test.go @@ -0,0 +1,18 @@ +package keeper_test + +import ( + "testing" + + testkeeper "github.com/bze-alphateam/bze/testutil/keeper" + "github.com/bze-alphateam/bze/x/burner/types" + "github.com/stretchr/testify/require" +) + +func TestGetParams(t *testing.T) { + k, ctx := testkeeper.BurnerKeeper(t) + params := types.DefaultParams() + + k.SetParams(ctx, params) + + require.EqualValues(t, params, k.GetParams(ctx)) +} diff --git a/x/burner/module.go b/x/burner/module.go new file mode 100644 index 00000000..f784407b --- /dev/null +++ b/x/burner/module.go @@ -0,0 +1,175 @@ +package burner + +import ( + "encoding/json" + "fmt" + // this line is used by starport scaffolding # 1 + + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/tendermint/tendermint/abci/types" + + "github.com/bze-alphateam/bze/x/burner/client/cli" + "github.com/bze-alphateam/bze/x/burner/keeper" + "github.com/bze-alphateam/bze/x/burner/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 for the capability module. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the capability module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +// RegisterInterfaces registers the module's interface types +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns the capability module's default genesis state. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis performs genesis state validation for the capability module. +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() +} + +// RegisterRESTRoutes registers the capability module's REST service handlers. +func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + // this line is used by starport scaffolding # 2 +} + +// GetTxCmd returns the capability module's root tx command. +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the capability module's root query command. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd(types.StoreKey) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface for the capability module. +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, + } +} + +// Name returns the capability module's name. +func (am AppModule) Name() string { + return am.AppModuleBasic.Name() +} + +// Route returns the capability module's message routing key. +func (am AppModule) Route() sdk.Route { + return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) +} + +// QuerierRoute returns the capability module's query routing key. +func (AppModule) QuerierRoute() string { return types.QuerierRoute } + +// LegacyQuerierHandler returns the capability module's Querier. +func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { + return nil +} + +// RegisterServices registers a GRPC query service to respond to the +// module-specific GRPC queries. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the capability module's invariants. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the capability 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 capability 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 implements ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 2 } + +// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. +func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} + +// EndBlock executes all ABCI EndBlock logic respective to the capability module. It +// returns no validator updates. +func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} diff --git a/x/burner/module_simulation.go b/x/burner/module_simulation.go new file mode 100644 index 00000000..a288587b --- /dev/null +++ b/x/burner/module_simulation.go @@ -0,0 +1,64 @@ +package burner + +import ( + "math/rand" + + "github.com/bze-alphateam/bze/testutil/sample" + burnersimulation "github.com/bze-alphateam/bze/x/burner/simulation" + "github.com/bze-alphateam/bze/x/burner/types" + "github.com/cosmos/cosmos-sdk/baseapp" + simappparams "github.com/cosmos/cosmos-sdk/simapp/params" + 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 + _ = burnersimulation.FindAccount + _ = simappparams.StakePerAccount + _ = simulation.MsgEntryKind + _ = baseapp.Paramspace +) + +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() + } + burnerGenesis := types.GenesisState{ + Params: types.DefaultParams(), + // this line is used by starport scaffolding # simapp/module/genesisState + } + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&burnerGenesis) +} + +// ProposalContents doesn't return any content functions for governance proposals +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// RandomizedParams creates randomized param changes for the simulator +func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { + + return []simtypes.ParamChange{} +} + +// RegisterStoreDecoder registers a decoder +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} + +// 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 +} diff --git a/x/burner/simulation/simap.go b/x/burner/simulation/simap.go new file mode 100644 index 00000000..92c437c0 --- /dev/null +++ b/x/burner/simulation/simap.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/burner/types/codec.go b/x/burner/types/codec.go new file mode 100644 index 00000000..844157a8 --- /dev/null +++ b/x/burner/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/burner/types/errors.go b/x/burner/types/errors.go new file mode 100644 index 00000000..bdfd00c1 --- /dev/null +++ b/x/burner/types/errors.go @@ -0,0 +1,12 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// x/burner module sentinel errors +var ( + ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") +) diff --git a/x/burner/types/expected_keepers.go b/x/burner/types/expected_keepers.go new file mode 100644 index 00000000..6aa6e977 --- /dev/null +++ b/x/burner/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/burner/types/genesis.go b/x/burner/types/genesis.go new file mode 100644 index 00000000..8df94bae --- /dev/null +++ b/x/burner/types/genesis.go @@ -0,0 +1,24 @@ +package types + +import ( +// this line is used by starport scaffolding # genesis/types/import +) + +// DefaultIndex is the default capability global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default Capability 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/burner/types/genesis.pb.go b/x/burner/types/genesis.pb.go new file mode 100644 index 00000000..e643bb91 --- /dev/null +++ b/x/burner/types/genesis.pb.go @@ -0,0 +1,321 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: burner/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/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 burner 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_62cceffcaad9705b, []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), "bzealphateam.bze.burner.GenesisState") +} + +func init() { proto.RegisterFile("burner/genesis.proto", fileDescriptor_62cceffcaad9705b) } + +var fileDescriptor_62cceffcaad9705b = []byte{ + // 198 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x49, 0x2a, 0x2d, 0xca, + 0x4b, 0x2d, 0xd2, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, + 0x17, 0x12, 0x4f, 0xaa, 0x4a, 0x4d, 0xcc, 0x29, 0xc8, 0x48, 0x2c, 0x49, 0x4d, 0xcc, 0xd5, 0x4b, + 0xaa, 0x4a, 0xd5, 0x83, 0x28, 0x93, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd1, 0x07, 0xb1, + 0x20, 0xca, 0xa5, 0x84, 0xa1, 0x86, 0x14, 0x24, 0x16, 0x25, 0xe6, 0x42, 0xcd, 0x50, 0xf2, 0xe5, + 0xe2, 0x71, 0x87, 0x18, 0x1a, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xcb, 0xc5, 0x06, 0x91, 0x97, + 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd7, 0xc3, 0x61, 0x89, 0x5e, 0x00, 0x58, 0x99, 0x13, + 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, 0x50, 0x4d, 0x4e, 0xae, 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, 0xa5, 0x9d, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, + 0x9f, 0x54, 0x95, 0xaa, 0x0b, 0x37, 0x13, 0xc4, 0xd3, 0xaf, 0xd0, 0x87, 0x3a, 0xae, 0xa4, 0xb2, + 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x38, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6e, 0xe4, + 0x6e, 0x26, 0xf8, 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/burner/types/genesis_test.go b/x/burner/types/genesis_test.go new file mode 100644 index 00000000..2982e2dd --- /dev/null +++ b/x/burner/types/genesis_test.go @@ -0,0 +1,40 @@ +package types_test + +import ( + "testing" + + "github.com/bze-alphateam/bze/x/burner/types" + "github.com/stretchr/testify/require" +) + +func TestGenesisState_Validate(t *testing.T) { + for _, tc := range []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 + } { + 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/burner/types/keys.go b/x/burner/types/keys.go new file mode 100644 index 00000000..a7f53c1d --- /dev/null +++ b/x/burner/types/keys.go @@ -0,0 +1,22 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "burner" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // RouterKey is the message route for slashing + RouterKey = ModuleName + + // QuerierRoute defines the module's query routing key + QuerierRoute = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_burner" +) + +func KeyPrefix(p string) []byte { + return []byte(p) +} diff --git a/x/burner/types/params.go b/x/burner/types/params.go new file mode 100644 index 00000000..357196ad --- /dev/null +++ b/x/burner/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/burner/types/params.pb.go b/x/burner/types/params.pb.go new file mode 100644 index 00000000..79c88953 --- /dev/null +++ b/x/burner/types/params.pb.go @@ -0,0 +1,264 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: burner/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/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_19e8707b27642d64, []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), "bzealphateam.bze.burner.Params") +} + +func init() { proto.RegisterFile("burner/params.proto", fileDescriptor_19e8707b27642d64) } + +var fileDescriptor_19e8707b27642d64 = []byte{ + // 156 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4e, 0x2a, 0x2d, 0xca, + 0x4b, 0x2d, 0xd2, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x4f, 0xaa, 0x4a, 0x4d, 0xcc, 0x29, 0xc8, 0x48, 0x2c, 0x49, 0x4d, 0xcc, 0xd5, 0x4b, 0xaa, + 0x4a, 0xd5, 0x83, 0xa8, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd1, 0x07, 0xb1, 0x20, + 0xca, 0x95, 0xf8, 0xb8, 0xd8, 0x02, 0xc0, 0xda, 0xad, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0x72, + 0x3d, 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, 0xed, 0xf4, 0xcc, 0x92, 0x8c, + 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xa4, 0xaa, 0x54, 0x5d, 0xb8, 0x25, 0x20, 0x9e, 0x7e, + 0x85, 0x3e, 0xd4, 0x31, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xd3, 0x8d, 0x01, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x61, 0xe2, 0x61, 0x27, 0xa3, 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/burner/types/query.pb.go b/x/burner/types/query.pb.go new file mode 100644 index 00000000..59eb0036 --- /dev/null +++ b/x/burner/types/query.pb.go @@ -0,0 +1,537 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: burner/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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_9db476c77eff2c96, []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_9db476c77eff2c96, []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), "bzealphateam.bze.burner.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "bzealphateam.bze.burner.QueryParamsResponse") +} + +func init() { proto.RegisterFile("burner/query.proto", fileDescriptor_9db476c77eff2c96) } + +var fileDescriptor_9db476c77eff2c96 = []byte{ + // 304 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4b, 0x03, 0x31, + 0x14, 0xc7, 0x2f, 0xa2, 0x1d, 0xce, 0x2d, 0x2d, 0x28, 0x45, 0x52, 0xed, 0xa2, 0x58, 0x4d, 0x68, + 0x9d, 0x5d, 0x0a, 0xee, 0x5a, 0x9c, 0xdc, 0x92, 0xf2, 0x48, 0x0f, 0xda, 0xbc, 0xf4, 0x92, 0x13, + 0xdb, 0xd1, 0xd9, 0x41, 0x10, 0xfc, 0x4c, 0x1d, 0x0b, 0x2e, 0x4e, 0x22, 0xad, 0x1f, 0x44, 0x9a, + 0x9c, 0x60, 0x91, 0x82, 0xdb, 0xdd, 0xcb, 0xef, 0xf7, 0xcf, 0x3f, 0x2f, 0xa5, 0xaa, 0xc8, 0x0d, + 0xe4, 0x62, 0x5c, 0x40, 0x3e, 0xe1, 0x36, 0x47, 0x8f, 0x74, 0x4f, 0x4d, 0x41, 0x0e, 0xed, 0x40, + 0x7a, 0x90, 0x23, 0xae, 0xa6, 0xc0, 0x23, 0x54, 0xaf, 0x69, 0xd4, 0x18, 0x18, 0xb1, 0xfa, 0x8a, + 0x78, 0xfd, 0x40, 0x23, 0xea, 0x21, 0x08, 0x69, 0x33, 0x21, 0x8d, 0x41, 0x2f, 0x7d, 0x86, 0xc6, + 0x95, 0xa7, 0xa7, 0x7d, 0x74, 0x23, 0x74, 0x42, 0x49, 0x07, 0xf1, 0x16, 0x71, 0xdf, 0x56, 0xe0, + 0x65, 0x5b, 0x58, 0xa9, 0x33, 0x13, 0xe0, 0x92, 0xad, 0x96, 0x65, 0xac, 0xcc, 0xe5, 0xa8, 0x0c, + 0x68, 0xd6, 0x52, 0x7a, 0xb3, 0xd2, 0xae, 0xc3, 0xb0, 0x07, 0xe3, 0x02, 0x9c, 0x6f, 0xde, 0xa6, + 0xd5, 0xb5, 0xa9, 0xb3, 0x68, 0x1c, 0xd0, 0xcb, 0xb4, 0x12, 0xe5, 0x7d, 0x72, 0x48, 0x4e, 0x76, + 0x3b, 0x0d, 0xbe, 0xe1, 0x2d, 0x3c, 0x8a, 0xdd, 0xed, 0xd9, 0x47, 0x23, 0xe9, 0x95, 0x52, 0xe7, + 0x95, 0xa4, 0x3b, 0x21, 0x96, 0x3e, 0x91, 0xb4, 0x12, 0x11, 0xda, 0xda, 0x98, 0xf1, 0xb7, 0x57, + 0xfd, 0xec, 0x7f, 0x70, 0xac, 0xdb, 0x3c, 0x7e, 0x7c, 0xfb, 0x7a, 0xd9, 0x3a, 0xa2, 0x0d, 0xf1, + 0xdb, 0x5a, 0xfd, 0x88, 0xb5, 0x55, 0x74, 0xaf, 0x66, 0x0b, 0x46, 0xe6, 0x0b, 0x46, 0x3e, 0x17, + 0x8c, 0x3c, 0x2f, 0x59, 0x32, 0x5f, 0xb2, 0xe4, 0x7d, 0xc9, 0x92, 0xbb, 0x96, 0xce, 0xfc, 0xa0, + 0x50, 0xbc, 0x8f, 0xc1, 0x3b, 0x5f, 0x4f, 0x79, 0xf8, 0xc9, 0xf1, 0x13, 0x0b, 0x4e, 0x55, 0xc2, + 0x4a, 0x2f, 0xbe, 0x03, 0x00, 0x00, 0xff, 0xff, 0x3a, 0x62, 0xe4, 0x21, 0xf6, 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, "/bzealphateam.bze.burner.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: "/bzealphateam.bze.burner.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: "bzealphateam.bze.burner.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "burner/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/burner/types/query.pb.gw.go b/x/burner/types/query.pb.gw.go new file mode 100644 index 00000000..8adf9ce1 --- /dev/null +++ b/x/burner/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: burner/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{"bzealphateam", "bze", "burner", "params"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/burner/types/tx.pb.go b/x/burner/types/tx.pb.go new file mode 100644 index 00000000..887a9a6c --- /dev/null +++ b/x/burner/types/tx.pb.go @@ -0,0 +1,81 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: burner/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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("burner/tx.proto", fileDescriptor_64ba45d2ae09f032) } + +var fileDescriptor_64ba45d2ae09f032 = []byte{ + // 132 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0x2a, 0x2d, 0xca, + 0x4b, 0x2d, 0xd2, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4f, 0xaa, 0x4a, + 0x4d, 0xcc, 0x29, 0xc8, 0x48, 0x2c, 0x49, 0x4d, 0xcc, 0xd5, 0x4b, 0xaa, 0x4a, 0xd5, 0x83, 0xa8, + 0x30, 0x62, 0xe5, 0x62, 0xf6, 0x2d, 0x4e, 0x77, 0x72, 0x3d, 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, 0xed, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, + 0xa4, 0xaa, 0x54, 0x5d, 0xb8, 0x29, 0x20, 0x9e, 0x7e, 0x85, 0x3e, 0xcc, 0xa6, 0xca, 0x82, 0xd4, + 0xe2, 0x24, 0x36, 0xb0, 0x6d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x75, 0x6d, 0xcb, + 0x80, 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: "bzealphateam.bze.burner.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{}, + Metadata: "burner/tx.proto", +} diff --git a/x/burner/types/types.go b/x/burner/types/types.go new file mode 100644 index 00000000..ab1254f4 --- /dev/null +++ b/x/burner/types/types.go @@ -0,0 +1 @@ +package types From 629ca3a847fbdff0a64268deae03acb77cbb9381 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 8 Dec 2022 19:30:17 +0200 Subject: [PATCH 27/54] moved burning proposal to burner module --- app/app.go | 6 +- docs/static/openapi.yml | 840 +-- .../burn_coins_proposal.proto | 4 +- .../bze-alphateam/bze/bze.burner.v1/index.ts | 143 + .../bze/bze.burner.v1/module/index.ts | 57 + .../bze/bze.burner.v1/module/rest.ts | 247 + .../types/burner/burn_coins_proposal.ts | 93 + .../module/types/burner/genesis.ts | 78 + .../module/types/burner/params.ts | 56 + .../module/types/burner/query.ts | 148 + .../bze.burner.v1/module/types/burner/tx.ts | 20 + .../cosmos/base/query/v1beta1/pagination.ts | 328 + .../module/types/gogoproto/gogo.ts | 2 + .../module/types/google/api/annotations.ts | 2 + .../module/types/google/api/http.ts | 706 +++ .../types/google/protobuf/descriptor.ts | 5314 +++++++++++++++++ .../bze/bze.burner.v1/package.json | 18 + .../bze-alphateam/bze/bze.burner.v1/vuex-root | 1 + .../bze-alphateam/bze/bze.cointrunk/index.ts | 4 +- .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +- .../bze/bze.scavenge/module/index.ts | 6 +- vue/src/store/generated/index.ts | 2 + x/burner/client/cli/gov.go | 70 + x/burner/client/proposal_handler.go | 21 + x/burner/keeper/gov.go | 28 + x/burner/proposal_handler.go | 20 + x/burner/types/burn_coins_proposal.pb.go | 367 ++ x/burner/types/codec.go | 8 +- x/burner/types/expected_keepers.go | 5 +- x/burner/types/genesis.pb.go | 26 +- x/burner/types/gov.go | 38 + x/burner/types/params.pb.go | 20 +- x/burner/types/query.pb.go | 50 +- x/burner/types/tx.pb.go | 19 +- x/cointrunk/client/cli/gov.go | 55 - x/cointrunk/client/proposal_handler.go | 1 - x/cointrunk/keeper/gov.go | 23 - x/cointrunk/keeper/keeper.go | 8 +- x/cointrunk/proposal_handler.go | 2 - x/cointrunk/types/codec.go | 2 - x/cointrunk/types/gov.go | 24 - 41 files changed, 8279 insertions(+), 615 deletions(-) rename proto/{cointrunk => burner}/burn_coins_proposal.proto (52%) create mode 100755 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts create mode 100755 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/index.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/rest.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/burn_coins_proposal.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/genesis.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/params.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/query.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/tx.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/cosmos/base/query/v1beta1/pagination.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/gogoproto/gogo.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/google/api/annotations.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/google/api/http.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/google/protobuf/descriptor.ts create mode 100755 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/package.json create mode 100755 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/vuex-root create mode 100644 x/burner/client/cli/gov.go create mode 100644 x/burner/client/proposal_handler.go create mode 100644 x/burner/keeper/gov.go create mode 100644 x/burner/proposal_handler.go create mode 100644 x/burner/types/burn_coins_proposal.pb.go create mode 100644 x/burner/types/gov.go diff --git a/app/app.go b/app/app.go index 37014a23..5c5cbb1f 100644 --- a/app/app.go +++ b/app/app.go @@ -100,6 +100,7 @@ import ( cointrunkmoduletypes "github.com/bze-alphateam/bze/x/cointrunk/types" burnermodule "github.com/bze-alphateam/bze/x/burner" + burnermoduleclient "github.com/bze-alphateam/bze/x/burner/client" burnermodulekeeper "github.com/bze-alphateam/bze/x/burner/keeper" burnermoduletypes "github.com/bze-alphateam/bze/x/burner/types" // this line is used by starport scaffolding # stargate/app/moduleImport @@ -125,7 +126,7 @@ func getGovProposalHandlers() []govclient.ProposalHandler { ibcclientclient.UpgradeProposalHandler, cointrunkmoduleclient.AcceptedDomainProposalHandler, cointrunkmoduleclient.PublisherProposalHandler, - cointrunkmoduleclient.BurnCoinsProposalHandler, + burnermoduleclient.BurnCoinsProposalHandler, // this line is used by starport scaffolding # stargate/app/govProposalHandler ) @@ -403,7 +404,8 @@ func New( AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). - AddRoute(cointrunkmoduletypes.RouterKey, cointrunkmodule.NewCointrunkProposalHandler(app.CointrunkKeeper)) + AddRoute(cointrunkmoduletypes.RouterKey, cointrunkmodule.NewCointrunkProposalHandler(app.CointrunkKeeper)). + AddRoute(burnermoduletypes.RouterKey, burnermodule.NewBurnerProposalHandler(app.BurnerKeeper)) app.GovKeeper = govkeeper.NewKeeper( appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index fd396c7b..42ced681 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -4,6 +4,42 @@ info: name: '' description: '' paths: + /bzealphateam/bze/burner/params: + get: + summary: Parameters queries the parameters of the module. + operationId: BzeBurnerV1Params + 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 /bze/cointrunk/accepted_domain: get: summary: Queries a list of AcceptedDomain items. @@ -1067,42 +1103,6 @@ paths: type: string tags: - Query - /bzealphateam/bze/burner/params: - get: - summary: Parameters queries the parameters of the module. - operationId: BzealphateamBzeBurnerParams - 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 /cosmos/auth/v1beta1/accounts: get: summary: Accounts returns all the existing accounts @@ -30753,381 +30753,35 @@ paths: tags: - Query definitions: - bze.cointrunk.AcceptedDomain: - type: object - properties: - domain: - type: string - active: - type: boolean - bze.cointrunk.AnonArticlesCounter: - type: object - properties: - key: - type: string - counter: - type: string - format: uint64 - bze.cointrunk.Article: - type: object - properties: - id: - type: string - format: uint64 - title: - type: string - url: - type: string - picture: - type: string - publisher: - type: string - paid: - type: boolean - bze.cointrunk.BurnedCoins: - type: object - properties: - burned: - type: string - height: - type: string - bze.cointrunk.MsgAddArticleResponse: - type: object - bze.cointrunk.Params: + bze.burner.v1.Params: type: object - properties: - anonArticleLimit: - type: string - format: uint64 - anonArticleCost: - type: string description: Params defines the parameters for the module. - bze.cointrunk.Publisher: + bze.burner.v1.QueryParamsResponse: type: object properties: - name: - type: string - address: - type: string - active: - type: boolean - bze.cointrunk.QueryAcceptedDomainResponse: + params: + description: params holds all the parameters of this module. + type: object + description: QueryParamsResponse is response type for the Query/Params RPC method. + google.protobuf.Any: type: object properties: - acceptedDomain: - type: array - items: - type: object - properties: - domain: - type: string - active: - type: boolean - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - 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. + protocol buffer message. This string must contain at least - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - bze.cointrunk.QueryAllAnonArticlesCountersResponse: - type: object - properties: - AnonArticlesCounters: - type: array - items: - type: object - properties: - key: - type: string - counter: - type: string - format: uint64 - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + one "/" character. The last segment of the URL's path must represent - 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. + the fully qualified name of the type (as in - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - bze.cointrunk.QueryAllArticlesResponse: - type: object - properties: - article: - type: array - items: - type: object - properties: - id: - type: string - format: uint64 - title: - type: string - url: - type: string - picture: - type: string - publisher: - type: string - paid: - type: boolean - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + `path/google.protobuf.Duration`). The name should be in a canonical + form - 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; - } - bze.cointrunk.QueryAllBurnedCoinsResponse: - type: object - properties: - burnedCoins: - type: array - items: - type: object - properties: - burned: - type: string - height: - type: string - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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; - } - bze.cointrunk.QueryParamsResponse: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - anonArticleLimit: - type: string - format: uint64 - anonArticleCost: - type: string - description: QueryParamsResponse is response type for the Query/Params RPC method. - bze.cointrunk.QueryPublisherByIndexResponse: - type: object - properties: - publisher: - type: object - properties: - name: - type: string - address: - type: string - active: - type: boolean - bze.cointrunk.QueryPublisherResponse: - type: object - properties: - publisher: - type: array - items: - type: object - properties: - name: - type: string - address: - type: string - active: - type: boolean - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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; - } - 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 - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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). + (e.g., leading "." is not accepted). In practice, teams usually precompile into the binary all types that @@ -31432,30 +31086,386 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - bze.scavenge.Commit: + bze.cointrunk.AcceptedDomain: type: object properties: - index: + domain: type: string - solutionHash: + active: + type: boolean + bze.cointrunk.AnonArticlesCounter: + type: object + properties: + key: type: string - solutionScavengerHash: + counter: type: string - bze.scavenge.MsgCommitSolutionResponse: + format: uint64 + bze.cointrunk.Article: type: object - bze.scavenge.MsgRevealSolutionResponse: + properties: + id: + type: string + format: uint64 + title: + type: string + url: + type: string + picture: + type: string + publisher: + type: string + paid: + type: boolean + bze.cointrunk.BurnedCoins: type: object - bze.scavenge.MsgSubmitScavengeResponse: + properties: + burned: + type: string + height: + type: string + bze.cointrunk.MsgAddArticleResponse: type: object - bze.scavenge.QueryAllCommitResponse: + bze.cointrunk.Params: type: object properties: - commit: + anonArticleLimit: + type: string + format: uint64 + anonArticleCost: + type: string + description: Params defines the parameters for the module. + bze.cointrunk.Publisher: + type: object + properties: + name: + type: string + address: + type: string + active: + type: boolean + bze.cointrunk.QueryAcceptedDomainResponse: + type: object + properties: + acceptedDomain: type: array items: type: object properties: - index: + domain: + type: string + active: + type: boolean + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + bze.cointrunk.QueryAllAnonArticlesCountersResponse: + type: object + properties: + AnonArticlesCounters: + type: array + items: + type: object + properties: + key: + type: string + counter: + type: string + format: uint64 + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + bze.cointrunk.QueryAllArticlesResponse: + type: object + properties: + article: + type: array + items: + type: object + properties: + id: + type: string + format: uint64 + title: + type: string + url: + type: string + picture: + type: string + publisher: + type: string + paid: + type: boolean + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + bze.cointrunk.QueryAllBurnedCoinsResponse: + type: object + properties: + burnedCoins: + type: array + items: + type: object + properties: + burned: + type: string + height: + type: string + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + bze.cointrunk.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + anonArticleLimit: + type: string + format: uint64 + anonArticleCost: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. + bze.cointrunk.QueryPublisherByIndexResponse: + type: object + properties: + publisher: + type: object + properties: + name: + type: string + address: + type: string + active: + type: boolean + bze.cointrunk.QueryPublisherResponse: + type: object + properties: + publisher: + type: array + items: + type: object + properties: + name: + type: string + address: + type: string + active: + type: boolean + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + bze.scavenge.Commit: + type: object + properties: + index: + type: string + solutionHash: + type: string + solutionScavengerHash: + type: string + bze.scavenge.MsgCommitSolutionResponse: + type: object + bze.scavenge.MsgRevealSolutionResponse: + type: object + bze.scavenge.MsgSubmitScavengeResponse: + type: object + bze.scavenge.QueryAllCommitResponse: + type: object + properties: + commit: + type: array + items: + type: object + properties: + index: type: string solutionHash: type: string @@ -31576,16 +31586,6 @@ definitions: type: string scavenger: type: string - bzealphateam.bze.burner.Params: - type: object - description: Params defines the parameters for the module. - bzealphateam.bze.burner.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. cosmos.auth.v1beta1.Params: type: object properties: diff --git a/proto/cointrunk/burn_coins_proposal.proto b/proto/burner/burn_coins_proposal.proto similarity index 52% rename from proto/cointrunk/burn_coins_proposal.proto rename to proto/burner/burn_coins_proposal.proto index 148419dc..1143b1e2 100644 --- a/proto/cointrunk/burn_coins_proposal.proto +++ b/proto/burner/burn_coins_proposal.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package bze.cointrunk; +package bze.burner.v1; -option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; +option go_package = "github.com/bze-alphateam/bze/x/burner/types"; message BurnCoinsProposal { diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts new file mode 100755 index 00000000..a2c9cd36 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts @@ -0,0 +1,143 @@ +import { txClient, queryClient, MissingWalletError , registry} from './module' + +import { BurnCoinsProposal } from "./module/types/burner/burn_coins_proposal" +import { Params } from "./module/types/burner/params" + + +export { BurnCoinsProposal, Params }; + +async function initTxClient(vuexGetters) { + return await txClient(vuexGetters['common/wallet/signer'], { + addr: vuexGetters['common/env/apiTendermint'] + }) +} + +async function initQueryClient(vuexGetters) { + return await queryClient({ + addr: vuexGetters['common/env/apiCosmos'] + }) +} + +function mergeResults(value, next_values) { + for (let prop of Object.keys(next_values)) { + if (Array.isArray(next_values[prop])) { + value[prop]=[...value[prop], ...next_values[prop]] + }else{ + value[prop]=next_values[prop] + } + } + return value +} + +function getStructure(template) { + let structure = { fields: [] } + for (const [key, value] of Object.entries(template)) { + let field: any = {} + field.name = key + field.type = typeof value + structure.fields.push(field) + } + return structure +} + +const getDefaultState = () => { + return { + Params: {}, + + _Structure: { + BurnCoinsProposal: getStructure(BurnCoinsProposal.fromPartial({})), + Params: getStructure(Params.fromPartial({})), + + }, + _Registry: registry, + _Subscriptions: new Set(), + } +} + +// initial state +const state = getDefaultState() + +export default { + namespaced: true, + state, + mutations: { + RESET_STATE(state) { + Object.assign(state, getDefaultState()) + }, + QUERY(state, { query, key, value }) { + state[query][JSON.stringify(key)] = value + }, + SUBSCRIBE(state, subscription) { + state._Subscriptions.add(JSON.stringify(subscription)) + }, + UNSUBSCRIBE(state, subscription) { + state._Subscriptions.delete(JSON.stringify(subscription)) + } + }, + getters: { + getParams: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.Params[JSON.stringify(params)] ?? {} + }, + + getTypeStructure: (state) => (type) => { + return state._Structure[type].fields + }, + getRegistry: (state) => { + return state._Registry + } + }, + actions: { + init({ dispatch, rootGetters }) { + console.log('Vuex module: bze.burner.v1 initialized!') + if (rootGetters['common/env/client']) { + rootGetters['common/env/client'].on('newblock', () => { + dispatch('StoreUpdate') + }) + } + }, + resetState({ commit }) { + commit('RESET_STATE') + }, + unsubscribe({ commit }, subscription) { + commit('UNSUBSCRIBE', subscription) + }, + async StoreUpdate({ state, dispatch }) { + state._Subscriptions.forEach(async (subscription) => { + try { + const sub=JSON.parse(subscription) + await dispatch(sub.action, sub.payload) + }catch(e) { + throw new Error('Subscriptions: ' + e.message) + } + }) + }, + + + + + + + async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryParams()).data + + + commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) + return getters['getParams']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + + + + } +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/index.ts new file mode 100755 index 00000000..67d4b093 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/index.ts @@ -0,0 +1,57 @@ +// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient } from "@cosmjs/stargate"; +import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; +import { Api } from "./rest"; + + +const types = [ + +]; +export const MissingWalletError = new Error("wallet is required"); + +export const registry = new Registry(types); + +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string +} + +interface SignAndBroadcastOptions { + fee: StdFee, + memo?: string +} + +const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { + if (!wallet) throw MissingWalletError; + let client; + if (addr) { + client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); + }else{ + client = await SigningStargateClient.offline( wallet, { registry }); + } + const { address } = (await wallet.getAccounts())[0]; + + return { + signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + + }; +}; + +interface QueryClientOptions { + addr: string +} + +const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseUrl: addr }); +}; + +export { + txClient, + queryClient, +}; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/rest.ts new file mode 100644 index 00000000..0c0992c3 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/rest.ts @@ -0,0 +1,247 @@ +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +export interface ProtobufAny { + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +/** + * Params defines the parameters for the module. + */ +export type V1Params = object; + +/** + * QueryParamsResponse is response type for the Query/Params RPC method. + */ +export interface V1QueryParamsResponse { + /** params holds all the parameters of this module. */ + params?: V1Params; +} + +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: keyof Omit; + /** request body */ + body?: unknown; + /** base url */ + baseUrl?: string; + /** request cancellation token */ + cancelToken?: CancelToken; +} + +export type RequestParams = Omit; + +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: (securityData: SecurityDataType) => RequestParams | void; +} + +export interface HttpResponse extends Response { + data: D; + error: E; +} + +type CancelToken = Symbol | string | number; + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public baseUrl: string = ""; + private securityData: SecurityDataType = null as any; + private securityWorker: null | ApiConfig["securityWorker"] = null; + private abortControllers = new Map(); + + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; + + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } + + public setSecurityData = (data: SecurityDataType) => { + this.securityData = data; + }; + + private addQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + + return ( + encodeURIComponent(key) + + "=" + + encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) + ); + } + + protected toQueryString(rawQuery?: QueryParamsType): string { + const query = rawQuery || {}; + const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + return keys + .map((key) => + typeof query[key] === "object" && !Array.isArray(query[key]) + ? this.toQueryString(query[key] as QueryParamsType) + : this.addQueryParam(query, key), + ) + .join("&"); + } + + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? `?${queryString}` : ""; + } + + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, + [ContentType.FormData]: (input: any) => + Object.keys(input || {}).reduce((data, key) => { + data.append(key, input[key]); + return data; + }, new FormData()), + [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), + }; + + private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + if (this.abortControllers.has(cancelToken)) { + const abortController = this.abortControllers.get(cancelToken); + if (abortController) { + return abortController.signal; + } + return void 0; + } + + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; + + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); + + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; + + public request = ({ + body, + secure, + path, + type, + query, + format = "json", + baseUrl, + cancelToken, + ...params + }: FullRequestParams): Promise> => { + const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const queryString = query && this.toQueryString(query); + const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + + return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), + }).then(async (response) => { + const r = response as HttpResponse; + r.data = (null as unknown) as T; + r.error = (null as unknown) as E; + + const data = await response[format]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); + + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } + + if (!response.ok) throw data; + return data; + }); + }; +} + +/** + * @title burner/burn_coins_proposal.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryParams + * @summary Parameters queries the parameters of the module. + * @request GET:/bzealphateam/bze/burner/params + */ + queryParams = (params: RequestParams = {}) => + this.request({ + path: `/bzealphateam/bze/burner/params`, + method: "GET", + format: "json", + ...params, + }); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/burn_coins_proposal.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/burn_coins_proposal.ts new file mode 100644 index 00000000..a71afdbc --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/burn_coins_proposal.ts @@ -0,0 +1,93 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.burner.v1"; + +export interface BurnCoinsProposal { + title: string; + description: string; +} + +const baseBurnCoinsProposal: object = { title: "", description: "" }; + +export const BurnCoinsProposal = { + encode(message: BurnCoinsProposal, writer: Writer = Writer.create()): Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): BurnCoinsProposal { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBurnCoinsProposal } as BurnCoinsProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BurnCoinsProposal { + const message = { ...baseBurnCoinsProposal } as BurnCoinsProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + return message; + }, + + toJSON(message: BurnCoinsProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + return obj; + }, + + fromPartial(object: DeepPartial): BurnCoinsProposal { + const message = { ...baseBurnCoinsProposal } as BurnCoinsProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/genesis.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/genesis.ts new file mode 100644 index 00000000..b4f0d2d8 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/genesis.ts @@ -0,0 +1,78 @@ +/* eslint-disable */ +import { Params } from "../burner/params"; +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.burner.v1"; + +/** GenesisState defines the burner module's genesis state. */ +export interface GenesisState { + /** this line is used by starport scaffolding # genesis/proto/state */ + params: Params | undefined; +} + +const baseGenesisState: object = {}; + +export const GenesisState = { + encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/params.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/params.ts new file mode 100644 index 00000000..425a5cc7 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/params.ts @@ -0,0 +1,56 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.burner.v1"; + +/** Params defines the parameters for the module. */ +export interface Params {} + +const baseParams: object = {}; + +export const Params = { + encode(_: Params, writer: Writer = Writer.create()): Writer { + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Params { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): Params { + const message = { ...baseParams } as Params; + return message; + }, + + toJSON(_: Params): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): Params { + const message = { ...baseParams } as Params; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/query.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/query.ts new file mode 100644 index 00000000..671d0521 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/query.ts @@ -0,0 +1,148 @@ +/* eslint-disable */ +import { Reader, Writer } from "protobufjs/minimal"; +import { Params } from "../burner/params"; + +export const protobufPackage = "bze.burner.v1"; + +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} + +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params | undefined; +} + +const baseQueryParamsRequest: object = {}; + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, +}; + +const baseQueryParamsResponse: object = {}; + +export const QueryParamsResponse = { + encode( + message: QueryParamsResponse, + writer: Writer = Writer.create() + ): Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** Parameters queries the parameters of the module. */ + Params(request: QueryParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("bze.burner.v1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/tx.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/tx.ts new file mode 100644 index 00000000..8d4851cc --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/tx.ts @@ -0,0 +1,20 @@ +/* eslint-disable */ +export const protobufPackage = "bze.burner.v1"; + +/** Msg defines the Msg service. */ +export interface Msg {} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 00000000..9c87ac0c --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,328 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.query.v1beta1"; + +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequest { + /** + * 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. + */ + key: Uint8Array; + /** + * 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. + */ + offset: number; + /** + * 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. + */ + limit: number; + /** + * 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. + */ + count_total: boolean; + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse: boolean; +} + +/** + * 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; + * } + */ +export interface PageResponse { + /** + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently + */ + next_key: Uint8Array; + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + */ + total: number; +} + +const basePageRequest: object = { + offset: 0, + limit: 0, + count_total: false, + reverse: false, +}; + +export const PageRequest = { + encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.offset !== 0) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== 0) { + writer.uint32(24).uint64(message.limit); + } + if (message.count_total === true) { + writer.uint32(32).bool(message.count_total); + } + if (message.reverse === true) { + writer.uint32(40).bool(message.reverse); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PageRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePageRequest } as PageRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.offset = longToNumber(reader.uint64() as Long); + break; + case 3: + message.limit = longToNumber(reader.uint64() as Long); + break; + case 4: + message.count_total = reader.bool(); + break; + case 5: + message.reverse = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PageRequest { + const message = { ...basePageRequest } as PageRequest; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = Number(object.offset); + } else { + message.offset = 0; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = Number(object.limit); + } else { + message.limit = 0; + } + if (object.count_total !== undefined && object.count_total !== null) { + message.count_total = Boolean(object.count_total); + } else { + message.count_total = false; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = Boolean(object.reverse); + } else { + message.reverse = false; + } + return message; + }, + + toJSON(message: PageRequest): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array() + )); + message.offset !== undefined && (obj.offset = message.offset); + message.limit !== undefined && (obj.limit = message.limit); + message.count_total !== undefined && + (obj.count_total = message.count_total); + message.reverse !== undefined && (obj.reverse = message.reverse); + return obj; + }, + + fromPartial(object: DeepPartial): PageRequest { + const message = { ...basePageRequest } as PageRequest; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = object.offset; + } else { + message.offset = 0; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = object.limit; + } else { + message.limit = 0; + } + if (object.count_total !== undefined && object.count_total !== null) { + message.count_total = object.count_total; + } else { + message.count_total = false; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = object.reverse; + } else { + message.reverse = false; + } + return message; + }, +}; + +const basePageResponse: object = { total: 0 }; + +export const PageResponse = { + encode(message: PageResponse, writer: Writer = Writer.create()): Writer { + if (message.next_key.length !== 0) { + writer.uint32(10).bytes(message.next_key); + } + if (message.total !== 0) { + writer.uint32(16).uint64(message.total); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PageResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePageResponse } as PageResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.next_key = reader.bytes(); + break; + case 2: + message.total = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PageResponse { + const message = { ...basePageResponse } as PageResponse; + if (object.next_key !== undefined && object.next_key !== null) { + message.next_key = bytesFromBase64(object.next_key); + } + if (object.total !== undefined && object.total !== null) { + message.total = Number(object.total); + } else { + message.total = 0; + } + return message; + }, + + toJSON(message: PageResponse): unknown { + const obj: any = {}; + message.next_key !== undefined && + (obj.next_key = base64FromBytes( + message.next_key !== undefined ? message.next_key : new Uint8Array() + )); + message.total !== undefined && (obj.total = message.total); + return obj; + }, + + fromPartial(object: DeepPartial): PageResponse { + const message = { ...basePageResponse } as PageResponse; + if (object.next_key !== undefined && object.next_key !== null) { + message.next_key = object.next_key; + } else { + message.next_key = new Uint8Array(); + } + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } else { + message.total = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/gogoproto/gogo.ts new file mode 100644 index 00000000..3f41a047 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/gogoproto/gogo.ts @@ -0,0 +1,2 @@ +/* eslint-disable */ +export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/google/api/annotations.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/google/api/annotations.ts new file mode 100644 index 00000000..aace4787 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/google/api/annotations.ts @@ -0,0 +1,2 @@ +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/google/api/http.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/google/api/http.ts new file mode 100644 index 00000000..ccadff68 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/google/api/http.ts @@ -0,0 +1,706 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "google.api"; + +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path parmeters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fully_decode_reserved_expansion: boolean; +} + +/** + * `HttpRule` defines the mapping of an RPC method to one or more HTTP + * REST API methods. The mapping specifies how different portions of the RPC + * request message are mapped to URL path, URL query parameters, and + * HTTP request body. The mapping is typically specified as an + * `google.api.http` annotation on the RPC method, + * see "google/api/annotations.proto" for details. + * + * The mapping consists of a field specifying the path template and + * method kind. The path template can refer to fields in the request + * message, as in the example below which describes a REST GET + * operation on a resource collection of messages: + * + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * SubMessage sub = 2; // `sub.subfield` is url-mapped + * } + * message Message { + * string text = 1; // content of the resource + * } + * + * The same http annotation can alternatively be expressed inside the + * `GRPC API Configuration` YAML file. + * + * http: + * rules: + * - selector: .Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * This definition enables an automatic, bidrectional mapping of HTTP + * JSON to RPC. Example: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` + * + * In general, not only fields but also field paths can be referenced + * from a path pattern. Fields mapped to the path pattern cannot be + * repeated and must have a primitive (non-message) type. + * + * Any fields in the request message which are not bound by the path + * pattern automatically become (optional) HTTP query + * parameters. Assume the following definition of the request message: + * + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * int64 revision = 2; // becomes a parameter + * SubMessage sub = 3; // `sub.subfield` becomes a parameter + * } + * + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` + * + * Note that fields which are mapped to HTTP parameters must have a + * primitive type or a repeated primitive type. Message types are not + * allowed. In the case of a repeated type, the parameter can be + * repeated in the URL, as in `...?param=A¶m=B`. + * + * For HTTP method kinds which allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | RPC + * -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | RPC + * -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice of + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * + * This enables the following two alternative HTTP JSON to RPC + * mappings: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` + * + * # Rules for HTTP mapping + * + * The rules for mapping HTTP path, query parameters, and body fields + * to the request message are as follows: + * + * 1. The `body` field specifies either `*` or a field path, or is + * omitted. If omitted, it indicates there is no HTTP request body. + * 2. Leaf fields (recursive expansion of nested messages in the + * request) can be classified into three types: + * (a) Matched in the URL template. + * (b) Covered by body (if body is `*`, everything except (a) fields; + * else everything under the body field) + * (c) All other fields. + * 3. URL query parameters found in the HTTP request are mapped to (c) fields. + * 4. Any body sent with an HTTP request can contain only (b) fields. + * + * The syntax of the path template is as follows: + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single path segment. The syntax `**` matches zero + * or more path segments, which must be the last part of the path except the + * `Verb`. The syntax `LITERAL` matches literal text in the path. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path, all characters + * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the + * Discovery Document as `{var}`. + * + * If a variable contains one or more path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path, all + * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables + * show up in the Discovery Document as `{+var}`. + * + * NOTE: While the single segment variable matches the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 + * Simple String Expansion, the multi segment variable **does not** match + * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. + * + * NOTE: the field paths in variables and in the `body` must not refer to + * repeated fields or map fields. + */ +export interface HttpRule { + /** + * Selects methods to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + */ + selector: string; + /** Used for listing and getting information about resources. */ + get: string | undefined; + /** Used for updating a resource. */ + put: string | undefined; + /** Used for creating a resource. */ + post: string | undefined; + /** Used for deleting a resource. */ + delete: string | undefined; + /** Used for updating a resource. */ + patch: string | undefined; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom: CustomHttpPattern | undefined; + /** + * The name of the request field whose value is mapped to the HTTP body, or + * `*` for mapping all fields not captured by the path pattern to the HTTP + * body. NOTE: the referred field must not be a repeated field and must be + * present at the top-level of request message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * body of response. Other response fields are ignored. When + * not set, the response message will be used as HTTP body of response. + */ + response_body: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additional_bindings: HttpRule[]; +} + +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPattern { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} + +const baseHttp: object = { fully_decode_reserved_expansion: false }; + +export const Http = { + encode(message: Http, writer: Writer = Writer.create()): Writer { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fully_decode_reserved_expansion === true) { + writer.uint32(16).bool(message.fully_decode_reserved_expansion); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Http { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHttp } as Http; + message.rules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rules.push(HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fully_decode_reserved_expansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromJSON(e)); + } + } + if ( + object.fully_decode_reserved_expansion !== undefined && + object.fully_decode_reserved_expansion !== null + ) { + message.fully_decode_reserved_expansion = Boolean( + object.fully_decode_reserved_expansion + ); + } else { + message.fully_decode_reserved_expansion = false; + } + return message; + }, + + toJSON(message: Http): unknown { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map((e) => + e ? HttpRule.toJSON(e) : undefined + ); + } else { + obj.rules = []; + } + message.fully_decode_reserved_expansion !== undefined && + (obj.fully_decode_reserved_expansion = + message.fully_decode_reserved_expansion); + return obj; + }, + + fromPartial(object: DeepPartial): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromPartial(e)); + } + } + if ( + object.fully_decode_reserved_expansion !== undefined && + object.fully_decode_reserved_expansion !== null + ) { + message.fully_decode_reserved_expansion = + object.fully_decode_reserved_expansion; + } else { + message.fully_decode_reserved_expansion = false; + } + return message; + }, +}; + +const baseHttpRule: object = { selector: "", body: "", response_body: "" }; + +export const HttpRule = { + encode(message: HttpRule, writer: Writer = Writer.create()): Writer { + if (message.selector !== "") { + writer.uint32(10).string(message.selector); + } + if (message.get !== undefined) { + writer.uint32(18).string(message.get); + } + if (message.put !== undefined) { + writer.uint32(26).string(message.put); + } + if (message.post !== undefined) { + writer.uint32(34).string(message.post); + } + if (message.delete !== undefined) { + writer.uint32(42).string(message.delete); + } + if (message.patch !== undefined) { + writer.uint32(50).string(message.patch); + } + if (message.custom !== undefined) { + CustomHttpPattern.encode( + message.custom, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.body !== "") { + writer.uint32(58).string(message.body); + } + if (message.response_body !== "") { + writer.uint32(98).string(message.response_body); + } + for (const v of message.additional_bindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): HttpRule { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message.delete = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.response_body = reader.string(); + break; + case 11: + message.additional_bindings.push( + HttpRule.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = String(object.selector); + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = String(object.get); + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = String(object.put); + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = String(object.post); + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = String(object.delete); + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = String(object.patch); + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromJSON(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = String(object.body); + } else { + message.body = ""; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.response_body = String(object.response_body); + } else { + message.response_body = ""; + } + if ( + object.additional_bindings !== undefined && + object.additional_bindings !== null + ) { + for (const e of object.additional_bindings) { + message.additional_bindings.push(HttpRule.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: HttpRule): unknown { + const obj: any = {}; + message.selector !== undefined && (obj.selector = message.selector); + message.get !== undefined && (obj.get = message.get); + message.put !== undefined && (obj.put = message.put); + message.post !== undefined && (obj.post = message.post); + message.delete !== undefined && (obj.delete = message.delete); + message.patch !== undefined && (obj.patch = message.patch); + message.custom !== undefined && + (obj.custom = message.custom + ? CustomHttpPattern.toJSON(message.custom) + : undefined); + message.body !== undefined && (obj.body = message.body); + message.response_body !== undefined && + (obj.response_body = message.response_body); + if (message.additional_bindings) { + obj.additional_bindings = message.additional_bindings.map((e) => + e ? HttpRule.toJSON(e) : undefined + ); + } else { + obj.additional_bindings = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromPartial(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } else { + message.body = ""; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.response_body = object.response_body; + } else { + message.response_body = ""; + } + if ( + object.additional_bindings !== undefined && + object.additional_bindings !== null + ) { + for (const e of object.additional_bindings) { + message.additional_bindings.push(HttpRule.fromPartial(e)); + } + } + return message; + }, +}; + +const baseCustomHttpPattern: object = { kind: "", path: "" }; + +export const CustomHttpPattern = { + encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + if (message.kind !== "") { + writer.uint32(10).string(message.kind); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = String(object.kind); + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = String(object.path); + } else { + message.path = ""; + } + return message; + }, + + toJSON(message: CustomHttpPattern): unknown { + const obj: any = {}; + message.kind !== undefined && (obj.kind = message.kind); + message.path !== undefined && (obj.path = message.path); + return obj; + }, + + fromPartial(object: DeepPartial): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/google/protobuf/descriptor.ts new file mode 100644 index 00000000..a0167cb2 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/google/protobuf/descriptor.ts @@ -0,0 +1,5314 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} + +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name: string; + /** e.g. "foo", "foo.bar", etc. */ + package: string; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + public_dependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weak_dependency: number[]; + /** All top-level definitions in this file. */ + message_type: DescriptorProto[]; + enum_type: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options: FileOptions | undefined; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + source_code_info: SourceCodeInfo | undefined; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax: string; +} + +/** Describes a message type. */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nested_type: DescriptorProto[]; + enum_type: EnumDescriptorProto[]; + extension_range: DescriptorProto_ExtensionRange[]; + oneof_decl: OneofDescriptorProto[]; + options: MessageOptions | undefined; + reserved_range: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reserved_name: string[]; +} + +export interface DescriptorProto_ExtensionRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; + options: ExtensionRangeOptions | undefined; +} + +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; +} + +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + type_name: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * TODO(kenton): Base-64 encode? + */ + default_value: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneof_index: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + json_name: string; + options: FieldOptions | undefined; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + */ + proto3_optional: boolean; +} + +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_TypeFromJSON( + object: any +): FieldDescriptorProto_Type { + switch (object) { + case 1: + case "TYPE_DOUBLE": + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case "TYPE_FLOAT": + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case "TYPE_INT64": + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case "TYPE_UINT64": + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case "TYPE_INT32": + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case "TYPE_FIXED64": + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case "TYPE_FIXED32": + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case "TYPE_BOOL": + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case "TYPE_STRING": + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case "TYPE_GROUP": + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case "TYPE_MESSAGE": + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case "TYPE_BYTES": + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case "TYPE_UINT32": + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case "TYPE_ENUM": + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case "TYPE_SFIXED32": + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case "TYPE_SFIXED64": + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case "TYPE_SINT32": + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case "TYPE_SINT64": + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_TypeToJSON( + object: FieldDescriptorProto_Type +): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return "TYPE_DOUBLE"; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return "TYPE_FLOAT"; + case FieldDescriptorProto_Type.TYPE_INT64: + return "TYPE_INT64"; + case FieldDescriptorProto_Type.TYPE_UINT64: + return "TYPE_UINT64"; + case FieldDescriptorProto_Type.TYPE_INT32: + return "TYPE_INT32"; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return "TYPE_FIXED64"; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return "TYPE_FIXED32"; + case FieldDescriptorProto_Type.TYPE_BOOL: + return "TYPE_BOOL"; + case FieldDescriptorProto_Type.TYPE_STRING: + return "TYPE_STRING"; + case FieldDescriptorProto_Type.TYPE_GROUP: + return "TYPE_GROUP"; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return "TYPE_MESSAGE"; + case FieldDescriptorProto_Type.TYPE_BYTES: + return "TYPE_BYTES"; + case FieldDescriptorProto_Type.TYPE_UINT32: + return "TYPE_UINT32"; + case FieldDescriptorProto_Type.TYPE_ENUM: + return "TYPE_ENUM"; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return "TYPE_SFIXED32"; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return "TYPE_SFIXED64"; + case FieldDescriptorProto_Type.TYPE_SINT32: + return "TYPE_SINT32"; + case FieldDescriptorProto_Type.TYPE_SINT64: + return "TYPE_SINT64"; + default: + return "UNKNOWN"; + } +} + +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_LabelFromJSON( + object: any +): FieldDescriptorProto_Label { + switch (object) { + case 1: + case "LABEL_OPTIONAL": + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_LabelToJSON( + object: FieldDescriptorProto_Label +): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return "LABEL_OPTIONAL"; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + default: + return "UNKNOWN"; + } +} + +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name: string; + options: OneofOptions | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: EnumOptions | undefined; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reserved_range: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reserved_name: string[]; +} + +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} + +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options: EnumValueOptions | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + input_type: string; + output_type: string; + options: MethodOptions | undefined; + /** Identifies if client streams multiple client messages */ + client_streaming: boolean; + /** Identifies if server streams multiple server messages */ + server_streaming: boolean; +} + +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + java_package: string; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + */ + java_outer_classname: string; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + java_multiple_files: boolean; + /** + * This option does nothing. + * + * @deprecated + */ + java_generate_equals_and_hash: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + java_string_check_utf8: boolean; + optimize_for: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + go_package: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + cc_generic_services: boolean; + java_generic_services: boolean; + py_generic_services: boolean; + php_generic_services: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + cc_enable_arenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objc_class_prefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharp_namespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swift_prefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + php_class_prefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + php_namespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + php_metadata_namespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + ruby_package: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpreted_option: UninterpretedOption[]; +} + +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, */ + SPEED = 1, + /** CODE_SIZE - etc. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} + +export function fileOptions_OptimizeModeFromJSON( + object: any +): FileOptions_OptimizeMode { + switch (object) { + case 1: + case "SPEED": + return FileOptions_OptimizeMode.SPEED; + case 2: + case "CODE_SIZE": + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case "LITE_RUNTIME": + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} + +export function fileOptions_OptimizeModeToJSON( + object: FileOptions_OptimizeMode +): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return "SPEED"; + case FileOptions_OptimizeMode.CODE_SIZE: + return "CODE_SIZE"; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return "LITE_RUNTIME"; + default: + return "UNKNOWN"; + } +} + +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + message_set_wire_format: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + no_standard_descriptor_accessor: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + map_entry: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + */ + lazy: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated: boolean; + /** For Google-internal migration only. Do not use. */ + weak: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case "STRING": + return FieldOptions_CType.STRING; + case 1: + case "CORD": + return FieldOptions_CType.CORD; + case 2: + case "STRING_PIECE": + return FieldOptions_CType.STRING_PIECE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} + +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return "STRING"; + case FieldOptions_CType.CORD: + return "CORD"; + case FieldOptions_CType.STRING_PIECE: + return "STRING_PIECE"; + default: + return "UNKNOWN"; + } +} + +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case "JS_NORMAL": + return FieldOptions_JSType.JS_NORMAL; + case 1: + case "JS_STRING": + return FieldOptions_JSType.JS_STRING; + case 2: + case "JS_NUMBER": + return FieldOptions_JSType.JS_NUMBER; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} + +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return "JS_NORMAL"; + case FieldOptions_JSType.JS_STRING: + return "JS_STRING"; + case FieldOptions_JSType.JS_NUMBER: + return "JS_NUMBER"; + default: + return "UNKNOWN"; + } +} + +export interface OneofOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allow_alias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface ServiceOptions { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated: boolean; + idempotency_level: MethodOptions_IdempotencyLevel; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} + +export function methodOptions_IdempotencyLevelFromJSON( + object: any +): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case "IDEMPOTENCY_UNKNOWN": + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case "NO_SIDE_EFFECTS": + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case "IDEMPOTENT": + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case "UNRECOGNIZED": + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} + +export function methodOptions_IdempotencyLevelToJSON( + object: MethodOptions_IdempotencyLevel +): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return "IDEMPOTENCY_UNKNOWN"; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return "NO_SIDE_EFFECTS"; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return "IDEMPOTENT"; + default: + return "UNKNOWN"; + } +} + +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifier_value: string; + positive_int_value: number; + negative_int_value: number; + double_value: number; + string_value: Uint8Array; + aggregate_value: string; +} + +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePart { + name_part: string; + is_extension: boolean; +} + +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} + +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition. For + * example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. * / + * /* Block comment attached to + * * grault. * / + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leading_comments: string; + trailing_comments: string; + leading_detached_comments: string[]; +} + +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} + +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + source_file: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end: number; +} + +const baseFileDescriptorSet: object = {}; + +export const FileDescriptorSet = { + encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.file.push( + FileDescriptorProto.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FileDescriptorSet): unknown { + const obj: any = {}; + if (message.file) { + obj.file = message.file.map((e) => + e ? FileDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.file = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFileDescriptorProto: object = { + name: "", + package: "", + dependency: "", + public_dependency: 0, + weak_dependency: 0, + syntax: "", +}; + +export const FileDescriptorProto = { + encode( + message: FileDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.package !== "") { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.public_dependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weak_dependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.message_type) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enum_type) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.source_code_info !== undefined) { + SourceCodeInfo.encode( + message.source_code_info, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.syntax !== "") { + writer.uint32(98).string(message.syntax); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.package = reader.string(); + break; + case 3: + message.dependency.push(reader.string()); + break; + case 10: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.public_dependency.push(reader.int32()); + } + } else { + message.public_dependency.push(reader.int32()); + } + break; + case 11: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weak_dependency.push(reader.int32()); + } + } else { + message.weak_dependency.push(reader.int32()); + } + break; + case 4: + message.message_type.push( + DescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 5: + message.enum_type.push( + EnumDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 6: + message.service.push( + ServiceDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 7: + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 8: + message.options = FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.source_code_info = SourceCodeInfo.decode( + reader, + reader.uint32() + ); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = String(object.package); + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(String(e)); + } + } + if ( + object.public_dependency !== undefined && + object.public_dependency !== null + ) { + for (const e of object.public_dependency) { + message.public_dependency.push(Number(e)); + } + } + if ( + object.weak_dependency !== undefined && + object.weak_dependency !== null + ) { + for (const e of object.weak_dependency) { + message.weak_dependency.push(Number(e)); + } + } + if (object.message_type !== undefined && object.message_type !== null) { + for (const e of object.message_type) { + message.message_type.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromJSON(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.source_code_info !== undefined && + object.source_code_info !== null + ) { + message.source_code_info = SourceCodeInfo.fromJSON( + object.source_code_info + ); + } else { + message.source_code_info = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = String(object.syntax); + } else { + message.syntax = ""; + } + return message; + }, + + toJSON(message: FileDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.package !== undefined && (obj.package = message.package); + if (message.dependency) { + obj.dependency = message.dependency.map((e) => e); + } else { + obj.dependency = []; + } + if (message.public_dependency) { + obj.public_dependency = message.public_dependency.map((e) => e); + } else { + obj.public_dependency = []; + } + if (message.weak_dependency) { + obj.weak_dependency = message.weak_dependency.map((e) => e); + } else { + obj.weak_dependency = []; + } + if (message.message_type) { + obj.message_type = message.message_type.map((e) => + e ? DescriptorProto.toJSON(e) : undefined + ); + } else { + obj.message_type = []; + } + if (message.enum_type) { + obj.enum_type = message.enum_type.map((e) => + e ? EnumDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.enum_type = []; + } + if (message.service) { + obj.service = message.service.map((e) => + e ? ServiceDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.service = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.extension = []; + } + message.options !== undefined && + (obj.options = message.options + ? FileOptions.toJSON(message.options) + : undefined); + message.source_code_info !== undefined && + (obj.source_code_info = message.source_code_info + ? SourceCodeInfo.toJSON(message.source_code_info) + : undefined); + message.syntax !== undefined && (obj.syntax = message.syntax); + return obj; + }, + + fromPartial(object: DeepPartial): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(e); + } + } + if ( + object.public_dependency !== undefined && + object.public_dependency !== null + ) { + for (const e of object.public_dependency) { + message.public_dependency.push(e); + } + } + if ( + object.weak_dependency !== undefined && + object.weak_dependency !== null + ) { + for (const e of object.weak_dependency) { + message.weak_dependency.push(e); + } + } + if (object.message_type !== undefined && object.message_type !== null) { + for (const e of object.message_type) { + message.message_type.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromPartial(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.source_code_info !== undefined && + object.source_code_info !== null + ) { + message.source_code_info = SourceCodeInfo.fromPartial( + object.source_code_info + ); + } else { + message.source_code_info = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } else { + message.syntax = ""; + } + return message; + }, +}; + +const baseDescriptorProto: object = { name: "", reserved_name: "" }; + +export const DescriptorProto = { + encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nested_type) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enum_type) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extension_range) { + DescriptorProto_ExtensionRange.encode( + v!, + writer.uint32(42).fork() + ).ldelim(); + } + for (const v of message.oneof_decl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reserved_range) { + DescriptorProto_ReservedRange.encode( + v!, + writer.uint32(74).fork() + ).ldelim(); + } + for (const v of message.reserved_name) { + writer.uint32(82).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.field.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 6: + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.nested_type.push( + DescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 4: + message.enum_type.push( + EnumDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 5: + message.extension_range.push( + DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) + ); + break; + case 8: + message.oneof_decl.push( + OneofDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 7: + message.options = MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + message.reserved_range.push( + DescriptorProto_ReservedRange.decode(reader, reader.uint32()) + ); + break; + case 10: + message.reserved_name.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.nested_type !== undefined && object.nested_type !== null) { + for (const e of object.nested_type) { + message.nested_type.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromJSON(e)); + } + } + if ( + object.extension_range !== undefined && + object.extension_range !== null + ) { + for (const e of object.extension_range) { + message.extension_range.push( + DescriptorProto_ExtensionRange.fromJSON(e) + ); + } + } + if (object.oneof_decl !== undefined && object.oneof_decl !== null) { + for (const e of object.oneof_decl) { + message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(String(e)); + } + } + return message; + }, + + toJSON(message: DescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.field) { + obj.field = message.field.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.field = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.extension = []; + } + if (message.nested_type) { + obj.nested_type = message.nested_type.map((e) => + e ? DescriptorProto.toJSON(e) : undefined + ); + } else { + obj.nested_type = []; + } + if (message.enum_type) { + obj.enum_type = message.enum_type.map((e) => + e ? EnumDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.enum_type = []; + } + if (message.extension_range) { + obj.extension_range = message.extension_range.map((e) => + e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined + ); + } else { + obj.extension_range = []; + } + if (message.oneof_decl) { + obj.oneof_decl = message.oneof_decl.map((e) => + e ? OneofDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.oneof_decl = []; + } + message.options !== undefined && + (obj.options = message.options + ? MessageOptions.toJSON(message.options) + : undefined); + if (message.reserved_range) { + obj.reserved_range = message.reserved_range.map((e) => + e ? DescriptorProto_ReservedRange.toJSON(e) : undefined + ); + } else { + obj.reserved_range = []; + } + if (message.reserved_name) { + obj.reserved_name = message.reserved_name.map((e) => e); + } else { + obj.reserved_name = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.nested_type !== undefined && object.nested_type !== null) { + for (const e of object.nested_type) { + message.nested_type.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromPartial(e)); + } + } + if ( + object.extension_range !== undefined && + object.extension_range !== null + ) { + for (const e of object.extension_range) { + message.extension_range.push( + DescriptorProto_ExtensionRange.fromPartial(e) + ); + } + } + if (object.oneof_decl !== undefined && object.oneof_decl !== null) { + for (const e of object.oneof_decl) { + message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + DescriptorProto_ReservedRange.fromPartial(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(e); + } + } + return message; + }, +}; + +const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; + +export const DescriptorProto_ExtensionRange = { + encode( + message: DescriptorProto_ExtensionRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode( + message.options, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): DescriptorProto_ExtensionRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = ExtensionRangeOptions.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ExtensionRange { + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: DescriptorProto_ExtensionRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + message.options !== undefined && + (obj.options = message.options + ? ExtensionRangeOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): DescriptorProto_ExtensionRange { + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; + +export const DescriptorProto_ReservedRange = { + encode( + message: DescriptorProto_ReservedRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): DescriptorProto_ReservedRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ReservedRange { + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: DescriptorProto_ReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): DescriptorProto_ReservedRange { + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +const baseExtensionRangeOptions: object = {}; + +export const ExtensionRangeOptions = { + encode( + message: ExtensionRangeOptions, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ExtensionRangeOptions): unknown { + const obj: any = {}; + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial( + object: DeepPartial + ): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFieldDescriptorProto: object = { + name: "", + number: 0, + label: 1, + type: 1, + type_name: "", + extendee: "", + default_value: "", + oneof_index: 0, + json_name: "", + proto3_optional: false, +}; + +export const FieldDescriptorProto = { + encode( + message: FieldDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.type_name !== "") { + writer.uint32(50).string(message.type_name); + } + if (message.extendee !== "") { + writer.uint32(18).string(message.extendee); + } + if (message.default_value !== "") { + writer.uint32(58).string(message.default_value); + } + if (message.oneof_index !== 0) { + writer.uint32(72).int32(message.oneof_index); + } + if (message.json_name !== "") { + writer.uint32(82).string(message.json_name); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.proto3_optional === true) { + writer.uint32(136).bool(message.proto3_optional); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32() as any; + break; + case 5: + message.type = reader.int32() as any; + break; + case 6: + message.type_name = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.default_value = reader.string(); + break; + case 9: + message.oneof_index = reader.int32(); + break; + case 10: + message.json_name = reader.string(); + break; + case 8: + message.options = FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3_optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = fieldDescriptorProto_LabelFromJSON(object.label); + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = fieldDescriptorProto_TypeFromJSON(object.type); + } else { + message.type = 1; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.type_name = String(object.type_name); + } else { + message.type_name = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = String(object.extendee); + } else { + message.extendee = ""; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.default_value = String(object.default_value); + } else { + message.default_value = ""; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneof_index = Number(object.oneof_index); + } else { + message.oneof_index = 0; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.json_name = String(object.json_name); + } else { + message.json_name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.proto3_optional !== undefined && + object.proto3_optional !== null + ) { + message.proto3_optional = Boolean(object.proto3_optional); + } else { + message.proto3_optional = false; + } + return message; + }, + + toJSON(message: FieldDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.label !== undefined && + (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); + message.type !== undefined && + (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); + message.type_name !== undefined && (obj.type_name = message.type_name); + message.extendee !== undefined && (obj.extendee = message.extendee); + message.default_value !== undefined && + (obj.default_value = message.default_value); + message.oneof_index !== undefined && + (obj.oneof_index = message.oneof_index); + message.json_name !== undefined && (obj.json_name = message.json_name); + message.options !== undefined && + (obj.options = message.options + ? FieldOptions.toJSON(message.options) + : undefined); + message.proto3_optional !== undefined && + (obj.proto3_optional = message.proto3_optional); + return obj; + }, + + fromPartial(object: DeepPartial): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 1; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.type_name = object.type_name; + } else { + message.type_name = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } else { + message.extendee = ""; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.default_value = object.default_value; + } else { + message.default_value = ""; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneof_index = object.oneof_index; + } else { + message.oneof_index = 0; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.json_name = object.json_name; + } else { + message.json_name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.proto3_optional !== undefined && + object.proto3_optional !== null + ) { + message.proto3_optional = object.proto3_optional; + } else { + message.proto3_optional = false; + } + return message; + }, +}; + +const baseOneofDescriptorProto: object = { name: "" }; + +export const OneofDescriptorProto = { + encode( + message: OneofDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: OneofDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.options !== undefined && + (obj.options = message.options + ? OneofOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; + +export const EnumDescriptorProto = { + encode( + message: EnumDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reserved_range) { + EnumDescriptorProto_EnumReservedRange.encode( + v!, + writer.uint32(34).fork() + ).ldelim(); + } + for (const v of message.reserved_name) { + writer.uint32(42).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value.push( + EnumValueDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.options = EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.decode( + reader, + reader.uint32() + ) + ); + break; + case 5: + message.reserved_name.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.fromJSON(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(String(e)); + } + } + return message; + }, + + toJSON(message: EnumDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.value) { + obj.value = message.value.map((e) => + e ? EnumValueDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.value = []; + } + message.options !== undefined && + (obj.options = message.options + ? EnumOptions.toJSON(message.options) + : undefined); + if (message.reserved_range) { + obj.reserved_range = message.reserved_range.map((e) => + e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined + ); + } else { + obj.reserved_range = []; + } + if (message.reserved_name) { + obj.reserved_name = message.reserved_name.map((e) => e); + } else { + obj.reserved_name = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.fromPartial(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(e); + } + } + return message; + }, +}; + +const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; + +export const EnumDescriptorProto_EnumReservedRange = { + encode( + message: EnumDescriptorProto_EnumReservedRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): EnumDescriptorProto_EnumReservedRange { + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; + +export const EnumValueDescriptorProto = { + encode( + message: EnumValueDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode( + message.options, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): EnumValueDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumValueDescriptorProto { + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: EnumValueDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.options !== undefined && + (obj.options = message.options + ? EnumValueOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): EnumValueDescriptorProto { + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseServiceDescriptorProto: object = { name: "" }; + +export const ServiceDescriptorProto = { + encode( + message: ServiceDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.method.push( + MethodDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.options = ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: ServiceDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.method) { + obj.method = message.method.map((e) => + e ? MethodDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.method = []; + } + message.options !== undefined && + (obj.options = message.options + ? ServiceOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseMethodDescriptorProto: object = { + name: "", + input_type: "", + output_type: "", + client_streaming: false, + server_streaming: false, +}; + +export const MethodDescriptorProto = { + encode( + message: MethodDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.input_type !== "") { + writer.uint32(18).string(message.input_type); + } + if (message.output_type !== "") { + writer.uint32(26).string(message.output_type); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + if (message.client_streaming === true) { + writer.uint32(40).bool(message.client_streaming); + } + if (message.server_streaming === true) { + writer.uint32(48).bool(message.server_streaming); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.input_type = reader.string(); + break; + case 3: + message.output_type = reader.string(); + break; + case 4: + message.options = MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.client_streaming = reader.bool(); + break; + case 6: + message.server_streaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.input_type = String(object.input_type); + } else { + message.input_type = ""; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.output_type = String(object.output_type); + } else { + message.output_type = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.client_streaming !== undefined && + object.client_streaming !== null + ) { + message.client_streaming = Boolean(object.client_streaming); + } else { + message.client_streaming = false; + } + if ( + object.server_streaming !== undefined && + object.server_streaming !== null + ) { + message.server_streaming = Boolean(object.server_streaming); + } else { + message.server_streaming = false; + } + return message; + }, + + toJSON(message: MethodDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.input_type !== undefined && (obj.input_type = message.input_type); + message.output_type !== undefined && + (obj.output_type = message.output_type); + message.options !== undefined && + (obj.options = message.options + ? MethodOptions.toJSON(message.options) + : undefined); + message.client_streaming !== undefined && + (obj.client_streaming = message.client_streaming); + message.server_streaming !== undefined && + (obj.server_streaming = message.server_streaming); + return obj; + }, + + fromPartial( + object: DeepPartial + ): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.input_type = object.input_type; + } else { + message.input_type = ""; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.output_type = object.output_type; + } else { + message.output_type = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.client_streaming !== undefined && + object.client_streaming !== null + ) { + message.client_streaming = object.client_streaming; + } else { + message.client_streaming = false; + } + if ( + object.server_streaming !== undefined && + object.server_streaming !== null + ) { + message.server_streaming = object.server_streaming; + } else { + message.server_streaming = false; + } + return message; + }, +}; + +const baseFileOptions: object = { + java_package: "", + java_outer_classname: "", + java_multiple_files: false, + java_generate_equals_and_hash: false, + java_string_check_utf8: false, + optimize_for: 1, + go_package: "", + cc_generic_services: false, + java_generic_services: false, + py_generic_services: false, + php_generic_services: false, + deprecated: false, + cc_enable_arenas: false, + objc_class_prefix: "", + csharp_namespace: "", + swift_prefix: "", + php_class_prefix: "", + php_namespace: "", + php_metadata_namespace: "", + ruby_package: "", +}; + +export const FileOptions = { + encode(message: FileOptions, writer: Writer = Writer.create()): Writer { + if (message.java_package !== "") { + writer.uint32(10).string(message.java_package); + } + if (message.java_outer_classname !== "") { + writer.uint32(66).string(message.java_outer_classname); + } + if (message.java_multiple_files === true) { + writer.uint32(80).bool(message.java_multiple_files); + } + if (message.java_generate_equals_and_hash === true) { + writer.uint32(160).bool(message.java_generate_equals_and_hash); + } + if (message.java_string_check_utf8 === true) { + writer.uint32(216).bool(message.java_string_check_utf8); + } + if (message.optimize_for !== 1) { + writer.uint32(72).int32(message.optimize_for); + } + if (message.go_package !== "") { + writer.uint32(90).string(message.go_package); + } + if (message.cc_generic_services === true) { + writer.uint32(128).bool(message.cc_generic_services); + } + if (message.java_generic_services === true) { + writer.uint32(136).bool(message.java_generic_services); + } + if (message.py_generic_services === true) { + writer.uint32(144).bool(message.py_generic_services); + } + if (message.php_generic_services === true) { + writer.uint32(336).bool(message.php_generic_services); + } + if (message.deprecated === true) { + writer.uint32(184).bool(message.deprecated); + } + if (message.cc_enable_arenas === true) { + writer.uint32(248).bool(message.cc_enable_arenas); + } + if (message.objc_class_prefix !== "") { + writer.uint32(290).string(message.objc_class_prefix); + } + if (message.csharp_namespace !== "") { + writer.uint32(298).string(message.csharp_namespace); + } + if (message.swift_prefix !== "") { + writer.uint32(314).string(message.swift_prefix); + } + if (message.php_class_prefix !== "") { + writer.uint32(322).string(message.php_class_prefix); + } + if (message.php_namespace !== "") { + writer.uint32(330).string(message.php_namespace); + } + if (message.php_metadata_namespace !== "") { + writer.uint32(354).string(message.php_metadata_namespace); + } + if (message.ruby_package !== "") { + writer.uint32(362).string(message.ruby_package); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.java_package = reader.string(); + break; + case 8: + message.java_outer_classname = reader.string(); + break; + case 10: + message.java_multiple_files = reader.bool(); + break; + case 20: + message.java_generate_equals_and_hash = reader.bool(); + break; + case 27: + message.java_string_check_utf8 = reader.bool(); + break; + case 9: + message.optimize_for = reader.int32() as any; + break; + case 11: + message.go_package = reader.string(); + break; + case 16: + message.cc_generic_services = reader.bool(); + break; + case 17: + message.java_generic_services = reader.bool(); + break; + case 18: + message.py_generic_services = reader.bool(); + break; + case 42: + message.php_generic_services = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.cc_enable_arenas = reader.bool(); + break; + case 36: + message.objc_class_prefix = reader.string(); + break; + case 37: + message.csharp_namespace = reader.string(); + break; + case 39: + message.swift_prefix = reader.string(); + break; + case 40: + message.php_class_prefix = reader.string(); + break; + case 41: + message.php_namespace = reader.string(); + break; + case 44: + message.php_metadata_namespace = reader.string(); + break; + case 45: + message.ruby_package = reader.string(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + if (object.java_package !== undefined && object.java_package !== null) { + message.java_package = String(object.java_package); + } else { + message.java_package = ""; + } + if ( + object.java_outer_classname !== undefined && + object.java_outer_classname !== null + ) { + message.java_outer_classname = String(object.java_outer_classname); + } else { + message.java_outer_classname = ""; + } + if ( + object.java_multiple_files !== undefined && + object.java_multiple_files !== null + ) { + message.java_multiple_files = Boolean(object.java_multiple_files); + } else { + message.java_multiple_files = false; + } + if ( + object.java_generate_equals_and_hash !== undefined && + object.java_generate_equals_and_hash !== null + ) { + message.java_generate_equals_and_hash = Boolean( + object.java_generate_equals_and_hash + ); + } else { + message.java_generate_equals_and_hash = false; + } + if ( + object.java_string_check_utf8 !== undefined && + object.java_string_check_utf8 !== null + ) { + message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); + } else { + message.java_string_check_utf8 = false; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimize_for = fileOptions_OptimizeModeFromJSON( + object.optimize_for + ); + } else { + message.optimize_for = 1; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.go_package = String(object.go_package); + } else { + message.go_package = ""; + } + if ( + object.cc_generic_services !== undefined && + object.cc_generic_services !== null + ) { + message.cc_generic_services = Boolean(object.cc_generic_services); + } else { + message.cc_generic_services = false; + } + if ( + object.java_generic_services !== undefined && + object.java_generic_services !== null + ) { + message.java_generic_services = Boolean(object.java_generic_services); + } else { + message.java_generic_services = false; + } + if ( + object.py_generic_services !== undefined && + object.py_generic_services !== null + ) { + message.py_generic_services = Boolean(object.py_generic_services); + } else { + message.py_generic_services = false; + } + if ( + object.php_generic_services !== undefined && + object.php_generic_services !== null + ) { + message.php_generic_services = Boolean(object.php_generic_services); + } else { + message.php_generic_services = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.cc_enable_arenas !== undefined && + object.cc_enable_arenas !== null + ) { + message.cc_enable_arenas = Boolean(object.cc_enable_arenas); + } else { + message.cc_enable_arenas = false; + } + if ( + object.objc_class_prefix !== undefined && + object.objc_class_prefix !== null + ) { + message.objc_class_prefix = String(object.objc_class_prefix); + } else { + message.objc_class_prefix = ""; + } + if ( + object.csharp_namespace !== undefined && + object.csharp_namespace !== null + ) { + message.csharp_namespace = String(object.csharp_namespace); + } else { + message.csharp_namespace = ""; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swift_prefix = String(object.swift_prefix); + } else { + message.swift_prefix = ""; + } + if ( + object.php_class_prefix !== undefined && + object.php_class_prefix !== null + ) { + message.php_class_prefix = String(object.php_class_prefix); + } else { + message.php_class_prefix = ""; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.php_namespace = String(object.php_namespace); + } else { + message.php_namespace = ""; + } + if ( + object.php_metadata_namespace !== undefined && + object.php_metadata_namespace !== null + ) { + message.php_metadata_namespace = String(object.php_metadata_namespace); + } else { + message.php_metadata_namespace = ""; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.ruby_package = String(object.ruby_package); + } else { + message.ruby_package = ""; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FileOptions): unknown { + const obj: any = {}; + message.java_package !== undefined && + (obj.java_package = message.java_package); + message.java_outer_classname !== undefined && + (obj.java_outer_classname = message.java_outer_classname); + message.java_multiple_files !== undefined && + (obj.java_multiple_files = message.java_multiple_files); + message.java_generate_equals_and_hash !== undefined && + (obj.java_generate_equals_and_hash = + message.java_generate_equals_and_hash); + message.java_string_check_utf8 !== undefined && + (obj.java_string_check_utf8 = message.java_string_check_utf8); + message.optimize_for !== undefined && + (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); + message.go_package !== undefined && (obj.go_package = message.go_package); + message.cc_generic_services !== undefined && + (obj.cc_generic_services = message.cc_generic_services); + message.java_generic_services !== undefined && + (obj.java_generic_services = message.java_generic_services); + message.py_generic_services !== undefined && + (obj.py_generic_services = message.py_generic_services); + message.php_generic_services !== undefined && + (obj.php_generic_services = message.php_generic_services); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.cc_enable_arenas !== undefined && + (obj.cc_enable_arenas = message.cc_enable_arenas); + message.objc_class_prefix !== undefined && + (obj.objc_class_prefix = message.objc_class_prefix); + message.csharp_namespace !== undefined && + (obj.csharp_namespace = message.csharp_namespace); + message.swift_prefix !== undefined && + (obj.swift_prefix = message.swift_prefix); + message.php_class_prefix !== undefined && + (obj.php_class_prefix = message.php_class_prefix); + message.php_namespace !== undefined && + (obj.php_namespace = message.php_namespace); + message.php_metadata_namespace !== undefined && + (obj.php_metadata_namespace = message.php_metadata_namespace); + message.ruby_package !== undefined && + (obj.ruby_package = message.ruby_package); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + if (object.java_package !== undefined && object.java_package !== null) { + message.java_package = object.java_package; + } else { + message.java_package = ""; + } + if ( + object.java_outer_classname !== undefined && + object.java_outer_classname !== null + ) { + message.java_outer_classname = object.java_outer_classname; + } else { + message.java_outer_classname = ""; + } + if ( + object.java_multiple_files !== undefined && + object.java_multiple_files !== null + ) { + message.java_multiple_files = object.java_multiple_files; + } else { + message.java_multiple_files = false; + } + if ( + object.java_generate_equals_and_hash !== undefined && + object.java_generate_equals_and_hash !== null + ) { + message.java_generate_equals_and_hash = + object.java_generate_equals_and_hash; + } else { + message.java_generate_equals_and_hash = false; + } + if ( + object.java_string_check_utf8 !== undefined && + object.java_string_check_utf8 !== null + ) { + message.java_string_check_utf8 = object.java_string_check_utf8; + } else { + message.java_string_check_utf8 = false; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimize_for = object.optimize_for; + } else { + message.optimize_for = 1; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.go_package = object.go_package; + } else { + message.go_package = ""; + } + if ( + object.cc_generic_services !== undefined && + object.cc_generic_services !== null + ) { + message.cc_generic_services = object.cc_generic_services; + } else { + message.cc_generic_services = false; + } + if ( + object.java_generic_services !== undefined && + object.java_generic_services !== null + ) { + message.java_generic_services = object.java_generic_services; + } else { + message.java_generic_services = false; + } + if ( + object.py_generic_services !== undefined && + object.py_generic_services !== null + ) { + message.py_generic_services = object.py_generic_services; + } else { + message.py_generic_services = false; + } + if ( + object.php_generic_services !== undefined && + object.php_generic_services !== null + ) { + message.php_generic_services = object.php_generic_services; + } else { + message.php_generic_services = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.cc_enable_arenas !== undefined && + object.cc_enable_arenas !== null + ) { + message.cc_enable_arenas = object.cc_enable_arenas; + } else { + message.cc_enable_arenas = false; + } + if ( + object.objc_class_prefix !== undefined && + object.objc_class_prefix !== null + ) { + message.objc_class_prefix = object.objc_class_prefix; + } else { + message.objc_class_prefix = ""; + } + if ( + object.csharp_namespace !== undefined && + object.csharp_namespace !== null + ) { + message.csharp_namespace = object.csharp_namespace; + } else { + message.csharp_namespace = ""; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swift_prefix = object.swift_prefix; + } else { + message.swift_prefix = ""; + } + if ( + object.php_class_prefix !== undefined && + object.php_class_prefix !== null + ) { + message.php_class_prefix = object.php_class_prefix; + } else { + message.php_class_prefix = ""; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.php_namespace = object.php_namespace; + } else { + message.php_namespace = ""; + } + if ( + object.php_metadata_namespace !== undefined && + object.php_metadata_namespace !== null + ) { + message.php_metadata_namespace = object.php_metadata_namespace; + } else { + message.php_metadata_namespace = ""; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.ruby_package = object.ruby_package; + } else { + message.ruby_package = ""; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMessageOptions: object = { + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + deprecated: false, + map_entry: false, +}; + +export const MessageOptions = { + encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { + if (message.message_set_wire_format === true) { + writer.uint32(8).bool(message.message_set_wire_format); + } + if (message.no_standard_descriptor_accessor === true) { + writer.uint32(16).bool(message.no_standard_descriptor_accessor); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.map_entry === true) { + writer.uint32(56).bool(message.map_entry); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message_set_wire_format = reader.bool(); + break; + case 2: + message.no_standard_descriptor_accessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.map_entry = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + if ( + object.message_set_wire_format !== undefined && + object.message_set_wire_format !== null + ) { + message.message_set_wire_format = Boolean(object.message_set_wire_format); + } else { + message.message_set_wire_format = false; + } + if ( + object.no_standard_descriptor_accessor !== undefined && + object.no_standard_descriptor_accessor !== null + ) { + message.no_standard_descriptor_accessor = Boolean( + object.no_standard_descriptor_accessor + ); + } else { + message.no_standard_descriptor_accessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.map_entry = Boolean(object.map_entry); + } else { + message.map_entry = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MessageOptions): unknown { + const obj: any = {}; + message.message_set_wire_format !== undefined && + (obj.message_set_wire_format = message.message_set_wire_format); + message.no_standard_descriptor_accessor !== undefined && + (obj.no_standard_descriptor_accessor = + message.no_standard_descriptor_accessor); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.map_entry !== undefined && (obj.map_entry = message.map_entry); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + if ( + object.message_set_wire_format !== undefined && + object.message_set_wire_format !== null + ) { + message.message_set_wire_format = object.message_set_wire_format; + } else { + message.message_set_wire_format = false; + } + if ( + object.no_standard_descriptor_accessor !== undefined && + object.no_standard_descriptor_accessor !== null + ) { + message.no_standard_descriptor_accessor = + object.no_standard_descriptor_accessor; + } else { + message.no_standard_descriptor_accessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.map_entry = object.map_entry; + } else { + message.map_entry = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFieldOptions: object = { + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + deprecated: false, + weak: false, +}; + +export const FieldOptions = { + encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + if (message.ctype !== 0) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed === true) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== 0) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy === true) { + writer.uint32(40).bool(message.lazy); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak === true) { + writer.uint32(80).bool(message.weak); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32() as any; + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32() as any; + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = fieldOptions_CTypeFromJSON(object.ctype); + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = Boolean(object.packed); + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = Boolean(object.lazy); + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = Boolean(object.weak); + } else { + message.weak = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FieldOptions): unknown { + const obj: any = {}; + message.ctype !== undefined && + (obj.ctype = fieldOptions_CTypeToJSON(message.ctype)); + message.packed !== undefined && (obj.packed = message.packed); + message.jstype !== undefined && + (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); + message.lazy !== undefined && (obj.lazy = message.lazy); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.weak !== undefined && (obj.weak = message.weak); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = object.ctype; + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = object.jstype; + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } else { + message.weak = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseOneofOptions: object = {}; + +export const OneofOptions = { + encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: OneofOptions): unknown { + const obj: any = {}; + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseEnumOptions: object = { allow_alias: false, deprecated: false }; + +export const EnumOptions = { + encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { + if (message.allow_alias === true) { + writer.uint32(16).bool(message.allow_alias); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allow_alias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allow_alias = Boolean(object.allow_alias); + } else { + message.allow_alias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: EnumOptions): unknown { + const obj: any = {}; + message.allow_alias !== undefined && + (obj.allow_alias = message.allow_alias); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allow_alias = object.allow_alias; + } else { + message.allow_alias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseEnumValueOptions: object = { deprecated: false }; + +export const EnumValueOptions = { + encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(8).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: EnumValueOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseServiceOptions: object = { deprecated: false }; + +export const ServiceOptions = { + encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ServiceOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; + +export const MethodOptions = { + encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + if (message.idempotency_level !== 0) { + writer.uint32(272).int32(message.idempotency_level); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotency_level = reader.int32() as any; + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.idempotency_level !== undefined && + object.idempotency_level !== null + ) { + message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( + object.idempotency_level + ); + } else { + message.idempotency_level = 0; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MethodOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.idempotency_level !== undefined && + (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( + message.idempotency_level + )); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.idempotency_level !== undefined && + object.idempotency_level !== null + ) { + message.idempotency_level = object.idempotency_level; + } else { + message.idempotency_level = 0; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseUninterpretedOption: object = { + identifier_value: "", + positive_int_value: 0, + negative_int_value: 0, + double_value: 0, + aggregate_value: "", +}; + +export const UninterpretedOption = { + encode( + message: UninterpretedOption, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.name) { + UninterpretedOption_NamePart.encode( + v!, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.identifier_value !== "") { + writer.uint32(26).string(message.identifier_value); + } + if (message.positive_int_value !== 0) { + writer.uint32(32).uint64(message.positive_int_value); + } + if (message.negative_int_value !== 0) { + writer.uint32(40).int64(message.negative_int_value); + } + if (message.double_value !== 0) { + writer.uint32(49).double(message.double_value); + } + if (message.string_value.length !== 0) { + writer.uint32(58).bytes(message.string_value); + } + if (message.aggregate_value !== "") { + writer.uint32(66).string(message.aggregate_value); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.name.push( + UninterpretedOption_NamePart.decode(reader, reader.uint32()) + ); + break; + case 3: + message.identifier_value = reader.string(); + break; + case 4: + message.positive_int_value = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negative_int_value = longToNumber(reader.int64() as Long); + break; + case 6: + message.double_value = reader.double(); + break; + case 7: + message.string_value = reader.bytes(); + break; + case 8: + message.aggregate_value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromJSON(e)); + } + } + if ( + object.identifier_value !== undefined && + object.identifier_value !== null + ) { + message.identifier_value = String(object.identifier_value); + } else { + message.identifier_value = ""; + } + if ( + object.positive_int_value !== undefined && + object.positive_int_value !== null + ) { + message.positive_int_value = Number(object.positive_int_value); + } else { + message.positive_int_value = 0; + } + if ( + object.negative_int_value !== undefined && + object.negative_int_value !== null + ) { + message.negative_int_value = Number(object.negative_int_value); + } else { + message.negative_int_value = 0; + } + if (object.double_value !== undefined && object.double_value !== null) { + message.double_value = Number(object.double_value); + } else { + message.double_value = 0; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.string_value = bytesFromBase64(object.string_value); + } + if ( + object.aggregate_value !== undefined && + object.aggregate_value !== null + ) { + message.aggregate_value = String(object.aggregate_value); + } else { + message.aggregate_value = ""; + } + return message; + }, + + toJSON(message: UninterpretedOption): unknown { + const obj: any = {}; + if (message.name) { + obj.name = message.name.map((e) => + e ? UninterpretedOption_NamePart.toJSON(e) : undefined + ); + } else { + obj.name = []; + } + message.identifier_value !== undefined && + (obj.identifier_value = message.identifier_value); + message.positive_int_value !== undefined && + (obj.positive_int_value = message.positive_int_value); + message.negative_int_value !== undefined && + (obj.negative_int_value = message.negative_int_value); + message.double_value !== undefined && + (obj.double_value = message.double_value); + message.string_value !== undefined && + (obj.string_value = base64FromBytes( + message.string_value !== undefined + ? message.string_value + : new Uint8Array() + )); + message.aggregate_value !== undefined && + (obj.aggregate_value = message.aggregate_value); + return obj; + }, + + fromPartial(object: DeepPartial): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromPartial(e)); + } + } + if ( + object.identifier_value !== undefined && + object.identifier_value !== null + ) { + message.identifier_value = object.identifier_value; + } else { + message.identifier_value = ""; + } + if ( + object.positive_int_value !== undefined && + object.positive_int_value !== null + ) { + message.positive_int_value = object.positive_int_value; + } else { + message.positive_int_value = 0; + } + if ( + object.negative_int_value !== undefined && + object.negative_int_value !== null + ) { + message.negative_int_value = object.negative_int_value; + } else { + message.negative_int_value = 0; + } + if (object.double_value !== undefined && object.double_value !== null) { + message.double_value = object.double_value; + } else { + message.double_value = 0; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.string_value = object.string_value; + } else { + message.string_value = new Uint8Array(); + } + if ( + object.aggregate_value !== undefined && + object.aggregate_value !== null + ) { + message.aggregate_value = object.aggregate_value; + } else { + message.aggregate_value = ""; + } + return message; + }, +}; + +const baseUninterpretedOption_NamePart: object = { + name_part: "", + is_extension: false, +}; + +export const UninterpretedOption_NamePart = { + encode( + message: UninterpretedOption_NamePart, + writer: Writer = Writer.create() + ): Writer { + if (message.name_part !== "") { + writer.uint32(10).string(message.name_part); + } + if (message.is_extension === true) { + writer.uint32(16).bool(message.is_extension); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): UninterpretedOption_NamePart { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name_part = reader.string(); + break; + case 2: + message.is_extension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninterpretedOption_NamePart { + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + if (object.name_part !== undefined && object.name_part !== null) { + message.name_part = String(object.name_part); + } else { + message.name_part = ""; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.is_extension = Boolean(object.is_extension); + } else { + message.is_extension = false; + } + return message; + }, + + toJSON(message: UninterpretedOption_NamePart): unknown { + const obj: any = {}; + message.name_part !== undefined && (obj.name_part = message.name_part); + message.is_extension !== undefined && + (obj.is_extension = message.is_extension); + return obj; + }, + + fromPartial( + object: DeepPartial + ): UninterpretedOption_NamePart { + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + if (object.name_part !== undefined && object.name_part !== null) { + message.name_part = object.name_part; + } else { + message.name_part = ""; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.is_extension = object.is_extension; + } else { + message.is_extension = false; + } + return message; + }, +}; + +const baseSourceCodeInfo: object = {}; + +export const SourceCodeInfo = { + encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location.push( + SourceCodeInfo_Location.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: SourceCodeInfo): unknown { + const obj: any = {}; + if (message.location) { + obj.location = message.location.map((e) => + e ? SourceCodeInfo_Location.toJSON(e) : undefined + ); + } else { + obj.location = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromPartial(e)); + } + } + return message; + }, +}; + +const baseSourceCodeInfo_Location: object = { + path: 0, + span: 0, + leading_comments: "", + trailing_comments: "", + leading_detached_comments: "", +}; + +export const SourceCodeInfo_Location = { + encode( + message: SourceCodeInfo_Location, + writer: Writer = Writer.create() + ): Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + if (message.leading_comments !== "") { + writer.uint32(26).string(message.leading_comments); + } + if (message.trailing_comments !== "") { + writer.uint32(34).string(message.trailing_comments); + } + for (const v of message.leading_detached_comments) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + } else { + message.span.push(reader.int32()); + } + break; + case 3: + message.leading_comments = reader.string(); + break; + case 4: + message.trailing_comments = reader.string(); + break; + case 6: + message.leading_detached_comments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo_Location { + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(Number(e)); + } + } + if ( + object.leading_comments !== undefined && + object.leading_comments !== null + ) { + message.leading_comments = String(object.leading_comments); + } else { + message.leading_comments = ""; + } + if ( + object.trailing_comments !== undefined && + object.trailing_comments !== null + ) { + message.trailing_comments = String(object.trailing_comments); + } else { + message.trailing_comments = ""; + } + if ( + object.leading_detached_comments !== undefined && + object.leading_detached_comments !== null + ) { + for (const e of object.leading_detached_comments) { + message.leading_detached_comments.push(String(e)); + } + } + return message; + }, + + toJSON(message: SourceCodeInfo_Location): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + if (message.span) { + obj.span = message.span.map((e) => e); + } else { + obj.span = []; + } + message.leading_comments !== undefined && + (obj.leading_comments = message.leading_comments); + message.trailing_comments !== undefined && + (obj.trailing_comments = message.trailing_comments); + if (message.leading_detached_comments) { + obj.leading_detached_comments = message.leading_detached_comments.map( + (e) => e + ); + } else { + obj.leading_detached_comments = []; + } + return obj; + }, + + fromPartial( + object: DeepPartial + ): SourceCodeInfo_Location { + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(e); + } + } + if ( + object.leading_comments !== undefined && + object.leading_comments !== null + ) { + message.leading_comments = object.leading_comments; + } else { + message.leading_comments = ""; + } + if ( + object.trailing_comments !== undefined && + object.trailing_comments !== null + ) { + message.trailing_comments = object.trailing_comments; + } else { + message.trailing_comments = ""; + } + if ( + object.leading_detached_comments !== undefined && + object.leading_detached_comments !== null + ) { + for (const e of object.leading_detached_comments) { + message.leading_detached_comments.push(e); + } + } + return message; + }, +}; + +const baseGeneratedCodeInfo: object = {}; + +export const GeneratedCodeInfo = { + encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode( + v!, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annotation.push( + GeneratedCodeInfo_Annotation.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: GeneratedCodeInfo): unknown { + const obj: any = {}; + if (message.annotation) { + obj.annotation = message.annotation.map((e) => + e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined + ); + } else { + obj.annotation = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); + } + } + return message; + }, +}; + +const baseGeneratedCodeInfo_Annotation: object = { + path: 0, + source_file: "", + begin: 0, + end: 0, +}; + +export const GeneratedCodeInfo_Annotation = { + encode( + message: GeneratedCodeInfo_Annotation, + writer: Writer = Writer.create() + ): Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + if (message.source_file !== "") { + writer.uint32(18).string(message.source_file); + } + if (message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== 0) { + writer.uint32(32).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): GeneratedCodeInfo_Annotation { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + message.source_file = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo_Annotation { + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.source_file !== undefined && object.source_file !== null) { + message.source_file = String(object.source_file); + } else { + message.source_file = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = Number(object.begin); + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: GeneratedCodeInfo_Annotation): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + message.source_file !== undefined && + (obj.source_file = message.source_file); + message.begin !== undefined && (obj.begin = message.begin); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): GeneratedCodeInfo_Annotation { + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.source_file !== undefined && object.source_file !== null) { + message.source_file = object.source_file; + } else { + message.source_file = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/package.json b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/package.json new file mode 100755 index 00000000..b749c8ca --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/package.json @@ -0,0 +1,18 @@ +{ + "name": "bze-burner-v1-js", + "version": "0.1.0", + "description": "Autogenerated vuex store for Cosmos module bze.burner.v1", + "author": "Starport Codegen ", + "homepage": "http://github.com/bze-alphateam/bze/x/burner/types", + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "main": "index.js", + "publishConfig": { + "access": "public" + } +} \ No newline at end of file diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/vuex-root b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/vuex-root new file mode 100755 index 00000000..0fcc121a --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/vuex-root @@ -0,0 +1 @@ +THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts index 5b8bf214..b6a73523 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts @@ -4,14 +4,13 @@ import { AcceptedDomain } from "./module/types/cointrunk/accepted_domain" import { AcceptedDomainProposal } from "./module/types/cointrunk/accepted_domain_proposal" import { AnonArticlesCounter } from "./module/types/cointrunk/anon_articles_counter" import { Article } from "./module/types/cointrunk/article" -import { BurnCoinsProposal } from "./module/types/cointrunk/burn_coins_proposal" import { BurnedCoins } from "./module/types/cointrunk/burned_coins" import { Params } from "./module/types/cointrunk/params" import { Publisher } from "./module/types/cointrunk/publisher" import { PublisherProposal } from "./module/types/cointrunk/publisher_proposal" -export { AcceptedDomain, AcceptedDomainProposal, AnonArticlesCounter, Article, BurnCoinsProposal, BurnedCoins, Params, Publisher, PublisherProposal }; +export { AcceptedDomain, AcceptedDomainProposal, AnonArticlesCounter, Article, BurnedCoins, Params, Publisher, PublisherProposal }; async function initTxClient(vuexGetters) { return await txClient(vuexGetters['common/wallet/signer'], { @@ -62,7 +61,6 @@ const getDefaultState = () => { AcceptedDomainProposal: getStructure(AcceptedDomainProposal.fromPartial({})), AnonArticlesCounter: getStructure(AnonArticlesCounter.fromPartial({})), Article: getStructure(Article.fromPartial({})), - BurnCoinsProposal: getStructure(BurnCoinsProposal.fromPartial({})), BurnedCoins: getStructure(BurnedCoins.fromPartial({})), Params: getStructure(Params.fromPartial({})), Publisher: getStructure(Publisher.fromPartial({})), diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 0a633940..40cc1ba4 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -247,33 +247,33 @@ export default { } } }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgSubmitScavenge(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgRevealSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -291,29 +291,29 @@ export default { } } }, - async MsgRevealSolution({ rootGetters }, { value }) { + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgSubmitScavenge(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgRevealSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 44bd4fda..c023b54d 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -5,14 +5,14 @@ import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; import { MsgCommitSolution } from "./types/scavenge/tx"; -import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; +import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -46,8 +46,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; }; diff --git a/vue/src/store/generated/index.ts b/vue/src/store/generated/index.ts index 69aa8028..2dba3faf 100755 --- a/vue/src/store/generated/index.ts +++ b/vue/src/store/generated/index.ts @@ -1,5 +1,6 @@ // THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. +import BzeAlphateamBzeBzeBurnerV1 from './bze-alphateam/bze/bze.burner.v1' import BzeAlphateamBzeBzeCointrunk from './bze-alphateam/bze/bze.cointrunk' import BzeAlphateamBzeBzeScavenge from './bze-alphateam/bze/bze.scavenge' import BzeAlphateamBzeBzealphateamBzeBurner from './bze-alphateam/bze/bzealphateam.bze.burner' @@ -18,6 +19,7 @@ import CosmosIbcGoIbcApplicationsTransferV1 from './cosmos/ibc-go/ibc.applicatio export default { + BzeAlphateamBzeBzeBurnerV1: load(BzeAlphateamBzeBzeBurnerV1, 'bze.burner.v1'), BzeAlphateamBzeBzeCointrunk: load(BzeAlphateamBzeBzeCointrunk, 'bze.cointrunk'), BzeAlphateamBzeBzeScavenge: load(BzeAlphateamBzeBzeScavenge, 'bze.scavenge'), BzeAlphateamBzeBzealphateamBzeBurner: load(BzeAlphateamBzeBzealphateamBzeBurner, 'bzealphateam.bze.burner'), diff --git a/x/burner/client/cli/gov.go b/x/burner/client/cli/gov.go new file mode 100644 index 00000000..2436ce1d --- /dev/null +++ b/x/burner/client/cli/gov.go @@ -0,0 +1,70 @@ +package cli + +import ( + "github.com/bze-alphateam/bze/x/burner/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + govcli "github.com/cosmos/cosmos-sdk/x/gov/client/cli" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/spf13/cobra" +) + +const ( + ActiveFlag = "active" +) + +func NewCmdSubmitBurnCoinsProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "burn-coins", + Args: cobra.ExactArgs(0), + Short: "Submit coins burning proposal", + Long: "Submit coins burning proposal along with an initial deposit.\n", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + title, err := cmd.Flags().GetString(govcli.FlagTitle) + if err != nil { + return err + } + + description, err := cmd.Flags().GetString(govcli.FlagDescription) + if err != nil { + return err + } + + content := types.NewBurnCoinsProposal(title, description) + + from := clientCtx.GetFromAddress() + + depositStr, err := cmd.Flags().GetString(govcli.FlagDeposit) + if err != nil { + return err + } + deposit, err := sdk.ParseCoinsNormalized(depositStr) + if err != nil { + return err + } + + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + if err = msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().String(govcli.FlagTitle, "", "title of proposal") + cmd.Flags().String(govcli.FlagDescription, "", "description of proposal") + cmd.Flags().String(govcli.FlagDeposit, "", "deposit of proposal") + + return cmd +} diff --git a/x/burner/client/proposal_handler.go b/x/burner/client/proposal_handler.go new file mode 100644 index 00000000..20dab322 --- /dev/null +++ b/x/burner/client/proposal_handler.go @@ -0,0 +1,21 @@ +package client + +import ( + "github.com/bze-alphateam/bze/x/burner/client/cli" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/types/rest" + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" + govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest" + "net/http" +) + +var BurnCoinsProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitBurnCoinsProposal, emptyRestHandler) + +func emptyRestHandler(client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "unsupported-burner", + Handler: func(w http.ResponseWriter, r *http.Request) { + rest.WriteErrorResponse(w, http.StatusBadRequest, "Legacy REST Routes are not supported for Burner proposals") + }, + } +} diff --git a/x/burner/keeper/gov.go b/x/burner/keeper/gov.go new file mode 100644 index 00000000..dc5a9e0b --- /dev/null +++ b/x/burner/keeper/gov.go @@ -0,0 +1,28 @@ +package keeper + +import ( + "github.com/bze-alphateam/bze/x/burner/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) HandleBurnCoinsProposal(ctx sdk.Context, proposal *types.BurnCoinsProposal) error { + moduleAcc := k.accKeeper.GetModuleAccount(ctx, types.ModuleName) + coins := k.bankKeeper.GetAllBalances(ctx, moduleAcc.GetAddress()) + if coins.IsZero() { + //nothing to burn at this moment + return nil + } + + err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, coins) + if err != nil { + panic(err) + } + + //var burnedCoins = types.BurnedCoins{ + // Burned: coins.String(), + // Height: strconv.FormatInt(ctx.BlockHeader().Height, 10), + //} + //k.SetBurnedCoins(ctx, burnedCoins) + + return nil +} diff --git a/x/burner/proposal_handler.go b/x/burner/proposal_handler.go new file mode 100644 index 00000000..bfade5da --- /dev/null +++ b/x/burner/proposal_handler.go @@ -0,0 +1,20 @@ +package burner + +import ( + "github.com/bze-alphateam/bze/x/burner/keeper" + "github.com/bze-alphateam/bze/x/burner/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +func NewBurnerProposalHandler(k keeper.Keeper) govtypes.Handler { + return func(ctx sdk.Context, content govtypes.Content) error { + switch c := content.(type) { + case *types.BurnCoinsProposal: + return k.HandleBurnCoinsProposal(ctx, c) + default: + return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized burner proposal content type: %T", c) + } + } +} diff --git a/x/burner/types/burn_coins_proposal.pb.go b/x/burner/types/burn_coins_proposal.pb.go new file mode 100644 index 00000000..e83afe69 --- /dev/null +++ b/x/burner/types/burn_coins_proposal.pb.go @@ -0,0 +1,367 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: burner/burn_coins_proposal.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/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 BurnCoinsProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (m *BurnCoinsProposal) Reset() { *m = BurnCoinsProposal{} } +func (m *BurnCoinsProposal) String() string { return proto.CompactTextString(m) } +func (*BurnCoinsProposal) ProtoMessage() {} +func (*BurnCoinsProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_69096e424f9a1e06, []int{0} +} +func (m *BurnCoinsProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BurnCoinsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BurnCoinsProposal.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 *BurnCoinsProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_BurnCoinsProposal.Merge(m, src) +} +func (m *BurnCoinsProposal) XXX_Size() int { + return m.Size() +} +func (m *BurnCoinsProposal) XXX_DiscardUnknown() { + xxx_messageInfo_BurnCoinsProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_BurnCoinsProposal proto.InternalMessageInfo + +func (m *BurnCoinsProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *BurnCoinsProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func init() { + proto.RegisterType((*BurnCoinsProposal)(nil), "bze.burner.v1.BurnCoinsProposal") +} + +func init() { proto.RegisterFile("burner/burn_coins_proposal.proto", fileDescriptor_69096e424f9a1e06) } + +var fileDescriptor_69096e424f9a1e06 = []byte{ + // 189 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0x2a, 0x2d, 0xca, + 0x4b, 0x2d, 0xd2, 0x07, 0x51, 0xf1, 0xc9, 0xf9, 0x99, 0x79, 0xc5, 0xf1, 0x05, 0x45, 0xf9, 0x05, + 0xf9, 0xc5, 0x89, 0x39, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xbc, 0x49, 0x55, 0xa9, 0x7a, + 0x10, 0x55, 0x7a, 0x65, 0x86, 0x4a, 0xde, 0x5c, 0x82, 0x4e, 0xa5, 0x45, 0x79, 0xce, 0x20, 0xa5, + 0x01, 0x50, 0x95, 0x42, 0x22, 0x5c, 0xac, 0x25, 0x99, 0x25, 0x39, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, + 0x1a, 0x9c, 0x41, 0x10, 0x8e, 0x90, 0x02, 0x17, 0x77, 0x4a, 0x6a, 0x71, 0x72, 0x51, 0x66, 0x41, + 0x49, 0x66, 0x7e, 0x9e, 0x04, 0x13, 0x58, 0x0e, 0x59, 0xc8, 0xc9, 0xf5, 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, 0xb4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, + 0x73, 0xf5, 0x93, 0xaa, 0x52, 0x75, 0x13, 0x73, 0x0a, 0x32, 0x12, 0x4b, 0x52, 0x13, 0xc1, 0x3c, + 0xfd, 0x0a, 0x7d, 0xa8, 0xb3, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x2e, 0x35, 0x06, + 0x04, 0x00, 0x00, 0xff, 0xff, 0x9d, 0x26, 0x8f, 0x50, 0xcd, 0x00, 0x00, 0x00, +} + +func (m *BurnCoinsProposal) 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 *BurnCoinsProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BurnCoinsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintBurnCoinsProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintBurnCoinsProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintBurnCoinsProposal(dAtA []byte, offset int, v uint64) int { + offset -= sovBurnCoinsProposal(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BurnCoinsProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovBurnCoinsProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovBurnCoinsProposal(uint64(l)) + } + return n +} + +func sovBurnCoinsProposal(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBurnCoinsProposal(x uint64) (n int) { + return sovBurnCoinsProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BurnCoinsProposal) 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 ErrIntOverflowBurnCoinsProposal + } + 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: BurnCoinsProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BurnCoinsProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBurnCoinsProposal + } + 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 ErrInvalidLengthBurnCoinsProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBurnCoinsProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBurnCoinsProposal + } + 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 ErrInvalidLengthBurnCoinsProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBurnCoinsProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBurnCoinsProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBurnCoinsProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBurnCoinsProposal(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, ErrIntOverflowBurnCoinsProposal + } + 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, ErrIntOverflowBurnCoinsProposal + } + 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, ErrIntOverflowBurnCoinsProposal + } + 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, ErrInvalidLengthBurnCoinsProposal + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBurnCoinsProposal + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBurnCoinsProposal + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBurnCoinsProposal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBurnCoinsProposal = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBurnCoinsProposal = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/burner/types/codec.go b/x/burner/types/codec.go index 844157a8..6bf5b72f 100644 --- a/x/burner/types/codec.go +++ b/x/burner/types/codec.go @@ -3,17 +3,23 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + // this line is used by starport scaffolding # 1 "github.com/cosmos/cosmos-sdk/types/msgservice" ) func RegisterCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&BurnCoinsProposal{}, "burner/BurnCoinsProposal", nil) // this line is used by starport scaffolding # 2 } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { // this line is used by starport scaffolding # 3 - + registry.RegisterImplementations( + (*govtypes.Content)(nil), + &BurnCoinsProposal{}, + ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/burner/types/expected_keepers.go b/x/burner/types/expected_keepers.go index 6aa6e977..292be200 100644 --- a/x/burner/types/expected_keepers.go +++ b/x/burner/types/expected_keepers.go @@ -8,11 +8,14 @@ import ( // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI // 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 + GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + BurnCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error // Methods imported from bank should be defined here } diff --git a/x/burner/types/genesis.pb.go b/x/burner/types/genesis.pb.go index e643bb91..be9b7dff 100644 --- a/x/burner/types/genesis.pb.go +++ b/x/burner/types/genesis.pb.go @@ -69,26 +69,26 @@ func (m *GenesisState) GetParams() Params { } func init() { - proto.RegisterType((*GenesisState)(nil), "bzealphateam.bze.burner.GenesisState") + proto.RegisterType((*GenesisState)(nil), "bze.burner.v1.GenesisState") } func init() { proto.RegisterFile("burner/genesis.proto", fileDescriptor_62cceffcaad9705b) } var fileDescriptor_62cceffcaad9705b = []byte{ - // 198 bytes of a gzipped FileDescriptorProto + // 193 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x49, 0x2a, 0x2d, 0xca, 0x4b, 0x2d, 0xd2, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, - 0x17, 0x12, 0x4f, 0xaa, 0x4a, 0x4d, 0xcc, 0x29, 0xc8, 0x48, 0x2c, 0x49, 0x4d, 0xcc, 0xd5, 0x4b, - 0xaa, 0x4a, 0xd5, 0x83, 0x28, 0x93, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd1, 0x07, 0xb1, - 0x20, 0xca, 0xa5, 0x84, 0xa1, 0x86, 0x14, 0x24, 0x16, 0x25, 0xe6, 0x42, 0xcd, 0x50, 0xf2, 0xe5, - 0xe2, 0x71, 0x87, 0x18, 0x1a, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xcb, 0xc5, 0x06, 0x91, 0x97, - 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd7, 0xc3, 0x61, 0x89, 0x5e, 0x00, 0x58, 0x99, 0x13, - 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, 0x50, 0x4d, 0x4e, 0xae, 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, 0xa5, 0x9d, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, - 0x9f, 0x54, 0x95, 0xaa, 0x0b, 0x37, 0x13, 0xc4, 0xd3, 0xaf, 0xd0, 0x87, 0x3a, 0xae, 0xa4, 0xb2, - 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x38, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6e, 0xe4, - 0x6e, 0x26, 0xf8, 0x00, 0x00, 0x00, + 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0xc8, 0xe8, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, + 0xe7, 0x83, 0x65, 0xf4, 0x41, 0x2c, 0x88, 0x22, 0x29, 0x61, 0xa8, 0xd6, 0x82, 0xc4, 0xa2, 0xc4, + 0x5c, 0xa8, 0x4e, 0x25, 0x67, 0x2e, 0x1e, 0x77, 0x88, 0x51, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x42, + 0xc6, 0x5c, 0x6c, 0x10, 0x79, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x51, 0x3d, 0x14, 0xa3, + 0xf5, 0x02, 0xc0, 0x92, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0x95, 0x3a, 0xb9, 0x9e, + 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, + 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x76, 0x7a, 0x66, 0x49, 0x46, 0x69, + 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x52, 0x55, 0xaa, 0x6e, 0x62, 0x4e, 0x41, 0x46, 0x62, 0x49, + 0x6a, 0x22, 0x98, 0xa7, 0x5f, 0xa1, 0x0f, 0x75, 0x52, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, + 0xd8, 0x49, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x72, 0x8a, 0xe2, 0x73, 0xe4, 0x00, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/burner/types/gov.go b/x/burner/types/gov.go new file mode 100644 index 00000000..f7ee580b --- /dev/null +++ b/x/burner/types/gov.go @@ -0,0 +1,38 @@ +package types + +import ( + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +const ( + ProposalTypeBurnCoins = "BurnCoinsProposal" +) + +func init() { + govtypes.RegisterProposalType(ProposalTypeBurnCoins) + govtypes.RegisterProposalTypeCodec(&BurnCoinsProposal{}, "burner/BurnCoinsProposal") +} + +var ( + _ govtypes.Content = &BurnCoinsProposal{} +) + +func NewBurnCoinsProposal(title, description string) govtypes.Content { + return &BurnCoinsProposal{ + Title: title, + Description: description, + } +} + +func (m *BurnCoinsProposal) ProposalRoute() string { return RouterKey } + +func (m *BurnCoinsProposal) ProposalType() string { return ProposalTypeBurnCoins } + +func (m *BurnCoinsProposal) ValidateBasic() error { + err := govtypes.ValidateAbstract(m) + if err != nil { + return err + } + + return nil +} diff --git a/x/burner/types/params.pb.go b/x/burner/types/params.pb.go index 79c88953..b5e9f6b9 100644 --- a/x/burner/types/params.pb.go +++ b/x/burner/types/params.pb.go @@ -60,23 +60,23 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo func init() { - proto.RegisterType((*Params)(nil), "bzealphateam.bze.burner.Params") + proto.RegisterType((*Params)(nil), "bze.burner.v1.Params") } func init() { proto.RegisterFile("burner/params.proto", fileDescriptor_19e8707b27642d64) } var fileDescriptor_19e8707b27642d64 = []byte{ - // 156 bytes of a gzipped FileDescriptorProto + // 151 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4e, 0x2a, 0x2d, 0xca, 0x4b, 0x2d, 0xd2, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, - 0x12, 0x4f, 0xaa, 0x4a, 0x4d, 0xcc, 0x29, 0xc8, 0x48, 0x2c, 0x49, 0x4d, 0xcc, 0xd5, 0x4b, 0xaa, - 0x4a, 0xd5, 0x83, 0xa8, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd1, 0x07, 0xb1, 0x20, - 0xca, 0x95, 0xf8, 0xb8, 0xd8, 0x02, 0xc0, 0xda, 0xad, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0x72, - 0x3d, 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, 0xed, 0xf4, 0xcc, 0x92, 0x8c, - 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xa4, 0xaa, 0x54, 0x5d, 0xb8, 0x25, 0x20, 0x9e, 0x7e, - 0x85, 0x3e, 0xd4, 0x31, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xd3, 0x8d, 0x01, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x61, 0xe2, 0x61, 0x27, 0xa3, 0x00, 0x00, 0x00, + 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x48, 0xe8, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, + 0x83, 0x65, 0xf4, 0x41, 0x2c, 0x88, 0x22, 0x25, 0x3e, 0x2e, 0xb6, 0x00, 0xb0, 0x26, 0x2b, 0x96, + 0x19, 0x0b, 0xe4, 0x19, 0x9c, 0x5c, 0x4f, 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, + 0x4a, 0x3b, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0xa9, 0x2a, 0x55, + 0x37, 0x31, 0xa7, 0x20, 0x23, 0xb1, 0x24, 0x35, 0x11, 0xcc, 0xd3, 0xaf, 0xd0, 0x87, 0x3a, 0xa1, + 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x6c, 0xba, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x36, + 0xa3, 0xe0, 0xbe, 0x99, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/burner/types/query.pb.go b/x/burner/types/query.pb.go index 59eb0036..7ed9428c 100644 --- a/x/burner/types/query.pb.go +++ b/x/burner/types/query.pb.go @@ -114,33 +114,33 @@ func (m *QueryParamsResponse) GetParams() Params { } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "bzealphateam.bze.burner.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "bzealphateam.bze.burner.QueryParamsResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "bze.burner.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "bze.burner.v1.QueryParamsResponse") } func init() { proto.RegisterFile("burner/query.proto", fileDescriptor_9db476c77eff2c96) } var fileDescriptor_9db476c77eff2c96 = []byte{ - // 304 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4b, 0x03, 0x31, - 0x14, 0xc7, 0x2f, 0xa2, 0x1d, 0xce, 0x2d, 0x2d, 0x28, 0x45, 0x52, 0xed, 0xa2, 0x58, 0x4d, 0x68, - 0x9d, 0x5d, 0x0a, 0xee, 0x5a, 0x9c, 0xdc, 0x92, 0xf2, 0x48, 0x0f, 0xda, 0xbc, 0xf4, 0x92, 0x13, - 0xdb, 0xd1, 0xd9, 0x41, 0x10, 0xfc, 0x4c, 0x1d, 0x0b, 0x2e, 0x4e, 0x22, 0xad, 0x1f, 0x44, 0x9a, - 0x9c, 0x60, 0x91, 0x82, 0xdb, 0xdd, 0xcb, 0xef, 0xf7, 0xcf, 0x3f, 0x2f, 0xa5, 0xaa, 0xc8, 0x0d, - 0xe4, 0x62, 0x5c, 0x40, 0x3e, 0xe1, 0x36, 0x47, 0x8f, 0x74, 0x4f, 0x4d, 0x41, 0x0e, 0xed, 0x40, - 0x7a, 0x90, 0x23, 0xae, 0xa6, 0xc0, 0x23, 0x54, 0xaf, 0x69, 0xd4, 0x18, 0x18, 0xb1, 0xfa, 0x8a, - 0x78, 0xfd, 0x40, 0x23, 0xea, 0x21, 0x08, 0x69, 0x33, 0x21, 0x8d, 0x41, 0x2f, 0x7d, 0x86, 0xc6, - 0x95, 0xa7, 0xa7, 0x7d, 0x74, 0x23, 0x74, 0x42, 0x49, 0x07, 0xf1, 0x16, 0x71, 0xdf, 0x56, 0xe0, - 0x65, 0x5b, 0x58, 0xa9, 0x33, 0x13, 0xe0, 0x92, 0xad, 0x96, 0x65, 0xac, 0xcc, 0xe5, 0xa8, 0x0c, - 0x68, 0xd6, 0x52, 0x7a, 0xb3, 0xd2, 0xae, 0xc3, 0xb0, 0x07, 0xe3, 0x02, 0x9c, 0x6f, 0xde, 0xa6, - 0xd5, 0xb5, 0xa9, 0xb3, 0x68, 0x1c, 0xd0, 0xcb, 0xb4, 0x12, 0xe5, 0x7d, 0x72, 0x48, 0x4e, 0x76, - 0x3b, 0x0d, 0xbe, 0xe1, 0x2d, 0x3c, 0x8a, 0xdd, 0xed, 0xd9, 0x47, 0x23, 0xe9, 0x95, 0x52, 0xe7, - 0x95, 0xa4, 0x3b, 0x21, 0x96, 0x3e, 0x91, 0xb4, 0x12, 0x11, 0xda, 0xda, 0x98, 0xf1, 0xb7, 0x57, - 0xfd, 0xec, 0x7f, 0x70, 0xac, 0xdb, 0x3c, 0x7e, 0x7c, 0xfb, 0x7a, 0xd9, 0x3a, 0xa2, 0x0d, 0xf1, - 0xdb, 0x5a, 0xfd, 0x88, 0xb5, 0x55, 0x74, 0xaf, 0x66, 0x0b, 0x46, 0xe6, 0x0b, 0x46, 0x3e, 0x17, - 0x8c, 0x3c, 0x2f, 0x59, 0x32, 0x5f, 0xb2, 0xe4, 0x7d, 0xc9, 0x92, 0xbb, 0x96, 0xce, 0xfc, 0xa0, - 0x50, 0xbc, 0x8f, 0xc1, 0x3b, 0x5f, 0x4f, 0x79, 0xf8, 0xc9, 0xf1, 0x13, 0x0b, 0x4e, 0x55, 0xc2, - 0x4a, 0x2f, 0xbe, 0x03, 0x00, 0x00, 0xff, 0xff, 0x3a, 0x62, 0xe4, 0x21, 0xf6, 0x01, 0x00, 0x00, + // 303 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xc1, 0x4a, 0x33, 0x31, + 0x14, 0x85, 0x67, 0x7e, 0x7e, 0xbb, 0x18, 0x71, 0x93, 0x56, 0x90, 0x22, 0xa9, 0x9d, 0x8d, 0xa2, + 0x98, 0xd0, 0xf6, 0x0d, 0x0a, 0x6e, 0x5c, 0x69, 0x97, 0xee, 0x92, 0x72, 0x49, 0x07, 0xda, 0xdc, + 0x74, 0x92, 0x29, 0x6d, 0x77, 0xfa, 0x04, 0x82, 0x2f, 0xd5, 0x65, 0xc1, 0x8d, 0x2b, 0x91, 0xd6, + 0x07, 0x91, 0x49, 0xc6, 0xc5, 0x28, 0xb8, 0x4b, 0xce, 0xfd, 0xce, 0xe1, 0xdc, 0x9b, 0x10, 0x59, + 0xe4, 0x1a, 0x72, 0x3e, 0x2f, 0x20, 0x5f, 0x31, 0x93, 0xa3, 0x43, 0x72, 0x24, 0xd7, 0xc0, 0x82, + 0xce, 0x16, 0xbd, 0x76, 0x4b, 0xa1, 0x42, 0x3f, 0xe1, 0xe5, 0x2b, 0x40, 0xed, 0x53, 0x85, 0xa8, + 0xa6, 0xc0, 0x85, 0xc9, 0xb8, 0xd0, 0x1a, 0x9d, 0x70, 0x19, 0x6a, 0x5b, 0x4d, 0x2f, 0xc7, 0x68, + 0x67, 0x68, 0xb9, 0x14, 0x16, 0x42, 0x36, 0x5f, 0xf4, 0x24, 0x38, 0xd1, 0xe3, 0x46, 0xa8, 0x4c, + 0x7b, 0xb8, 0x62, 0x9b, 0x55, 0x05, 0x23, 0x72, 0x31, 0xab, 0x02, 0xd2, 0x56, 0x42, 0xee, 0x4b, + 0xdb, 0x9d, 0x17, 0x47, 0x30, 0x2f, 0xc0, 0xba, 0xf4, 0x36, 0x69, 0xd6, 0x54, 0x6b, 0x50, 0x5b, + 0x20, 0x83, 0xa4, 0x11, 0xcc, 0x27, 0xf1, 0x59, 0x7c, 0x71, 0xd8, 0x3f, 0x66, 0xb5, 0x0d, 0x58, + 0xc0, 0x87, 0xff, 0x37, 0xef, 0x9d, 0x68, 0x54, 0xa1, 0xfd, 0xc7, 0x38, 0x39, 0xf0, 0x61, 0x64, + 0x99, 0x34, 0x02, 0x41, 0xba, 0x3f, 0x8c, 0xbf, 0x2b, 0xb4, 0xd3, 0xbf, 0x90, 0xd0, 0x27, 0x3d, + 0x7f, 0x7a, 0xfd, 0x7c, 0xf9, 0xd7, 0x25, 0x1d, 0x2e, 0xd7, 0x20, 0xa6, 0x66, 0x22, 0x1c, 0x88, + 0x59, 0xf9, 0xe1, 0xb5, 0x5d, 0x87, 0x37, 0x9b, 0x1d, 0x8d, 0xb7, 0x3b, 0x1a, 0x7f, 0xec, 0x68, + 0xfc, 0xbc, 0xa7, 0xd1, 0x76, 0x4f, 0xa3, 0xb7, 0x3d, 0x8d, 0x1e, 0xae, 0x54, 0xe6, 0x26, 0x85, + 0x64, 0x63, 0xf4, 0xbe, 0xeb, 0x7a, 0xca, 0xf2, 0x3b, 0xc7, 0xad, 0x0c, 0x58, 0xd9, 0xf0, 0x37, + 0x1b, 0x7c, 0x05, 0x00, 0x00, 0xff, 0xff, 0x16, 0xe7, 0xbe, 0xda, 0xcd, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -169,7 +169,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/bzealphateam.bze.burner.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/bze.burner.v1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -204,7 +204,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bzealphateam.bze.burner.Query/Params", + FullMethod: "/bze.burner.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -213,7 +213,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "bzealphateam.bze.burner.Query", + ServiceName: "bze.burner.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/x/burner/types/tx.pb.go b/x/burner/types/tx.pb.go index 887a9a6c..29a69c9a 100644 --- a/x/burner/types/tx.pb.go +++ b/x/burner/types/tx.pb.go @@ -26,16 +26,15 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("burner/tx.proto", fileDescriptor_64ba45d2ae09f032) } var fileDescriptor_64ba45d2ae09f032 = []byte{ - // 132 bytes of a gzipped FileDescriptorProto + // 127 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0x2a, 0x2d, 0xca, - 0x4b, 0x2d, 0xd2, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4f, 0xaa, 0x4a, - 0x4d, 0xcc, 0x29, 0xc8, 0x48, 0x2c, 0x49, 0x4d, 0xcc, 0xd5, 0x4b, 0xaa, 0x4a, 0xd5, 0x83, 0xa8, - 0x30, 0x62, 0xe5, 0x62, 0xf6, 0x2d, 0x4e, 0x77, 0x72, 0x3d, 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, 0xed, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, - 0xa4, 0xaa, 0x54, 0x5d, 0xb8, 0x29, 0x20, 0x9e, 0x7e, 0x85, 0x3e, 0xcc, 0xa6, 0xca, 0x82, 0xd4, - 0xe2, 0x24, 0x36, 0xb0, 0x6d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x75, 0x6d, 0xcb, - 0x80, 0x00, 0x00, 0x00, + 0x4b, 0x2d, 0xd2, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, + 0xd5, 0x83, 0x08, 0xea, 0x95, 0x19, 0x1a, 0xb1, 0x72, 0x31, 0xfb, 0x16, 0xa7, 0x3b, 0xb9, 0x9e, + 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, + 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x76, 0x7a, 0x66, 0x49, 0x46, 0x69, + 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x52, 0x55, 0xaa, 0x6e, 0x62, 0x4e, 0x41, 0x46, 0x62, 0x49, + 0x6a, 0x22, 0x98, 0xa7, 0x5f, 0xa1, 0x0f, 0x33, 0xbf, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x6c, + 0x87, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x1d, 0xd9, 0xe0, 0xfe, 0x76, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -73,7 +72,7 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "bzealphateam.bze.burner.Msg", + ServiceName: "bze.burner.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{}, diff --git a/x/cointrunk/client/cli/gov.go b/x/cointrunk/client/cli/gov.go index 3b67d12e..a55ffed3 100644 --- a/x/cointrunk/client/cli/gov.go +++ b/x/cointrunk/client/cli/gov.go @@ -141,58 +141,3 @@ func NewCmdSubmitPublisherProposal() *cobra.Command { return cmd } - -func NewCmdSubmitBurnCoinsProposal() *cobra.Command { - cmd := &cobra.Command{ - Use: "burn-coins", - Args: cobra.ExactArgs(0), - Short: "Submit coins burning proposal", - Long: "Submit coins burning proposal along with an initial deposit.\n", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - title, err := cmd.Flags().GetString(govcli.FlagTitle) - if err != nil { - return err - } - - description, err := cmd.Flags().GetString(govcli.FlagDescription) - if err != nil { - return err - } - - content := types.NewBurnCoinsProposal(title, description) - - from := clientCtx.GetFromAddress() - - depositStr, err := cmd.Flags().GetString(govcli.FlagDeposit) - if err != nil { - return err - } - deposit, err := sdk.ParseCoinsNormalized(depositStr) - if err != nil { - return err - } - - msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) - if err != nil { - return err - } - - if err = msg.ValidateBasic(); err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(govcli.FlagTitle, "", "title of proposal") - cmd.Flags().String(govcli.FlagDescription, "", "description of proposal") - cmd.Flags().String(govcli.FlagDeposit, "", "deposit of proposal") - - return cmd -} diff --git a/x/cointrunk/client/proposal_handler.go b/x/cointrunk/client/proposal_handler.go index efb55899..23a2c1f3 100644 --- a/x/cointrunk/client/proposal_handler.go +++ b/x/cointrunk/client/proposal_handler.go @@ -11,7 +11,6 @@ import ( var AcceptedDomainProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitAcceptedDomainProposal, emptyRestHandler) var PublisherProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitPublisherProposal, emptyRestHandler) -var BurnCoinsProposalHandler = govclient.NewProposalHandler(cli.NewCmdSubmitBurnCoinsProposal, emptyRestHandler) func emptyRestHandler(client.Context) govrest.ProposalRESTHandler { return govrest.ProposalRESTHandler{ diff --git a/x/cointrunk/keeper/gov.go b/x/cointrunk/keeper/gov.go index e7d90bf6..46157e34 100644 --- a/x/cointrunk/keeper/gov.go +++ b/x/cointrunk/keeper/gov.go @@ -3,7 +3,6 @@ package keeper import ( "github.com/bze-alphateam/bze/x/cointrunk/types" sdk "github.com/cosmos/cosmos-sdk/types" - "strconv" ) func (k Keeper) HandlePublisherProposal(ctx sdk.Context, proposal *types.PublisherProposal) error { @@ -23,25 +22,3 @@ func (k Keeper) HandleAcceptedDomainProposal(ctx sdk.Context, proposal *types.Ac k.SetAcceptedDomain(ctx, acceptedDomain) return nil } - -func (k Keeper) HandleBurnCoinsProposal(ctx sdk.Context, proposal *types.BurnCoinsProposal) error { - moduleAcc := k.accKeeper.GetModuleAccount(ctx, types.ModuleName) - coins := k.bankKeeper.GetAllBalances(ctx, moduleAcc.GetAddress()) - if coins.IsZero() { - //nothing to burn at this moment - return nil - } - - err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, coins) - if err != nil { - panic(err) - } - - var burnedCoins = types.BurnedCoins{ - Burned: coins.String(), - Height: strconv.FormatInt(ctx.BlockHeader().Height, 10), - } - k.SetBurnedCoins(ctx, burnedCoins) - - return nil -} diff --git a/x/cointrunk/keeper/keeper.go b/x/cointrunk/keeper/keeper.go index 6742e59c..fc766a55 100644 --- a/x/cointrunk/keeper/keeper.go +++ b/x/cointrunk/keeper/keeper.go @@ -30,7 +30,9 @@ func NewKeeper( memKey sdk.StoreKey, ps paramtypes.Subspace, - bankKeeper types.BankKeeper, govKeeper types.GovKeeper, accKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, + govKeeper types.GovKeeper, + accKeeper types.AccountKeeper, ) *Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -43,7 +45,9 @@ func NewKeeper( storeKey: storeKey, memKey: memKey, paramstore: ps, - bankKeeper: bankKeeper, govKeeper: govKeeper, accKeeper: accKeeper, + bankKeeper: bankKeeper, + govKeeper: govKeeper, + accKeeper: accKeeper, } } diff --git a/x/cointrunk/proposal_handler.go b/x/cointrunk/proposal_handler.go index a9024e7b..e1ff0691 100644 --- a/x/cointrunk/proposal_handler.go +++ b/x/cointrunk/proposal_handler.go @@ -15,8 +15,6 @@ func NewCointrunkProposalHandler(k keeper.Keeper) govtypes.Handler { return k.HandlePublisherProposal(ctx, c) case *types.AcceptedDomainProposal: return k.HandleAcceptedDomainProposal(ctx, c) - case *types.BurnCoinsProposal: - return k.HandleBurnCoinsProposal(ctx, c) default: return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized cointrunk proposal content type: %T", c) } diff --git a/x/cointrunk/types/codec.go b/x/cointrunk/types/codec.go index f9ac6d3c..b8fdd9e4 100644 --- a/x/cointrunk/types/codec.go +++ b/x/cointrunk/types/codec.go @@ -12,7 +12,6 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&AcceptedDomainProposal{}, "cointrunk/AcceptedDomainProposal", nil) cdc.RegisterConcrete(&PublisherProposal{}, "cointrunk/PublisherProposal", nil) - cdc.RegisterConcrete(&BurnCoinsProposal{}, "cointrunk/BurnCoinsProposal", nil) cdc.RegisterConcrete(&MsgAddArticle{}, "cointrunk/AddArticle", nil) // this line is used by starport scaffolding # 2 } @@ -26,7 +25,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { (*govtypes.Content)(nil), &AcceptedDomainProposal{}, &PublisherProposal{}, - &BurnCoinsProposal{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/cointrunk/types/gov.go b/x/cointrunk/types/gov.go index 5f48b9eb..56660226 100644 --- a/x/cointrunk/types/gov.go +++ b/x/cointrunk/types/gov.go @@ -10,7 +10,6 @@ import ( const ( ProposalTypeAcceptedDomain = "AcceptedDomainProposal" ProposalTypePublisher = "PublisherProposal" - ProposalTypeBurnCoins = "BurnCoinsProposal" ) func init() { @@ -18,14 +17,11 @@ func init() { govtypes.RegisterProposalTypeCodec(&AcceptedDomainProposal{}, "cointrunk/AcceptedDomainProposal") govtypes.RegisterProposalType(ProposalTypePublisher) govtypes.RegisterProposalTypeCodec(&PublisherProposal{}, "cointrunk/PublisherProposal") - govtypes.RegisterProposalType(ProposalTypeBurnCoins) - govtypes.RegisterProposalTypeCodec(&BurnCoinsProposal{}, "cointrunk/BurnCoinsProposal") } var ( _ govtypes.Content = &AcceptedDomainProposal{} _ govtypes.Content = &PublisherProposal{} - _ govtypes.Content = &BurnCoinsProposal{} ) func NewAcceptedDomainProposal(title, description, domain string, active bool) govtypes.Content { @@ -83,23 +79,3 @@ func (m *PublisherProposal) ValidateBasic() error { return nil } - -func NewBurnCoinsProposal(title, description string) govtypes.Content { - return &BurnCoinsProposal{ - Title: title, - Description: description, - } -} - -func (m *BurnCoinsProposal) ProposalRoute() string { return RouterKey } - -func (m *BurnCoinsProposal) ProposalType() string { return ProposalTypeBurnCoins } - -func (m *BurnCoinsProposal) ValidateBasic() error { - err := govtypes.ValidateAbstract(m) - if err != nil { - return err - } - - return nil -} From 0d6d4f7c1920c2a7ead10fcc9b84bbdca8046c28 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 8 Dec 2022 19:52:17 +0200 Subject: [PATCH 28/54] save burned coins in burner storage --- proto/burner/burned_coins.proto | 10 + proto/burner/genesis.proto | 2 + proto/cointrunk/genesis.proto | 2 - .../bze-alphateam/bze/bze.burner.v1/index.ts | 4 +- .../module/types/burner/burned_coins.ts | 92 +++++ .../module/types/burner/genesis.ts | 38 +- .../module/types/cointrunk/genesis.ts | 36 -- .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +- .../bze/bze.scavenge/module/index.ts | 6 +- x/burner/genesis.go | 7 +- x/burner/keeper/burned_coins.go | 30 ++ x/burner/keeper/gov.go | 11 +- x/burner/types/burned_coins.pb.go | 366 ++++++++++++++++++ x/burner/types/genesis.pb.go | 86 +++- .../types/key_burned_coins.go | 0 x/cointrunk/genesis.go | 5 - x/cointrunk/keeper/cointrunk.go | 23 -- .../keeper/grpc_query_coins_burn_events.go | 3 +- x/cointrunk/types/genesis.go | 1 - x/cointrunk/types/genesis.pb.go | 108 ++---- 20 files changed, 670 insertions(+), 192 deletions(-) create mode 100644 proto/burner/burned_coins.proto create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/burned_coins.ts create mode 100644 x/burner/keeper/burned_coins.go create mode 100644 x/burner/types/burned_coins.pb.go rename x/{cointrunk => burner}/types/key_burned_coins.go (100%) diff --git a/proto/burner/burned_coins.proto b/proto/burner/burned_coins.proto new file mode 100644 index 00000000..cb017b43 --- /dev/null +++ b/proto/burner/burned_coins.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +package bze.burner.v1; + +option go_package = "github.com/bze-alphateam/bze/x/burner/types"; + +message BurnedCoins { + + string burned = 1; + string height = 2; +} \ No newline at end of file diff --git a/proto/burner/genesis.proto b/proto/burner/genesis.proto index a8566309..931b7bc4 100644 --- a/proto/burner/genesis.proto +++ b/proto/burner/genesis.proto @@ -3,6 +3,7 @@ package bze.burner.v1; import "gogoproto/gogo.proto"; import "burner/params.proto"; +import "burner/burned_coins.proto"; // this line is used by starport scaffolding # genesis/proto/import option go_package = "github.com/bze-alphateam/bze/x/burner/types"; @@ -10,5 +11,6 @@ option go_package = "github.com/bze-alphateam/bze/x/burner/types"; // GenesisState defines the burner module's genesis state. message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; + repeated BurnedCoins BurnedCoinsList = 2 [(gogoproto.nullable) = false]; // this line is used by starport scaffolding # genesis/proto/state } diff --git a/proto/cointrunk/genesis.proto b/proto/cointrunk/genesis.proto index 560f49d4..83809cf6 100644 --- a/proto/cointrunk/genesis.proto +++ b/proto/cointrunk/genesis.proto @@ -6,7 +6,6 @@ import "cointrunk/params.proto"; import "cointrunk/publisher.proto"; import "cointrunk/accepted_domain.proto"; import "cointrunk/article.proto"; -import "cointrunk/burned_coins.proto"; // this line is used by starport scaffolding # genesis/proto/import option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; @@ -17,7 +16,6 @@ message GenesisState { repeated Publisher PublisherList = 2 [(gogoproto.nullable) = false]; repeated AcceptedDomain AcceptedDomainList = 3 [(gogoproto.nullable) = false]; repeated Article ArticleList = 4 [(gogoproto.nullable) = false]; - repeated BurnedCoins BurnedCoinsList = 5 [(gogoproto.nullable) = false]; uint64 articlesCounter = 6; // this line is used by starport scaffolding # genesis/proto/state } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts index a2c9cd36..a10fed2b 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts @@ -1,10 +1,11 @@ import { txClient, queryClient, MissingWalletError , registry} from './module' import { BurnCoinsProposal } from "./module/types/burner/burn_coins_proposal" +import { BurnedCoins } from "./module/types/burner/burned_coins" import { Params } from "./module/types/burner/params" -export { BurnCoinsProposal, Params }; +export { BurnCoinsProposal, BurnedCoins, Params }; async function initTxClient(vuexGetters) { return await txClient(vuexGetters['common/wallet/signer'], { @@ -46,6 +47,7 @@ const getDefaultState = () => { _Structure: { BurnCoinsProposal: getStructure(BurnCoinsProposal.fromPartial({})), + BurnedCoins: getStructure(BurnedCoins.fromPartial({})), Params: getStructure(Params.fromPartial({})), }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/burned_coins.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/burned_coins.ts new file mode 100644 index 00000000..15152ea3 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/burned_coins.ts @@ -0,0 +1,92 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.burner.v1"; + +export interface BurnedCoins { + burned: string; + height: string; +} + +const baseBurnedCoins: object = { burned: "", height: "" }; + +export const BurnedCoins = { + encode(message: BurnedCoins, writer: Writer = Writer.create()): Writer { + if (message.burned !== "") { + writer.uint32(10).string(message.burned); + } + if (message.height !== "") { + writer.uint32(18).string(message.height); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): BurnedCoins { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBurnedCoins } as BurnedCoins; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.burned = reader.string(); + break; + case 2: + message.height = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BurnedCoins { + const message = { ...baseBurnedCoins } as BurnedCoins; + if (object.burned !== undefined && object.burned !== null) { + message.burned = String(object.burned); + } else { + message.burned = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = String(object.height); + } else { + message.height = ""; + } + return message; + }, + + toJSON(message: BurnedCoins): unknown { + const obj: any = {}; + message.burned !== undefined && (obj.burned = message.burned); + message.height !== undefined && (obj.height = message.height); + return obj; + }, + + fromPartial(object: DeepPartial): BurnedCoins { + const message = { ...baseBurnedCoins } as BurnedCoins; + if (object.burned !== undefined && object.burned !== null) { + message.burned = object.burned; + } else { + message.burned = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height; + } else { + message.height = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/genesis.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/genesis.ts index b4f0d2d8..56ea66b9 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/genesis.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/genesis.ts @@ -1,13 +1,15 @@ /* eslint-disable */ import { Params } from "../burner/params"; +import { BurnedCoins } from "../burner/burned_coins"; import { Writer, Reader } from "protobufjs/minimal"; export const protobufPackage = "bze.burner.v1"; /** GenesisState defines the burner module's genesis state. */ export interface GenesisState { - /** this line is used by starport scaffolding # genesis/proto/state */ params: Params | undefined; + /** this line is used by starport scaffolding # genesis/proto/state */ + BurnedCoinsList: BurnedCoins[]; } const baseGenesisState: object = {}; @@ -17,6 +19,9 @@ export const GenesisState = { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } + for (const v of message.BurnedCoinsList) { + BurnedCoins.encode(v!, writer.uint32(18).fork()).ldelim(); + } return writer; }, @@ -24,12 +29,18 @@ export const GenesisState = { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseGenesisState } as GenesisState; + message.BurnedCoinsList = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.params = Params.decode(reader, reader.uint32()); break; + case 2: + message.BurnedCoinsList.push( + BurnedCoins.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -40,11 +51,20 @@ export const GenesisState = { fromJSON(object: any): GenesisState { const message = { ...baseGenesisState } as GenesisState; + message.BurnedCoinsList = []; if (object.params !== undefined && object.params !== null) { message.params = Params.fromJSON(object.params); } else { message.params = undefined; } + if ( + object.BurnedCoinsList !== undefined && + object.BurnedCoinsList !== null + ) { + for (const e of object.BurnedCoinsList) { + message.BurnedCoinsList.push(BurnedCoins.fromJSON(e)); + } + } return message; }, @@ -52,16 +72,32 @@ export const GenesisState = { const obj: any = {}; message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.BurnedCoinsList) { + obj.BurnedCoinsList = message.BurnedCoinsList.map((e) => + e ? BurnedCoins.toJSON(e) : undefined + ); + } else { + obj.BurnedCoinsList = []; + } return obj; }, fromPartial(object: DeepPartial): GenesisState { const message = { ...baseGenesisState } as GenesisState; + message.BurnedCoinsList = []; if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); } else { message.params = undefined; } + if ( + object.BurnedCoinsList !== undefined && + object.BurnedCoinsList !== null + ) { + for (const e of object.BurnedCoinsList) { + message.BurnedCoinsList.push(BurnedCoins.fromPartial(e)); + } + } return message; }, }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts index cb01a352..751f0152 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/genesis.ts @@ -5,7 +5,6 @@ import { Params } from "../cointrunk/params"; import { Publisher } from "../cointrunk/publisher"; import { AcceptedDomain } from "../cointrunk/accepted_domain"; import { Article } from "../cointrunk/article"; -import { BurnedCoins } from "../cointrunk/burned_coins"; export const protobufPackage = "bze.cointrunk"; @@ -15,7 +14,6 @@ export interface GenesisState { PublisherList: Publisher[]; AcceptedDomainList: AcceptedDomain[]; ArticleList: Article[]; - BurnedCoinsList: BurnedCoins[]; /** this line is used by starport scaffolding # genesis/proto/state */ articlesCounter: number; } @@ -36,9 +34,6 @@ export const GenesisState = { for (const v of message.ArticleList) { Article.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.BurnedCoinsList) { - BurnedCoins.encode(v!, writer.uint32(42).fork()).ldelim(); - } if (message.articlesCounter !== 0) { writer.uint32(48).uint64(message.articlesCounter); } @@ -52,7 +47,6 @@ export const GenesisState = { message.PublisherList = []; message.AcceptedDomainList = []; message.ArticleList = []; - message.BurnedCoinsList = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -70,11 +64,6 @@ export const GenesisState = { case 4: message.ArticleList.push(Article.decode(reader, reader.uint32())); break; - case 5: - message.BurnedCoinsList.push( - BurnedCoins.decode(reader, reader.uint32()) - ); - break; case 6: message.articlesCounter = longToNumber(reader.uint64() as Long); break; @@ -91,7 +80,6 @@ export const GenesisState = { message.PublisherList = []; message.AcceptedDomainList = []; message.ArticleList = []; - message.BurnedCoinsList = []; if (object.params !== undefined && object.params !== null) { message.params = Params.fromJSON(object.params); } else { @@ -115,14 +103,6 @@ export const GenesisState = { message.ArticleList.push(Article.fromJSON(e)); } } - if ( - object.BurnedCoinsList !== undefined && - object.BurnedCoinsList !== null - ) { - for (const e of object.BurnedCoinsList) { - message.BurnedCoinsList.push(BurnedCoins.fromJSON(e)); - } - } if ( object.articlesCounter !== undefined && object.articlesCounter !== null @@ -159,13 +139,6 @@ export const GenesisState = { } else { obj.ArticleList = []; } - if (message.BurnedCoinsList) { - obj.BurnedCoinsList = message.BurnedCoinsList.map((e) => - e ? BurnedCoins.toJSON(e) : undefined - ); - } else { - obj.BurnedCoinsList = []; - } message.articlesCounter !== undefined && (obj.articlesCounter = message.articlesCounter); return obj; @@ -176,7 +149,6 @@ export const GenesisState = { message.PublisherList = []; message.AcceptedDomainList = []; message.ArticleList = []; - message.BurnedCoinsList = []; if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); } else { @@ -200,14 +172,6 @@ export const GenesisState = { message.ArticleList.push(Article.fromPartial(e)); } } - if ( - object.BurnedCoinsList !== undefined && - object.BurnedCoinsList !== null - ) { - for (const e of object.BurnedCoinsList) { - message.BurnedCoinsList.push(BurnedCoins.fromPartial(e)); - } - } if ( object.articlesCounter !== undefined && object.articlesCounter !== null diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 40cc1ba4..36486b56 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,33 +232,33 @@ export default { }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgSubmitScavenge(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -278,29 +278,29 @@ export default { } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgSubmitScavenge(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index c023b54d..27b7f752 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,14 +4,14 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; +import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], + ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; @@ -45,8 +45,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), + msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; diff --git a/x/burner/genesis.go b/x/burner/genesis.go index 732c52b1..2e2064e7 100644 --- a/x/burner/genesis.go +++ b/x/burner/genesis.go @@ -11,13 +11,18 @@ import ( 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) + + for _, burnedCoins := range genState.BurnedCoinsList { + k.SetBurnedCoins(ctx, burnedCoins) + } } // ExportGenesis returns the capability module's exported genesis. func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - + genesis.BurnedCoinsList = k.GetAllBurnedCoins(ctx) + // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/burner/keeper/burned_coins.go b/x/burner/keeper/burned_coins.go new file mode 100644 index 00000000..3801ce53 --- /dev/null +++ b/x/burner/keeper/burned_coins.go @@ -0,0 +1,30 @@ +package keeper + +import ( + "github.com/bze-alphateam/bze/x/burner/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) GetAllBurnedCoins(ctx sdk.Context) (list []types.BurnedCoins) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BurnedCoinsKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.BurnedCoins + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} + +func (k Keeper) SetBurnedCoins(ctx sdk.Context, burnedCoins types.BurnedCoins) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BurnedCoinsKeyPrefix)) + val := k.cdc.MustMarshal(&burnedCoins) + store.Set( + types.BurnedCoinsKey(burnedCoins.Height), + val, + ) +} diff --git a/x/burner/keeper/gov.go b/x/burner/keeper/gov.go index dc5a9e0b..3b863de5 100644 --- a/x/burner/keeper/gov.go +++ b/x/burner/keeper/gov.go @@ -3,6 +3,7 @@ package keeper import ( "github.com/bze-alphateam/bze/x/burner/types" sdk "github.com/cosmos/cosmos-sdk/types" + "strconv" ) func (k Keeper) HandleBurnCoinsProposal(ctx sdk.Context, proposal *types.BurnCoinsProposal) error { @@ -18,11 +19,11 @@ func (k Keeper) HandleBurnCoinsProposal(ctx sdk.Context, proposal *types.BurnCoi panic(err) } - //var burnedCoins = types.BurnedCoins{ - // Burned: coins.String(), - // Height: strconv.FormatInt(ctx.BlockHeader().Height, 10), - //} - //k.SetBurnedCoins(ctx, burnedCoins) + var burnedCoins = types.BurnedCoins{ + Burned: coins.String(), + Height: strconv.FormatInt(ctx.BlockHeader().Height, 10), + } + k.SetBurnedCoins(ctx, burnedCoins) return nil } diff --git a/x/burner/types/burned_coins.pb.go b/x/burner/types/burned_coins.pb.go new file mode 100644 index 00000000..888c598a --- /dev/null +++ b/x/burner/types/burned_coins.pb.go @@ -0,0 +1,366 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: burner/burned_coins.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/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 BurnedCoins struct { + Burned string `protobuf:"bytes,1,opt,name=burned,proto3" json:"burned,omitempty"` + Height string `protobuf:"bytes,2,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *BurnedCoins) Reset() { *m = BurnedCoins{} } +func (m *BurnedCoins) String() string { return proto.CompactTextString(m) } +func (*BurnedCoins) ProtoMessage() {} +func (*BurnedCoins) Descriptor() ([]byte, []int) { + return fileDescriptor_930c7119c82a796d, []int{0} +} +func (m *BurnedCoins) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BurnedCoins) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BurnedCoins.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 *BurnedCoins) XXX_Merge(src proto.Message) { + xxx_messageInfo_BurnedCoins.Merge(m, src) +} +func (m *BurnedCoins) XXX_Size() int { + return m.Size() +} +func (m *BurnedCoins) XXX_DiscardUnknown() { + xxx_messageInfo_BurnedCoins.DiscardUnknown(m) +} + +var xxx_messageInfo_BurnedCoins proto.InternalMessageInfo + +func (m *BurnedCoins) GetBurned() string { + if m != nil { + return m.Burned + } + return "" +} + +func (m *BurnedCoins) GetHeight() string { + if m != nil { + return m.Height + } + return "" +} + +func init() { + proto.RegisterType((*BurnedCoins)(nil), "bze.burner.v1.BurnedCoins") +} + +func init() { proto.RegisterFile("burner/burned_coins.proto", fileDescriptor_930c7119c82a796d) } + +var fileDescriptor_930c7119c82a796d = []byte{ + // 167 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0x2a, 0x2d, 0xca, + 0x4b, 0x2d, 0xd2, 0x07, 0x53, 0x29, 0xf1, 0xc9, 0xf9, 0x99, 0x79, 0xc5, 0x7a, 0x05, 0x45, 0xf9, + 0x25, 0xf9, 0x42, 0xbc, 0x49, 0x55, 0xa9, 0x7a, 0x10, 0x69, 0xbd, 0x32, 0x43, 0x25, 0x5b, 0x2e, + 0x6e, 0x27, 0xb0, 0x22, 0x67, 0x90, 0x1a, 0x21, 0x31, 0x2e, 0x36, 0x88, 0x1e, 0x09, 0x46, 0x05, + 0x46, 0x0d, 0xce, 0x20, 0x28, 0x0f, 0x24, 0x9e, 0x91, 0x9a, 0x99, 0x9e, 0x51, 0x22, 0xc1, 0x04, + 0x11, 0x87, 0xf0, 0x9c, 0x5c, 0x4f, 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, 0x4a, + 0x3b, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0xa9, 0x2a, 0x55, 0x37, + 0x31, 0xa7, 0x20, 0x23, 0xb1, 0x24, 0x35, 0x11, 0xcc, 0xd3, 0xaf, 0xd0, 0x87, 0xba, 0xb0, 0xa4, + 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x36, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, + 0xb1, 0x9d, 0xe8, 0xb8, 0x00, 0x00, 0x00, +} + +func (m *BurnedCoins) 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 *BurnedCoins) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BurnedCoins) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Height) > 0 { + i -= len(m.Height) + copy(dAtA[i:], m.Height) + i = encodeVarintBurnedCoins(dAtA, i, uint64(len(m.Height))) + i-- + dAtA[i] = 0x12 + } + if len(m.Burned) > 0 { + i -= len(m.Burned) + copy(dAtA[i:], m.Burned) + i = encodeVarintBurnedCoins(dAtA, i, uint64(len(m.Burned))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintBurnedCoins(dAtA []byte, offset int, v uint64) int { + offset -= sovBurnedCoins(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BurnedCoins) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Burned) + if l > 0 { + n += 1 + l + sovBurnedCoins(uint64(l)) + } + l = len(m.Height) + if l > 0 { + n += 1 + l + sovBurnedCoins(uint64(l)) + } + return n +} + +func sovBurnedCoins(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBurnedCoins(x uint64) (n int) { + return sovBurnedCoins(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BurnedCoins) 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 ErrIntOverflowBurnedCoins + } + 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: BurnedCoins: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BurnedCoins: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Burned", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBurnedCoins + } + 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 ErrInvalidLengthBurnedCoins + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBurnedCoins + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Burned = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBurnedCoins + } + 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 ErrInvalidLengthBurnedCoins + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBurnedCoins + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Height = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBurnedCoins(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBurnedCoins + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBurnedCoins(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, ErrIntOverflowBurnedCoins + } + 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, ErrIntOverflowBurnedCoins + } + 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, ErrIntOverflowBurnedCoins + } + 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, ErrInvalidLengthBurnedCoins + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBurnedCoins + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBurnedCoins + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBurnedCoins = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBurnedCoins = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBurnedCoins = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/burner/types/genesis.pb.go b/x/burner/types/genesis.pb.go index be9b7dff..6a2aed8a 100644 --- a/x/burner/types/genesis.pb.go +++ b/x/burner/types/genesis.pb.go @@ -25,7 +25,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the burner 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"` + BurnedCoinsList []BurnedCoins `protobuf:"bytes,2,rep,name=BurnedCoinsList,proto3" json:"BurnedCoinsList"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -68,6 +69,13 @@ func (m *GenesisState) GetParams() Params { return Params{} } +func (m *GenesisState) GetBurnedCoinsList() []BurnedCoins { + if m != nil { + return m.BurnedCoinsList + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "bze.burner.v1.GenesisState") } @@ -75,20 +83,22 @@ func init() { func init() { proto.RegisterFile("burner/genesis.proto", fileDescriptor_62cceffcaad9705b) } var fileDescriptor_62cceffcaad9705b = []byte{ - // 193 bytes of a gzipped FileDescriptorProto + // 238 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x49, 0x2a, 0x2d, 0xca, 0x4b, 0x2d, 0xd2, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0xc8, 0xe8, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x65, 0xf4, 0x41, 0x2c, 0x88, 0x22, 0x29, 0x61, 0xa8, 0xd6, 0x82, 0xc4, 0xa2, 0xc4, - 0x5c, 0xa8, 0x4e, 0x25, 0x67, 0x2e, 0x1e, 0x77, 0x88, 0x51, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x42, - 0xc6, 0x5c, 0x6c, 0x10, 0x79, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x51, 0x3d, 0x14, 0xa3, - 0xf5, 0x02, 0xc0, 0x92, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0x95, 0x3a, 0xb9, 0x9e, - 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, - 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x76, 0x7a, 0x66, 0x49, 0x46, 0x69, - 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x52, 0x55, 0xaa, 0x6e, 0x62, 0x4e, 0x41, 0x46, 0x62, 0x49, - 0x6a, 0x22, 0x98, 0xa7, 0x5f, 0xa1, 0x0f, 0x75, 0x52, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, - 0xd8, 0x49, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x72, 0x8a, 0xe2, 0x73, 0xe4, 0x00, 0x00, - 0x00, + 0x5c, 0xa8, 0x4e, 0x29, 0x49, 0xa8, 0x20, 0x98, 0x4a, 0x89, 0x4f, 0xce, 0xcf, 0xcc, 0x83, 0x4a, + 0x29, 0xf5, 0x33, 0x72, 0xf1, 0xb8, 0x43, 0xac, 0x09, 0x2e, 0x49, 0x2c, 0x49, 0x15, 0x32, 0xe6, + 0x62, 0x83, 0xe8, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x12, 0xd5, 0x43, 0xb1, 0x56, 0x2f, + 0x00, 0x2c, 0xe9, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x54, 0xa9, 0x90, 0x17, 0x17, 0xbf, + 0x13, 0xd8, 0x6c, 0x67, 0x90, 0xd1, 0x3e, 0x99, 0xc5, 0x25, 0x12, 0x4c, 0x0a, 0xcc, 0x1a, 0xdc, + 0x46, 0x52, 0x68, 0xba, 0x91, 0x54, 0x41, 0x8d, 0x40, 0xd7, 0xe8, 0xe4, 0x7a, 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, 0xda, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, + 0xf9, 0xb9, 0xfa, 0x49, 0x55, 0xa9, 0xba, 0x89, 0x39, 0x05, 0x19, 0x89, 0x25, 0xa9, 0x89, 0x60, + 0x9e, 0x7e, 0x85, 0x3e, 0xd4, 0x97, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xff, 0x19, + 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x51, 0x09, 0xba, 0xec, 0x4c, 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.BurnedCoinsList) > 0 { + for iNdEx := len(m.BurnedCoinsList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BurnedCoinsList[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.BurnedCoinsList) > 0 { + for _, e := range m.BurnedCoinsList { + 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 BurnedCoinsList", 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.BurnedCoinsList = append(m.BurnedCoinsList, BurnedCoins{}) + if err := m.BurnedCoinsList[len(m.BurnedCoinsList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/cointrunk/types/key_burned_coins.go b/x/burner/types/key_burned_coins.go similarity index 100% rename from x/cointrunk/types/key_burned_coins.go rename to x/burner/types/key_burned_coins.go diff --git a/x/cointrunk/genesis.go b/x/cointrunk/genesis.go index 542290a6..c3a4f94a 100644 --- a/x/cointrunk/genesis.go +++ b/x/cointrunk/genesis.go @@ -24,10 +24,6 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) k.SetArticle(ctx, article) } - for _, burnedCoins := range genState.BurnedCoinsList { - k.SetBurnedCoins(ctx, burnedCoins) - } - // this line is used by starport scaffolding # genesis/module/init } @@ -38,7 +34,6 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.PublisherList = k.GetAllPublisher(ctx) genesis.AcceptedDomainList = k.GetAllAcceptedDomain(ctx) genesis.ArticleList = k.GetAllArticles(ctx) - genesis.BurnedCoinsList = k.GetAllBurnedCoins(ctx) genesis.ArticlesCounter = k.GetArticleCounter(ctx) // this line is used by starport scaffolding # genesis/module/export diff --git a/x/cointrunk/keeper/cointrunk.go b/x/cointrunk/keeper/cointrunk.go index 875776e0..9919508d 100644 --- a/x/cointrunk/keeper/cointrunk.go +++ b/x/cointrunk/keeper/cointrunk.go @@ -161,26 +161,3 @@ func (k Keeper) incrementCounter(ctx sdk.Context, storePrefix string) uint64 { return no } - -func (k Keeper) GetAllBurnedCoins(ctx sdk.Context) (list []types.BurnedCoins) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BurnedCoinsKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.BurnedCoins - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return -} - -func (k Keeper) SetBurnedCoins(ctx sdk.Context, burnedCoins types.BurnedCoins) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BurnedCoinsKeyPrefix)) - val := k.cdc.MustMarshal(&burnedCoins) - store.Set( - types.BurnedCoinsKey(burnedCoins.Height), - val, - ) -} diff --git a/x/cointrunk/keeper/grpc_query_coins_burn_events.go b/x/cointrunk/keeper/grpc_query_coins_burn_events.go index 2c0a88a7..e3f5f3c4 100644 --- a/x/cointrunk/keeper/grpc_query_coins_burn_events.go +++ b/x/cointrunk/keeper/grpc_query_coins_burn_events.go @@ -2,6 +2,7 @@ package keeper import ( "context" + types2 "github.com/bze-alphateam/bze/x/burner/types" "github.com/cosmos/cosmos-sdk/store/prefix" "github.com/cosmos/cosmos-sdk/types/query" @@ -19,7 +20,7 @@ func (k Keeper) AllBurnedCoins(goCtx context.Context, req *types.QueryAllBurnedC ctx := sdk.UnwrapSDKContext(goCtx) var burnedCoins []types.BurnedCoins store := ctx.KVStore(k.storeKey) - burnedCoinsStore := prefix.NewStore(store, types.KeyPrefix(types.BurnedCoinsKeyPrefix)) + burnedCoinsStore := prefix.NewStore(store, types.KeyPrefix(types2.BurnedCoinsKeyPrefix)) pageRes, err := query.Paginate(burnedCoinsStore, req.Pagination, func(key []byte, value []byte) error { var entry types.BurnedCoins if err := k.cdc.Unmarshal(value, &entry); err != nil { diff --git a/x/cointrunk/types/genesis.go b/x/cointrunk/types/genesis.go index 3facafde..855ce2dc 100644 --- a/x/cointrunk/types/genesis.go +++ b/x/cointrunk/types/genesis.go @@ -11,7 +11,6 @@ func DefaultGenesis() *GenesisState { PublisherList: []Publisher{}, AcceptedDomainList: []AcceptedDomain{}, ArticleList: []Article{}, - BurnedCoinsList: []BurnedCoins{}, } } diff --git a/x/cointrunk/types/genesis.pb.go b/x/cointrunk/types/genesis.pb.go index 77c43927..9e8461ae 100644 --- a/x/cointrunk/types/genesis.pb.go +++ b/x/cointrunk/types/genesis.pb.go @@ -29,7 +29,6 @@ type GenesisState struct { PublisherList []Publisher `protobuf:"bytes,2,rep,name=PublisherList,proto3" json:"PublisherList"` AcceptedDomainList []AcceptedDomain `protobuf:"bytes,3,rep,name=AcceptedDomainList,proto3" json:"AcceptedDomainList"` ArticleList []Article `protobuf:"bytes,4,rep,name=ArticleList,proto3" json:"ArticleList"` - BurnedCoinsList []BurnedCoins `protobuf:"bytes,5,rep,name=BurnedCoinsList,proto3" json:"BurnedCoinsList"` ArticlesCounter uint64 `protobuf:"varint,6,opt,name=articlesCounter,proto3" json:"articlesCounter,omitempty"` } @@ -94,13 +93,6 @@ func (m *GenesisState) GetArticleList() []Article { return nil } -func (m *GenesisState) GetBurnedCoinsList() []BurnedCoins { - if m != nil { - return m.BurnedCoinsList - } - return nil -} - func (m *GenesisState) GetArticlesCounter() uint64 { if m != nil { return m.ArticlesCounter @@ -115,30 +107,28 @@ func init() { func init() { proto.RegisterFile("cointrunk/genesis.proto", fileDescriptor_20104b77ac07c6a4) } var fileDescriptor_20104b77ac07c6a4 = []byte{ - // 365 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcb, 0x4e, 0xc2, 0x40, - 0x14, 0x86, 0x5b, 0x41, 0x16, 0x83, 0x84, 0x64, 0xa2, 0x58, 0x1b, 0x2d, 0xc4, 0x55, 0x37, 0xb6, - 0x09, 0xec, 0x4d, 0xb8, 0x24, 0x1a, 0xe3, 0x82, 0xc0, 0xce, 0x0d, 0x99, 0x96, 0x93, 0x32, 0x11, - 0x3a, 0xcd, 0x74, 0x9a, 0x28, 0x4f, 0xe1, 0xc2, 0x87, 0x62, 0xc9, 0xd2, 0x95, 0x31, 0xf0, 0x22, - 0x86, 0xe9, 0x60, 0x2f, 0x71, 0xd7, 0x9e, 0xff, 0xff, 0xbf, 0x39, 0x17, 0x74, 0xe9, 0x33, 0x1a, - 0x0a, 0x9e, 0x84, 0xaf, 0x6e, 0x00, 0x21, 0xc4, 0x34, 0x76, 0x22, 0xce, 0x04, 0xc3, 0x0d, 0x6f, - 0x0d, 0xce, 0x9f, 0x68, 0x9e, 0x07, 0x2c, 0x60, 0x52, 0x71, 0x0f, 0x5f, 0xa9, 0xc9, 0x6c, 0x65, - 0xe9, 0x88, 0x70, 0xb2, 0x52, 0x61, 0xf3, 0x2a, 0x57, 0x4f, 0xbc, 0x25, 0x8d, 0x17, 0xc0, 0x95, - 0xd4, 0xce, 0x24, 0xe2, 0xfb, 0x10, 0x09, 0x98, 0xcf, 0xe6, 0x6c, 0x45, 0x68, 0xa8, 0x0c, 0xb9, - 0x8e, 0x08, 0x17, 0xd4, 0x5f, 0x82, 0x12, 0xae, 0x33, 0xc1, 0x4b, 0x78, 0x08, 0xf3, 0xd9, 0xa1, - 0xa0, 0x9e, 0xbc, 0xfd, 0xac, 0xa0, 0xb3, 0x87, 0x74, 0x82, 0xa9, 0x20, 0x02, 0x70, 0x0f, 0xd5, - 0xd2, 0x9e, 0x0c, 0xbd, 0xa3, 0xdb, 0xf5, 0xee, 0x85, 0x53, 0x98, 0xc8, 0x19, 0x4b, 0x71, 0x50, - 0xdd, 0x7c, 0xb7, 0xb5, 0x89, 0xb2, 0xe2, 0x11, 0x6a, 0x8c, 0x8f, 0x0d, 0x3f, 0xd3, 0x58, 0x18, - 0x27, 0x9d, 0x8a, 0x5d, 0xef, 0x1a, 0xe5, 0xec, 0xd1, 0xa3, 0xe2, 0xc5, 0x10, 0x9e, 0x22, 0xdc, - 0x57, 0xb3, 0x8d, 0xe4, 0x68, 0x12, 0x55, 0x91, 0xa8, 0x9b, 0x12, 0xaa, 0x68, 0x54, 0xbc, 0x7f, - 0xe2, 0xf8, 0x1e, 0xd5, 0xfb, 0xe9, 0x3e, 0x24, 0xad, 0x2a, 0x69, 0xad, 0x32, 0x2d, 0x75, 0x28, - 0x4c, 0x3e, 0x80, 0x9f, 0x50, 0x73, 0x20, 0xd7, 0x36, 0x3c, 0x6c, 0x4d, 0x32, 0x4e, 0x25, 0xc3, - 0x2c, 0x31, 0x72, 0x2e, 0xc5, 0x29, 0x07, 0xb1, 0x8d, 0x9a, 0xea, 0x36, 0xf1, 0x90, 0x25, 0xa1, - 0x00, 0x6e, 0xd4, 0x3a, 0xba, 0x5d, 0x9d, 0x94, 0xcb, 0x83, 0xc7, 0xcd, 0xce, 0xd2, 0xb7, 0x3b, - 0x4b, 0xff, 0xd9, 0x59, 0xfa, 0xc7, 0xde, 0xd2, 0xb6, 0x7b, 0x4b, 0xfb, 0xda, 0x5b, 0xda, 0x8b, - 0x13, 0x50, 0xb1, 0x48, 0x3c, 0xc7, 0x67, 0x2b, 0xd7, 0x5b, 0xc3, 0x1d, 0x59, 0x46, 0x0b, 0x22, - 0x80, 0xc8, 0x3f, 0xf7, 0xcd, 0xcd, 0xae, 0x2d, 0xde, 0x23, 0x88, 0xbd, 0x9a, 0xbc, 0x73, 0xef, - 0x37, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x6c, 0x98, 0x62, 0xb2, 0x02, 0x00, 0x00, + // 332 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x41, 0x4f, 0xfa, 0x30, + 0x18, 0xc6, 0x37, 0x20, 0x1c, 0xca, 0x9f, 0xfc, 0x93, 0x46, 0x71, 0x92, 0x58, 0x88, 0xa7, 0x5d, + 0xec, 0x12, 0xb8, 0x9b, 0x80, 0x24, 0x7a, 0xf0, 0x40, 0xe0, 0xe6, 0xc5, 0x74, 0xe3, 0xcd, 0x68, + 0x84, 0x75, 0x69, 0xbb, 0x44, 0xf9, 0x14, 0x7e, 0x2c, 0x8e, 0x1c, 0x3d, 0x19, 0x03, 0x5f, 0xc4, + 0xd8, 0x16, 0x81, 0xc5, 0xdb, 0xf6, 0x3e, 0xcf, 0xf3, 0xeb, 0xd3, 0xbe, 0xe8, 0x22, 0x11, 0x3c, + 0xd3, 0xb2, 0xc8, 0x5e, 0xa2, 0x14, 0x32, 0x50, 0x5c, 0xd1, 0x5c, 0x0a, 0x2d, 0x70, 0x33, 0x5e, + 0x01, 0xfd, 0x15, 0xdb, 0x67, 0xa9, 0x48, 0x85, 0x51, 0xa2, 0x9f, 0x2f, 0x6b, 0x6a, 0xb7, 0x0e, + 0xe9, 0x9c, 0x49, 0xb6, 0x74, 0xe1, 0xf6, 0xe5, 0xd1, 0xbc, 0x88, 0x17, 0x5c, 0xcd, 0x41, 0x3a, + 0xa9, 0x73, 0x90, 0x58, 0x92, 0x40, 0xae, 0x61, 0xf6, 0x3c, 0x13, 0x4b, 0xc6, 0x33, 0x67, 0x38, + 0x6a, 0xc4, 0xa4, 0xe6, 0xc9, 0x02, 0xac, 0x70, 0xbd, 0xae, 0xa0, 0x7f, 0xf7, 0xb6, 0xe3, 0x54, + 0x33, 0x0d, 0xb8, 0x8f, 0xea, 0xf6, 0xd4, 0xc0, 0xef, 0xfa, 0x61, 0xa3, 0x77, 0x4e, 0x4f, 0x3a, + 0xd3, 0xb1, 0x11, 0x87, 0xb5, 0xf5, 0x67, 0xc7, 0x9b, 0x38, 0x2b, 0x1e, 0xa1, 0xe6, 0x78, 0x5f, + 0xe9, 0x91, 0x2b, 0x1d, 0x54, 0xba, 0xd5, 0xb0, 0xd1, 0x0b, 0xca, 0xd9, 0xbd, 0xc7, 0xc5, 0x4f, + 0x43, 0x78, 0x8a, 0xf0, 0xc0, 0xb5, 0x1f, 0x99, 0xf2, 0x06, 0x55, 0x35, 0xa8, 0xab, 0x12, 0xea, + 0xd4, 0xe8, 0x78, 0x7f, 0xc4, 0xf1, 0x2d, 0x6a, 0x0c, 0xec, 0x8d, 0x0d, 0xad, 0x66, 0x68, 0xad, + 0x32, 0xcd, 0x3a, 0x1c, 0xe6, 0x38, 0x80, 0x43, 0xf4, 0xdf, 0xbd, 0x98, 0xba, 0x13, 0x45, 0xa6, + 0x41, 0x06, 0xf5, 0xae, 0x1f, 0xd6, 0x26, 0xe5, 0xf1, 0xf0, 0x61, 0xbd, 0x25, 0xfe, 0x66, 0x4b, + 0xfc, 0xaf, 0x2d, 0xf1, 0xdf, 0x77, 0xc4, 0xdb, 0xec, 0x88, 0xf7, 0xb1, 0x23, 0xde, 0x13, 0x4d, + 0xb9, 0x9e, 0x17, 0x31, 0x4d, 0xc4, 0x32, 0x8a, 0x57, 0x70, 0xc3, 0x16, 0xf9, 0x9c, 0x69, 0x60, + 0xe6, 0x2f, 0x7a, 0x8d, 0x0e, 0xcb, 0xd1, 0x6f, 0x39, 0xa8, 0xb8, 0x6e, 0x76, 0xd3, 0xff, 0x0e, + 0x00, 0x00, 0xff, 0xff, 0x4c, 0xe4, 0x82, 0xe6, 0x48, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -166,20 +156,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x30 } - if len(m.BurnedCoinsList) > 0 { - for iNdEx := len(m.BurnedCoinsList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.BurnedCoinsList[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.ArticleList) > 0 { for iNdEx := len(m.ArticleList) - 1; iNdEx >= 0; iNdEx-- { { @@ -272,12 +248,6 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.BurnedCoinsList) > 0 { - for _, e := range m.BurnedCoinsList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } if m.ArticlesCounter != 0 { n += 1 + sovGenesis(uint64(m.ArticlesCounter)) } @@ -454,40 +424,6 @@ 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 BurnedCoinsList", 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.BurnedCoinsList = append(m.BurnedCoinsList, BurnedCoins{}) - if err := m.BurnedCoinsList[len(m.BurnedCoinsList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ArticlesCounter", wireType) From 0900c8d4cbf7ce766750bbe7023eaddbd12410cb Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 8 Dec 2022 20:16:43 +0200 Subject: [PATCH 29/54] query burned coins on burner module --- docs/static/openapi.yml | 379 ++++++------ proto/burner/query.proto | 16 +- proto/cointrunk/burned_coins.proto | 10 - proto/cointrunk/query.proto | 15 - .../bze-alphateam/bze/bze.burner.v1/index.ts | 33 + .../bze/bze.burner.v1/module/rest.ts | 112 +++- .../module/types/burner/query.ts | 204 +++++++ .../bze-alphateam/bze/bze.cointrunk/index.ts | 37 +- .../bze/bze.cointrunk/module/rest.ts | 46 -- .../module/types/cointrunk/query.ts | 201 ------- x/burner/client/cli/query.go | 1 + .../client/cli/query_all_burned_coins.go | 4 +- .../keeper/grpc_query_coins_burn_events.go | 5 +- x/burner/types/query.pb.go | 507 +++++++++++++++- x/burner/types/query.pb.gw.go | 85 ++- x/cointrunk/client/cli/query.go | 2 - x/cointrunk/types/query.pb.go | 567 ++---------------- x/cointrunk/types/query.pb.gw.go | 83 --- 18 files changed, 1179 insertions(+), 1128 deletions(-) delete mode 100644 proto/cointrunk/burned_coins.proto rename x/{cointrunk => burner}/client/cli/query_all_burned_coins.go (91%) rename x/{cointrunk => burner}/keeper/grpc_query_coins_burn_events.go (89%) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 42ced681..9e769025 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -4,61 +4,24 @@ info: name: '' description: '' paths: - /bzealphateam/bze/burner/params: + /bze/burner/v1/all_burned_coins: get: - summary: Parameters queries the parameters of the module. - operationId: BzeBurnerV1Params + operationId: BzeBurnerV1AllBurnedCoins 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: + burnedCoins: type: array items: type: object properties: - '@type': + burned: type: string - additionalProperties: {} - tags: - - Query - /bze/cointrunk/accepted_domain: - get: - summary: Queries a list of AcceptedDomain items. - operationId: BzeCointrunkAcceptedDomain - responses: - '200': - description: A successful response. - schema: - type: object - properties: - acceptedDomain: - type: array - items: - type: object - properties: - domain: + height: type: string - active: - type: boolean pagination: type: object properties: @@ -163,26 +126,61 @@ paths: type: boolean tags: - Query - /bze/cointrunk/all_anon_articles_counters: + /bze/burner/v1/params: get: - summary: Queries a list of AllAnonArticlesCounters items. - operationId: BzeCointrunkAllAnonArticlesCounters + summary: Parameters queries the parameters of the module. + operationId: BzeBurnerV1Params responses: '200': description: A successful response. schema: type: object properties: - AnonArticlesCounters: + 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: - key: + '@type': type: string - counter: + additionalProperties: {} + tags: + - Query + /bze/cointrunk/accepted_domain: + get: + summary: Queries a list of AcceptedDomain items. + operationId: BzeCointrunkAcceptedDomain + responses: + '200': + description: A successful response. + schema: + type: object + properties: + acceptedDomain: + type: array + items: + type: object + properties: + domain: type: string - format: uint64 + active: + type: boolean pagination: type: object properties: @@ -287,34 +285,26 @@ paths: type: boolean tags: - Query - /bze/cointrunk/all_articles: + /bze/cointrunk/all_anon_articles_counters: get: - summary: Queries a list of ArticlesByPrefix items. - operationId: BzeCointrunkAllArticles + summary: Queries a list of AllAnonArticlesCounters items. + operationId: BzeCointrunkAllAnonArticlesCounters responses: '200': description: A successful response. schema: type: object properties: - article: + AnonArticlesCounters: type: array items: type: object properties: - id: - type: string - format: uint64 - title: - type: string - url: - type: string - picture: + key: type: string - publisher: + counter: type: string - paid: - type: boolean + format: uint64 pagination: type: object properties: @@ -419,25 +409,34 @@ paths: type: boolean tags: - Query - /bze/cointrunk/all_burned_coins: + /bze/cointrunk/all_articles: get: - summary: Queries a list of CoinsBurnEvents items. - operationId: BzeCointrunkAllBurnedCoins + summary: Queries a list of ArticlesByPrefix items. + operationId: BzeCointrunkAllArticles responses: '200': description: A successful response. schema: type: object properties: - burnedCoins: + article: type: array items: type: object properties: - burned: + id: type: string - height: + format: uint64 + title: type: string + url: + type: string + picture: + type: string + publisher: + type: string + paid: + type: boolean pagination: type: object properties: @@ -30753,9 +30752,53 @@ paths: tags: - Query definitions: + bze.burner.v1.BurnedCoins: + type: object + properties: + burned: + type: string + height: + type: string bze.burner.v1.Params: type: object description: Params defines the parameters for the module. + bze.burner.v1.QueryAllBurnedCoinsResponse: + type: object + properties: + burnedCoins: + type: array + items: + type: object + properties: + burned: + type: string + height: + type: string + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } bze.burner.v1.QueryParamsResponse: type: object properties: @@ -30763,6 +30806,82 @@ definitions: description: params holds all the parameters of this module. type: object description: QueryParamsResponse is 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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: @@ -31117,13 +31236,6 @@ definitions: type: string paid: type: boolean - bze.cointrunk.BurnedCoins: - type: object - properties: - burned: - type: string - height: - type: string bze.cointrunk.MsgAddArticleResponse: type: object bze.cointrunk.Params: @@ -31265,43 +31377,6 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - bze.cointrunk.QueryAllBurnedCoinsResponse: - type: object - properties: - burnedCoins: - type: array - items: - type: object - properties: - burned: - type: string - height: - type: string - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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; - } bze.cointrunk.QueryParamsResponse: type: object properties: @@ -31366,82 +31441,6 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - 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 - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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; - } bze.scavenge.Commit: type: object properties: diff --git a/proto/burner/query.proto b/proto/burner/query.proto index 95ef6513..774aaea2 100644 --- a/proto/burner/query.proto +++ b/proto/burner/query.proto @@ -5,6 +5,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "burner/params.proto"; +import "burner/burned_coins.proto"; // this line is used by starport scaffolding # 1 option go_package = "github.com/bze-alphateam/bze/x/burner/types"; @@ -13,9 +14,13 @@ option go_package = "github.com/bze-alphateam/bze/x/burner/types"; service Query { // Parameters queries the parameters of the module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/bzealphateam/bze/burner/params"; + option (google.api.http).get = "/bze/burner/v1/params"; } // this line is used by starport scaffolding # 2 + + rpc AllBurnedCoins(QueryAllBurnedCoinsRequest) returns (QueryAllBurnedCoinsResponse) { + option (google.api.http).get = "/bze/burner/v1/all_burned_coins"; + } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -27,4 +32,13 @@ message QueryParamsResponse { Params params = 1 [(gogoproto.nullable) = false]; } +message QueryAllBurnedCoinsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllBurnedCoinsResponse { + repeated BurnedCoins burnedCoins = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + // this line is used by starport scaffolding # 3 diff --git a/proto/cointrunk/burned_coins.proto b/proto/cointrunk/burned_coins.proto deleted file mode 100644 index 8e0f778f..00000000 --- a/proto/cointrunk/burned_coins.proto +++ /dev/null @@ -1,10 +0,0 @@ -syntax = "proto3"; -package bze.cointrunk; - -option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; - -message BurnedCoins { - - string burned = 1; - string height = 2; -} \ No newline at end of file diff --git a/proto/cointrunk/query.proto b/proto/cointrunk/query.proto index 09c41dfd..29b11d9f 100644 --- a/proto/cointrunk/query.proto +++ b/proto/cointrunk/query.proto @@ -9,7 +9,6 @@ import "cointrunk/accepted_domain.proto"; import "cointrunk/publisher.proto"; import "cointrunk/article.proto"; import "cointrunk/anon_articles_counter.proto"; -import "cointrunk/burned_coins.proto"; // this line is used by starport scaffolding # 1 option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; @@ -40,11 +39,6 @@ service Query { option (google.api.http).get = "/bze/cointrunk/all_articles"; } -// Queries a list of CoinsBurnEvents items. - rpc AllBurnedCoins(QueryAllBurnedCoinsRequest) returns (QueryAllBurnedCoinsResponse) { - option (google.api.http).get = "/bze/cointrunk/all_burned_coins"; - } - // Queries a list of AllAnonArticlesCounters items. rpc AllAnonArticlesCounters(QueryAllAnonArticlesCountersRequest) returns (QueryAllAnonArticlesCountersResponse) { option (google.api.http).get = "/bze/cointrunk/all_anon_articles_counters"; @@ -97,15 +91,6 @@ message QueryAllArticlesResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } -message QueryAllBurnedCoinsRequest { -cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllBurnedCoinsResponse { - repeated BurnedCoins burnedCoins = 1 [(gogoproto.nullable) = false]; -cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - message QueryAllAnonArticlesCountersRequest { cosmos.base.query.v1beta1.PageRequest pagination = 1; } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts index a10fed2b..e3cb0c00 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts @@ -44,6 +44,7 @@ function getStructure(template) { const getDefaultState = () => { return { Params: {}, + AllBurnedCoins: {}, _Structure: { BurnCoinsProposal: getStructure(BurnCoinsProposal.fromPartial({})), @@ -83,6 +84,12 @@ export default { } return state.Params[JSON.stringify(params)] ?? {} }, + getAllBurnedCoins: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.AllBurnedCoins[JSON.stringify(params)] ?? {} + }, getTypeStructure: (state) => (type) => { return state._Structure[type].fields @@ -141,5 +148,31 @@ export default { + + + + async QueryAllBurnedCoins({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryAllBurnedCoins(query)).data + + + while (all && ( value).pagination && ( value).pagination.next_key!=null) { + let next_values=(await queryClient.queryAllBurnedCoins({...query, 'pagination.key':( value).pagination.next_key})).data + value = mergeResults(value, next_values); + } + commit('QUERY', { query: 'AllBurnedCoins', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllBurnedCoins', payload: { options: { all }, params: {...key},query }}) + return getters['getAllBurnedCoins']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryAllBurnedCoins API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + + + } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/rest.ts index 0c0992c3..d6cc2bdb 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/rest.ts @@ -20,11 +20,31 @@ export interface RpcStatus { details?: ProtobufAny[]; } +export interface V1BurnedCoins { + burned?: string; + height?: string; +} + /** * Params defines the parameters for the module. */ export type V1Params = object; +export interface V1QueryAllBurnedCoinsResponse { + burnedCoins?: V1BurnedCoins[]; + + /** + * 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; + * } + */ + pagination?: V1Beta1PageResponse; +} + /** * QueryParamsResponse is response type for the Query/Params RPC method. */ @@ -33,6 +53,69 @@ export interface V1QueryParamsResponse { params?: V1Params; } +/** +* message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } +*/ +export interface V1Beta1PageRequest { + /** + * 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. + * @format byte + */ + key?: string; + + /** + * 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. + * @format uint64 + */ + offset?: string; + + /** + * 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. + * @format uint64 + */ + limit?: string; + + /** + * 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. + */ + count_total?: boolean; + + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse?: boolean; +} + +/** +* 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; + } +*/ +export interface V1Beta1PageResponse { + /** @format byte */ + next_key?: string; + + /** @format uint64 */ + total?: string; +} + export type QueryParamsType = Record; export type ResponseFormat = keyof Omit; @@ -229,17 +312,42 @@ export class HttpClient { * @version version not set */ export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryAllBurnedCoins + * @request GET:/bze/burner/v1/all_burned_coins + */ + queryAllBurnedCoins = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/bze/burner/v1/all_burned_coins`, + method: "GET", + query: query, + format: "json", + ...params, + }); + /** * No description * * @tags Query * @name QueryParams * @summary Parameters queries the parameters of the module. - * @request GET:/bzealphateam/bze/burner/params + * @request GET:/bze/burner/v1/params */ queryParams = (params: RequestParams = {}) => this.request({ - path: `/bzealphateam/bze/burner/params`, + path: `/bze/burner/v1/params`, method: "GET", format: "json", ...params, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/query.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/query.ts index 671d0521..1d0a7544 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/query.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/query.ts @@ -1,6 +1,11 @@ /* eslint-disable */ import { Reader, Writer } from "protobufjs/minimal"; import { Params } from "../burner/params"; +import { + PageRequest, + PageResponse, +} from "../cosmos/base/query/v1beta1/pagination"; +import { BurnedCoins } from "../burner/burned_coins"; export const protobufPackage = "bze.burner.v1"; @@ -13,6 +18,15 @@ export interface QueryParamsResponse { params: Params | undefined; } +export interface QueryAllBurnedCoinsRequest { + pagination: PageRequest | undefined; +} + +export interface QueryAllBurnedCoinsResponse { + burnedCoins: BurnedCoins[]; + pagination: PageResponse | undefined; +} + const baseQueryParamsRequest: object = {}; export const QueryParamsRequest = { @@ -110,10 +124,186 @@ export const QueryParamsResponse = { }, }; +const baseQueryAllBurnedCoinsRequest: object = {}; + +export const QueryAllBurnedCoinsRequest = { + encode( + message: QueryAllBurnedCoinsRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryAllBurnedCoinsRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAllBurnedCoinsRequest, + } as QueryAllBurnedCoinsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllBurnedCoinsRequest { + const message = { + ...baseQueryAllBurnedCoinsRequest, + } as QueryAllBurnedCoinsRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllBurnedCoinsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAllBurnedCoinsRequest { + const message = { + ...baseQueryAllBurnedCoinsRequest, + } as QueryAllBurnedCoinsRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAllBurnedCoinsResponse: object = {}; + +export const QueryAllBurnedCoinsResponse = { + encode( + message: QueryAllBurnedCoinsResponse, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.burnedCoins) { + BurnedCoins.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryAllBurnedCoinsResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAllBurnedCoinsResponse, + } as QueryAllBurnedCoinsResponse; + message.burnedCoins = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.burnedCoins.push(BurnedCoins.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllBurnedCoinsResponse { + const message = { + ...baseQueryAllBurnedCoinsResponse, + } as QueryAllBurnedCoinsResponse; + message.burnedCoins = []; + if (object.burnedCoins !== undefined && object.burnedCoins !== null) { + for (const e of object.burnedCoins) { + message.burnedCoins.push(BurnedCoins.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllBurnedCoinsResponse): unknown { + const obj: any = {}; + if (message.burnedCoins) { + obj.burnedCoins = message.burnedCoins.map((e) => + e ? BurnedCoins.toJSON(e) : undefined + ); + } else { + obj.burnedCoins = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAllBurnedCoinsResponse { + const message = { + ...baseQueryAllBurnedCoinsResponse, + } as QueryAllBurnedCoinsResponse; + message.burnedCoins = []; + if (object.burnedCoins !== undefined && object.burnedCoins !== null) { + for (const e of object.burnedCoins) { + message.burnedCoins.push(BurnedCoins.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + /** Query defines the gRPC querier service. */ export interface Query { /** Parameters queries the parameters of the module. */ Params(request: QueryParamsRequest): Promise; + AllBurnedCoins( + request: QueryAllBurnedCoinsRequest + ): Promise; } export class QueryClientImpl implements Query { @@ -126,6 +316,20 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("bze.burner.v1.Query", "Params", data); return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); } + + AllBurnedCoins( + request: QueryAllBurnedCoinsRequest + ): Promise { + const data = QueryAllBurnedCoinsRequest.encode(request).finish(); + const promise = this.rpc.request( + "bze.burner.v1.Query", + "AllBurnedCoins", + data + ); + return promise.then((data) => + QueryAllBurnedCoinsResponse.decode(new Reader(data)) + ); + } } interface Rpc { diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts index b6a73523..1bc55672 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts @@ -4,13 +4,12 @@ import { AcceptedDomain } from "./module/types/cointrunk/accepted_domain" import { AcceptedDomainProposal } from "./module/types/cointrunk/accepted_domain_proposal" import { AnonArticlesCounter } from "./module/types/cointrunk/anon_articles_counter" import { Article } from "./module/types/cointrunk/article" -import { BurnedCoins } from "./module/types/cointrunk/burned_coins" import { Params } from "./module/types/cointrunk/params" import { Publisher } from "./module/types/cointrunk/publisher" import { PublisherProposal } from "./module/types/cointrunk/publisher_proposal" -export { AcceptedDomain, AcceptedDomainProposal, AnonArticlesCounter, Article, BurnedCoins, Params, Publisher, PublisherProposal }; +export { AcceptedDomain, AcceptedDomainProposal, AnonArticlesCounter, Article, Params, Publisher, PublisherProposal }; async function initTxClient(vuexGetters) { return await txClient(vuexGetters['common/wallet/signer'], { @@ -53,7 +52,6 @@ const getDefaultState = () => { Publisher: {}, PublisherByIndex: {}, AllArticles: {}, - AllBurnedCoins: {}, AllAnonArticlesCounters: {}, _Structure: { @@ -61,7 +59,6 @@ const getDefaultState = () => { AcceptedDomainProposal: getStructure(AcceptedDomainProposal.fromPartial({})), AnonArticlesCounter: getStructure(AnonArticlesCounter.fromPartial({})), Article: getStructure(Article.fromPartial({})), - BurnedCoins: getStructure(BurnedCoins.fromPartial({})), Params: getStructure(Params.fromPartial({})), Publisher: getStructure(Publisher.fromPartial({})), PublisherProposal: getStructure(PublisherProposal.fromPartial({})), @@ -122,12 +119,6 @@ export default { ( params).query=null } return state.AllArticles[JSON.stringify(params)] ?? {} - }, - getAllBurnedCoins: (state) => (params = { params: {}}) => { - if (!( params).query) { - ( params).query=null - } - return state.AllBurnedCoins[JSON.stringify(params)] ?? {} }, getAllAnonArticlesCounters: (state) => (params = { params: {}}) => { if (!( params).query) { @@ -296,32 +287,6 @@ export default { - async QueryAllBurnedCoins({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { - try { - const key = params ?? {}; - const queryClient=await initQueryClient(rootGetters) - let value= (await queryClient.queryAllBurnedCoins(query)).data - - - while (all && ( value).pagination && ( value).pagination.next_key!=null) { - let next_values=(await queryClient.queryAllBurnedCoins({...query, 'pagination.key':( value).pagination.next_key})).data - value = mergeResults(value, next_values); - } - commit('QUERY', { query: 'AllBurnedCoins', key: { params: {...key}, query}, value }) - if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllBurnedCoins', payload: { options: { all }, params: {...key},query }}) - return getters['getAllBurnedCoins']( { params: {...key}, query}) ?? {} - } catch (e) { - throw new Error('QueryClient:QueryAllBurnedCoins API Node Unavailable. Could not perform query: ' + e.message) - - } - }, - - - - - - - async QueryAllAnonArticlesCounters({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { try { const key = params ?? {}; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts index 15b1aecd..9a3729f0 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts @@ -31,11 +31,6 @@ export interface CointrunkArticle { paid?: boolean; } -export interface CointrunkBurnedCoins { - burned?: string; - height?: string; -} - export type CointrunkMsgAddArticleResponse = object; /** @@ -98,21 +93,6 @@ export interface CointrunkQueryAllArticlesResponse { pagination?: V1Beta1PageResponse; } -export interface CointrunkQueryAllBurnedCoinsResponse { - burnedCoins?: CointrunkBurnedCoins[]; - - /** - * 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; - * } - */ - pagination?: V1Beta1PageResponse; -} - /** * QueryParamsResponse is response type for the Query/Params RPC method. */ @@ -488,32 +468,6 @@ export class Api extends HttpClient - this.request({ - path: `/bze/cointrunk/all_burned_coins`, - method: "GET", - query: query, - format: "json", - ...params, - }); - /** * No description * diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts index 6e85f8ad..8791a6b0 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/query.ts @@ -8,7 +8,6 @@ import { import { AcceptedDomain } from "../cointrunk/accepted_domain"; import { Publisher } from "../cointrunk/publisher"; import { Article } from "../cointrunk/article"; -import { BurnedCoins } from "../cointrunk/burned_coins"; import { AnonArticlesCounter } from "../cointrunk/anon_articles_counter"; export const protobufPackage = "bze.cointrunk"; @@ -57,15 +56,6 @@ export interface QueryAllArticlesResponse { pagination: PageResponse | undefined; } -export interface QueryAllBurnedCoinsRequest { - pagination: PageRequest | undefined; -} - -export interface QueryAllBurnedCoinsResponse { - burnedCoins: BurnedCoins[]; - pagination: PageResponse | undefined; -} - export interface QueryAllAnonArticlesCountersRequest { pagination: PageRequest | undefined; } @@ -813,179 +803,6 @@ export const QueryAllArticlesResponse = { }, }; -const baseQueryAllBurnedCoinsRequest: object = {}; - -export const QueryAllBurnedCoinsRequest = { - encode( - message: QueryAllBurnedCoinsRequest, - writer: Writer = Writer.create() - ): Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllBurnedCoinsRequest { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllBurnedCoinsRequest, - } as QueryAllBurnedCoinsRequest; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllBurnedCoinsRequest { - const message = { - ...baseQueryAllBurnedCoinsRequest, - } as QueryAllBurnedCoinsRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllBurnedCoinsRequest): unknown { - const obj: any = {}; - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageRequest.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllBurnedCoinsRequest { - const message = { - ...baseQueryAllBurnedCoinsRequest, - } as QueryAllBurnedCoinsRequest; - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - -const baseQueryAllBurnedCoinsResponse: object = {}; - -export const QueryAllBurnedCoinsResponse = { - encode( - message: QueryAllBurnedCoinsResponse, - writer: Writer = Writer.create() - ): Writer { - for (const v of message.burnedCoins) { - BurnedCoins.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode( - message.pagination, - writer.uint32(18).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: Reader | Uint8Array, - length?: number - ): QueryAllBurnedCoinsResponse { - const reader = input instanceof Uint8Array ? new Reader(input) : input; - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseQueryAllBurnedCoinsResponse, - } as QueryAllBurnedCoinsResponse; - message.burnedCoins = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.burnedCoins.push(BurnedCoins.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): QueryAllBurnedCoinsResponse { - const message = { - ...baseQueryAllBurnedCoinsResponse, - } as QueryAllBurnedCoinsResponse; - message.burnedCoins = []; - if (object.burnedCoins !== undefined && object.burnedCoins !== null) { - for (const e of object.burnedCoins) { - message.burnedCoins.push(BurnedCoins.fromJSON(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromJSON(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, - - toJSON(message: QueryAllBurnedCoinsResponse): unknown { - const obj: any = {}; - if (message.burnedCoins) { - obj.burnedCoins = message.burnedCoins.map((e) => - e ? BurnedCoins.toJSON(e) : undefined - ); - } else { - obj.burnedCoins = []; - } - message.pagination !== undefined && - (obj.pagination = message.pagination - ? PageResponse.toJSON(message.pagination) - : undefined); - return obj; - }, - - fromPartial( - object: DeepPartial - ): QueryAllBurnedCoinsResponse { - const message = { - ...baseQueryAllBurnedCoinsResponse, - } as QueryAllBurnedCoinsResponse; - message.burnedCoins = []; - if (object.burnedCoins !== undefined && object.burnedCoins !== null) { - for (const e of object.burnedCoins) { - message.burnedCoins.push(BurnedCoins.fromPartial(e)); - } - } - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageResponse.fromPartial(object.pagination); - } else { - message.pagination = undefined; - } - return message; - }, -}; - const baseQueryAllAnonArticlesCountersRequest: object = {}; export const QueryAllAnonArticlesCountersRequest = { @@ -1185,10 +1002,6 @@ export interface Query { AllArticles( request: QueryAllArticlesRequest ): Promise; - /** Queries a list of CoinsBurnEvents items. */ - AllBurnedCoins( - request: QueryAllBurnedCoinsRequest - ): Promise; /** Queries a list of AllAnonArticlesCounters items. */ AllAnonArticlesCounters( request: QueryAllAnonArticlesCountersRequest @@ -1256,20 +1069,6 @@ export class QueryClientImpl implements Query { ); } - AllBurnedCoins( - request: QueryAllBurnedCoinsRequest - ): Promise { - const data = QueryAllBurnedCoinsRequest.encode(request).finish(); - const promise = this.rpc.request( - "bze.cointrunk.Query", - "AllBurnedCoins", - data - ); - return promise.then((data) => - QueryAllBurnedCoinsResponse.decode(new Reader(data)) - ); - } - AllAnonArticlesCounters( request: QueryAllAnonArticlesCountersRequest ): Promise { diff --git a/x/burner/client/cli/query.go b/x/burner/client/cli/query.go index 9805ca60..988b90d7 100644 --- a/x/burner/client/cli/query.go +++ b/x/burner/client/cli/query.go @@ -25,6 +25,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { } cmd.AddCommand(CmdQueryParams()) + cmd.AddCommand(CmdAllBurnedCoins()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/cointrunk/client/cli/query_all_burned_coins.go b/x/burner/client/cli/query_all_burned_coins.go similarity index 91% rename from x/cointrunk/client/cli/query_all_burned_coins.go rename to x/burner/client/cli/query_all_burned_coins.go index 47cb5ab2..330f255a 100644 --- a/x/cointrunk/client/cli/query_all_burned_coins.go +++ b/x/burner/client/cli/query_all_burned_coins.go @@ -3,7 +3,7 @@ package cli import ( "strconv" - "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/bze-alphateam/bze/x/burner/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" @@ -14,7 +14,7 @@ var _ = strconv.Itoa(0) func CmdAllBurnedCoins() *cobra.Command { cmd := &cobra.Command{ Use: "all-burned-coins", - Short: "Query coins-burn-events", + Short: "Query coins burned", Args: cobra.ExactArgs(0), RunE: func(cmd *cobra.Command, args []string) (err error) { diff --git a/x/cointrunk/keeper/grpc_query_coins_burn_events.go b/x/burner/keeper/grpc_query_coins_burn_events.go similarity index 89% rename from x/cointrunk/keeper/grpc_query_coins_burn_events.go rename to x/burner/keeper/grpc_query_coins_burn_events.go index e3f5f3c4..0e0003d9 100644 --- a/x/cointrunk/keeper/grpc_query_coins_burn_events.go +++ b/x/burner/keeper/grpc_query_coins_burn_events.go @@ -2,11 +2,10 @@ package keeper import ( "context" - types2 "github.com/bze-alphateam/bze/x/burner/types" "github.com/cosmos/cosmos-sdk/store/prefix" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/bze-alphateam/bze/x/burner/types" sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -20,7 +19,7 @@ func (k Keeper) AllBurnedCoins(goCtx context.Context, req *types.QueryAllBurnedC ctx := sdk.UnwrapSDKContext(goCtx) var burnedCoins []types.BurnedCoins store := ctx.KVStore(k.storeKey) - burnedCoinsStore := prefix.NewStore(store, types.KeyPrefix(types2.BurnedCoinsKeyPrefix)) + burnedCoinsStore := prefix.NewStore(store, types.KeyPrefix(types.BurnedCoinsKeyPrefix)) pageRes, err := query.Paginate(burnedCoinsStore, req.Pagination, func(key []byte, value []byte) error { var entry types.BurnedCoins if err := k.cdc.Unmarshal(value, &entry); err != nil { diff --git a/x/burner/types/query.pb.go b/x/burner/types/query.pb.go index 7ed9428c..bd548cbc 100644 --- a/x/burner/types/query.pb.go +++ b/x/burner/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/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -113,34 +113,141 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } +type QueryAllBurnedCoinsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllBurnedCoinsRequest) Reset() { *m = QueryAllBurnedCoinsRequest{} } +func (m *QueryAllBurnedCoinsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllBurnedCoinsRequest) ProtoMessage() {} +func (*QueryAllBurnedCoinsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9db476c77eff2c96, []int{2} +} +func (m *QueryAllBurnedCoinsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllBurnedCoinsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllBurnedCoinsRequest.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 *QueryAllBurnedCoinsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllBurnedCoinsRequest.Merge(m, src) +} +func (m *QueryAllBurnedCoinsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllBurnedCoinsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllBurnedCoinsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllBurnedCoinsRequest proto.InternalMessageInfo + +func (m *QueryAllBurnedCoinsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllBurnedCoinsResponse struct { + BurnedCoins []BurnedCoins `protobuf:"bytes,1,rep,name=burnedCoins,proto3" json:"burnedCoins"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllBurnedCoinsResponse) Reset() { *m = QueryAllBurnedCoinsResponse{} } +func (m *QueryAllBurnedCoinsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllBurnedCoinsResponse) ProtoMessage() {} +func (*QueryAllBurnedCoinsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9db476c77eff2c96, []int{3} +} +func (m *QueryAllBurnedCoinsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllBurnedCoinsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllBurnedCoinsResponse.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 *QueryAllBurnedCoinsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllBurnedCoinsResponse.Merge(m, src) +} +func (m *QueryAllBurnedCoinsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllBurnedCoinsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllBurnedCoinsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllBurnedCoinsResponse proto.InternalMessageInfo + +func (m *QueryAllBurnedCoinsResponse) GetBurnedCoins() []BurnedCoins { + if m != nil { + return m.BurnedCoins + } + return nil +} + +func (m *QueryAllBurnedCoinsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "bze.burner.v1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "bze.burner.v1.QueryParamsResponse") + proto.RegisterType((*QueryAllBurnedCoinsRequest)(nil), "bze.burner.v1.QueryAllBurnedCoinsRequest") + proto.RegisterType((*QueryAllBurnedCoinsResponse)(nil), "bze.burner.v1.QueryAllBurnedCoinsResponse") } func init() { proto.RegisterFile("burner/query.proto", fileDescriptor_9db476c77eff2c96) } var fileDescriptor_9db476c77eff2c96 = []byte{ - // 303 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xc1, 0x4a, 0x33, 0x31, - 0x14, 0x85, 0x67, 0x7e, 0x7e, 0xbb, 0x18, 0x71, 0x93, 0x56, 0x90, 0x22, 0xa9, 0x9d, 0x8d, 0xa2, - 0x98, 0xd0, 0xf6, 0x0d, 0x0a, 0x6e, 0x5c, 0x69, 0x97, 0xee, 0x92, 0x72, 0x49, 0x07, 0xda, 0xdc, - 0x74, 0x92, 0x29, 0x6d, 0x77, 0xfa, 0x04, 0x82, 0x2f, 0xd5, 0x65, 0xc1, 0x8d, 0x2b, 0x91, 0xd6, - 0x07, 0x91, 0x49, 0xc6, 0xc5, 0x28, 0xb8, 0x4b, 0xce, 0xfd, 0xce, 0xe1, 0xdc, 0x9b, 0x10, 0x59, - 0xe4, 0x1a, 0x72, 0x3e, 0x2f, 0x20, 0x5f, 0x31, 0x93, 0xa3, 0x43, 0x72, 0x24, 0xd7, 0xc0, 0x82, - 0xce, 0x16, 0xbd, 0x76, 0x4b, 0xa1, 0x42, 0x3f, 0xe1, 0xe5, 0x2b, 0x40, 0xed, 0x53, 0x85, 0xa8, - 0xa6, 0xc0, 0x85, 0xc9, 0xb8, 0xd0, 0x1a, 0x9d, 0x70, 0x19, 0x6a, 0x5b, 0x4d, 0x2f, 0xc7, 0x68, - 0x67, 0x68, 0xb9, 0x14, 0x16, 0x42, 0x36, 0x5f, 0xf4, 0x24, 0x38, 0xd1, 0xe3, 0x46, 0xa8, 0x4c, - 0x7b, 0xb8, 0x62, 0x9b, 0x55, 0x05, 0x23, 0x72, 0x31, 0xab, 0x02, 0xd2, 0x56, 0x42, 0xee, 0x4b, - 0xdb, 0x9d, 0x17, 0x47, 0x30, 0x2f, 0xc0, 0xba, 0xf4, 0x36, 0x69, 0xd6, 0x54, 0x6b, 0x50, 0x5b, - 0x20, 0x83, 0xa4, 0x11, 0xcc, 0x27, 0xf1, 0x59, 0x7c, 0x71, 0xd8, 0x3f, 0x66, 0xb5, 0x0d, 0x58, - 0xc0, 0x87, 0xff, 0x37, 0xef, 0x9d, 0x68, 0x54, 0xa1, 0xfd, 0xc7, 0x38, 0x39, 0xf0, 0x61, 0x64, - 0x99, 0x34, 0x02, 0x41, 0xba, 0x3f, 0x8c, 0xbf, 0x2b, 0xb4, 0xd3, 0xbf, 0x90, 0xd0, 0x27, 0x3d, - 0x7f, 0x7a, 0xfd, 0x7c, 0xf9, 0xd7, 0x25, 0x1d, 0x2e, 0xd7, 0x20, 0xa6, 0x66, 0x22, 0x1c, 0x88, - 0x59, 0xf9, 0xe1, 0xb5, 0x5d, 0x87, 0x37, 0x9b, 0x1d, 0x8d, 0xb7, 0x3b, 0x1a, 0x7f, 0xec, 0x68, - 0xfc, 0xbc, 0xa7, 0xd1, 0x76, 0x4f, 0xa3, 0xb7, 0x3d, 0x8d, 0x1e, 0xae, 0x54, 0xe6, 0x26, 0x85, - 0x64, 0x63, 0xf4, 0xbe, 0xeb, 0x7a, 0xca, 0xf2, 0x3b, 0xc7, 0xad, 0x0c, 0x58, 0xd9, 0xf0, 0x37, - 0x1b, 0x7c, 0x05, 0x00, 0x00, 0xff, 0xff, 0x16, 0xe7, 0xbe, 0xda, 0xcd, 0x01, 0x00, 0x00, + // 444 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xb1, 0x8e, 0xd3, 0x30, + 0x18, 0xc7, 0xe3, 0x02, 0x1d, 0x5c, 0xc1, 0xe0, 0xbb, 0x13, 0x47, 0x80, 0xdc, 0x5d, 0x06, 0xee, + 0x28, 0xc2, 0x56, 0xda, 0x27, 0x20, 0x08, 0x90, 0x98, 0x4a, 0x47, 0x96, 0xca, 0x6e, 0xad, 0x34, + 0x52, 0x1a, 0xa7, 0xb1, 0x53, 0xd1, 0x8e, 0x8c, 0x4c, 0x95, 0x78, 0x0b, 0x9e, 0xa4, 0x63, 0x25, + 0x16, 0x26, 0x84, 0x5a, 0x1e, 0x04, 0xc5, 0x76, 0xd5, 0xa4, 0x54, 0x70, 0x53, 0x9b, 0xcf, 0xff, + 0xef, 0xff, 0xfd, 0xfe, 0xf6, 0x07, 0x11, 0x2b, 0xf2, 0x94, 0xe7, 0x64, 0x5a, 0xf0, 0x7c, 0x8e, + 0xb3, 0x5c, 0x28, 0x81, 0xee, 0xb3, 0x05, 0xc7, 0xa6, 0x8e, 0x67, 0x81, 0x7b, 0x1a, 0x89, 0x48, + 0xe8, 0x13, 0x52, 0xfe, 0x33, 0x22, 0xf7, 0x49, 0x24, 0x44, 0x94, 0x70, 0x42, 0xb3, 0x98, 0xd0, + 0x34, 0x15, 0x8a, 0xaa, 0x58, 0xa4, 0xd2, 0x9e, 0xb6, 0x87, 0x42, 0x4e, 0x84, 0x24, 0x8c, 0x4a, + 0x6e, 0xbc, 0xc9, 0x2c, 0x60, 0x5c, 0xd1, 0x80, 0x64, 0x34, 0x8a, 0x53, 0x2d, 0xb6, 0xda, 0x13, + 0x8b, 0x90, 0xd1, 0x9c, 0x4e, 0x76, 0x06, 0x8f, 0x6c, 0x51, 0xff, 0x8c, 0x06, 0x43, 0x11, 0xef, + 0xbc, 0xfd, 0x53, 0x88, 0x3e, 0x94, 0x8e, 0x3d, 0xad, 0xef, 0xf3, 0x69, 0xc1, 0xa5, 0xf2, 0xdf, + 0xc3, 0x93, 0x5a, 0x55, 0x66, 0x22, 0x95, 0x1c, 0x75, 0x61, 0xd3, 0xf8, 0x9e, 0x83, 0x4b, 0x70, + 0xd3, 0xea, 0x9c, 0xe1, 0x5a, 0x38, 0x6c, 0xe4, 0xe1, 0xdd, 0xd5, 0xcf, 0x0b, 0xa7, 0x6f, 0xa5, + 0xfe, 0x08, 0xba, 0xda, 0xeb, 0x55, 0x92, 0x84, 0x7a, 0xfe, 0xeb, 0x72, 0xbc, 0x9d, 0x84, 0xde, + 0x42, 0xb8, 0xcf, 0x60, 0x6d, 0x9f, 0x61, 0x13, 0x18, 0x97, 0x81, 0xb1, 0xb9, 0x4c, 0x1b, 0x18, + 0xf7, 0x68, 0xc4, 0x6d, 0x6f, 0xbf, 0xd2, 0xe9, 0x7f, 0x03, 0xf0, 0xf1, 0xd1, 0x31, 0x16, 0x3d, + 0x84, 0x2d, 0xb6, 0x2f, 0x9f, 0x83, 0xcb, 0x3b, 0x37, 0xad, 0x8e, 0x7b, 0xc0, 0x5f, 0x69, 0xb4, + 0x21, 0xaa, 0x4d, 0xe8, 0x5d, 0x8d, 0xb5, 0xa1, 0x59, 0xaf, 0xff, 0xcb, 0x6a, 0x00, 0xaa, 0xb0, + 0x9d, 0x2f, 0x0d, 0x78, 0x4f, 0xc3, 0xa2, 0x14, 0x36, 0xcd, 0xa5, 0xa1, 0xab, 0x03, 0x96, 0xbf, + 0x5f, 0xc5, 0xf5, 0xff, 0x25, 0x31, 0x63, 0xfc, 0xa7, 0x9f, 0xbf, 0xff, 0xfe, 0xda, 0x78, 0x88, + 0xce, 0x08, 0x5b, 0x70, 0x62, 0xdf, 0x7d, 0x16, 0xd8, 0x7d, 0x40, 0x4b, 0x00, 0x1f, 0xd4, 0x6f, + 0x08, 0x3d, 0x3f, 0xe6, 0x7a, 0xf4, 0xb1, 0xdc, 0xf6, 0x6d, 0xa4, 0x16, 0xe4, 0x5a, 0x83, 0x5c, + 0xa1, 0x8b, 0x03, 0x10, 0x9a, 0x24, 0x83, 0xea, 0x1e, 0x86, 0x6f, 0x56, 0x1b, 0x0f, 0xac, 0x37, + 0x1e, 0xf8, 0xb5, 0xf1, 0xc0, 0x72, 0xeb, 0x39, 0xeb, 0xad, 0xe7, 0xfc, 0xd8, 0x7a, 0xce, 0xc7, + 0x17, 0x51, 0xac, 0xc6, 0x05, 0xc3, 0x43, 0x31, 0x29, 0x4d, 0x5e, 0xd2, 0x24, 0x1b, 0x53, 0xc5, + 0xa9, 0xfe, 0x22, 0x9f, 0x76, 0xa6, 0x6a, 0x9e, 0x71, 0xc9, 0x9a, 0x7a, 0x9f, 0xbb, 0x7f, 0x02, + 0x00, 0x00, 0xff, 0xff, 0xd7, 0x7f, 0x5c, 0x1f, 0x84, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -157,6 +264,7 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + AllBurnedCoins(ctx context.Context, in *QueryAllBurnedCoinsRequest, opts ...grpc.CallOption) (*QueryAllBurnedCoinsResponse, error) } type queryClient struct { @@ -176,10 +284,20 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } +func (c *queryClient) AllBurnedCoins(ctx context.Context, in *QueryAllBurnedCoinsRequest, opts ...grpc.CallOption) (*QueryAllBurnedCoinsResponse, error) { + out := new(QueryAllBurnedCoinsResponse) + err := c.cc.Invoke(ctx, "/bze.burner.v1.Query/AllBurnedCoins", 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) + AllBurnedCoins(context.Context, *QueryAllBurnedCoinsRequest) (*QueryAllBurnedCoinsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -189,6 +307,9 @@ 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) AllBurnedCoins(ctx context.Context, req *QueryAllBurnedCoinsRequest) (*QueryAllBurnedCoinsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllBurnedCoins not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -212,6 +333,24 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_AllBurnedCoins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllBurnedCoinsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllBurnedCoins(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bze.burner.v1.Query/AllBurnedCoins", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllBurnedCoins(ctx, req.(*QueryAllBurnedCoinsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "bze.burner.v1.Query", HandlerType: (*QueryServer)(nil), @@ -220,6 +359,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, + { + MethodName: "AllBurnedCoins", + Handler: _Query_AllBurnedCoins_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "burner/query.proto", @@ -281,6 +424,90 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryAllBurnedCoinsRequest) 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 *QueryAllBurnedCoinsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllBurnedCoinsRequest) 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 *QueryAllBurnedCoinsResponse) 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 *QueryAllBurnedCoinsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllBurnedCoinsResponse) 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.BurnedCoins) > 0 { + for iNdEx := len(m.BurnedCoins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BurnedCoins[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,6 +539,38 @@ func (m *QueryParamsResponse) Size() (n int) { return n } +func (m *QueryAllBurnedCoinsRequest) 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 *QueryAllBurnedCoinsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.BurnedCoins) > 0 { + for _, e := range m.BurnedCoins { + 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 } @@ -451,6 +710,212 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryAllBurnedCoinsRequest) 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: QueryAllBurnedCoinsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllBurnedCoinsRequest: 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 *QueryAllBurnedCoinsResponse) 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: QueryAllBurnedCoinsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllBurnedCoinsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BurnedCoins", 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.BurnedCoins = append(m.BurnedCoins, BurnedCoins{}) + if err := m.BurnedCoins[len(m.BurnedCoins)-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/burner/types/query.pb.gw.go b/x/burner/types/query.pb.gw.go index 8adf9ce1..92ab0d96 100644 --- a/x/burner/types/query.pb.gw.go +++ b/x/burner/types/query.pb.gw.go @@ -51,6 +51,42 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } +var ( + filter_Query_AllBurnedCoins_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AllBurnedCoins_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllBurnedCoinsRequest + 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_AllBurnedCoins_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllBurnedCoins(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllBurnedCoins_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllBurnedCoinsRequest + 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_AllBurnedCoins_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllBurnedCoins(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 +116,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_AllBurnedCoins_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_AllBurnedCoins_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_AllBurnedCoins_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -141,13 +200,37 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_AllBurnedCoins_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_AllBurnedCoins_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_AllBurnedCoins_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{"bzealphateam", "bze", "burner", "params"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze", "burner", "v1", "params"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_AllBurnedCoins_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze", "burner", "v1", "all_burned_coins"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_AllBurnedCoins_0 = runtime.ForwardResponseMessage ) diff --git a/x/cointrunk/client/cli/query.go b/x/cointrunk/client/cli/query.go index e584089f..b0405209 100644 --- a/x/cointrunk/client/cli/query.go +++ b/x/cointrunk/client/cli/query.go @@ -31,8 +31,6 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdAllArticles()) - cmd.AddCommand(CmdAllBurnedCoins()) - cmd.AddCommand(CmdAllAnonArticlesCounters()) // this line is used by starport scaffolding # 1 diff --git a/x/cointrunk/types/query.pb.go b/x/cointrunk/types/query.pb.go index 24e311b7..9b4d9579 100644 --- a/x/cointrunk/types/query.pb.go +++ b/x/cointrunk/types/query.pb.go @@ -489,102 +489,6 @@ func (m *QueryAllArticlesResponse) GetPagination() *query.PageResponse { return nil } -type QueryAllBurnedCoinsRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllBurnedCoinsRequest) Reset() { *m = QueryAllBurnedCoinsRequest{} } -func (m *QueryAllBurnedCoinsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllBurnedCoinsRequest) ProtoMessage() {} -func (*QueryAllBurnedCoinsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_12b6eb50b0e9fa00, []int{10} -} -func (m *QueryAllBurnedCoinsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllBurnedCoinsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllBurnedCoinsRequest.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 *QueryAllBurnedCoinsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllBurnedCoinsRequest.Merge(m, src) -} -func (m *QueryAllBurnedCoinsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllBurnedCoinsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllBurnedCoinsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllBurnedCoinsRequest proto.InternalMessageInfo - -func (m *QueryAllBurnedCoinsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryAllBurnedCoinsResponse struct { - BurnedCoins []BurnedCoins `protobuf:"bytes,1,rep,name=burnedCoins,proto3" json:"burnedCoins"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllBurnedCoinsResponse) Reset() { *m = QueryAllBurnedCoinsResponse{} } -func (m *QueryAllBurnedCoinsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllBurnedCoinsResponse) ProtoMessage() {} -func (*QueryAllBurnedCoinsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_12b6eb50b0e9fa00, []int{11} -} -func (m *QueryAllBurnedCoinsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllBurnedCoinsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllBurnedCoinsResponse.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 *QueryAllBurnedCoinsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllBurnedCoinsResponse.Merge(m, src) -} -func (m *QueryAllBurnedCoinsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllBurnedCoinsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllBurnedCoinsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllBurnedCoinsResponse proto.InternalMessageInfo - -func (m *QueryAllBurnedCoinsResponse) GetBurnedCoins() []BurnedCoins { - if m != nil { - return m.BurnedCoins - } - return nil -} - -func (m *QueryAllBurnedCoinsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - type QueryAllAnonArticlesCountersRequest struct { Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -593,7 +497,7 @@ func (m *QueryAllAnonArticlesCountersRequest) Reset() { *m = QueryAllAno func (m *QueryAllAnonArticlesCountersRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllAnonArticlesCountersRequest) ProtoMessage() {} func (*QueryAllAnonArticlesCountersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_12b6eb50b0e9fa00, []int{12} + return fileDescriptor_12b6eb50b0e9fa00, []int{10} } func (m *QueryAllAnonArticlesCountersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -638,7 +542,7 @@ func (m *QueryAllAnonArticlesCountersResponse) Reset() { *m = QueryAllAn func (m *QueryAllAnonArticlesCountersResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllAnonArticlesCountersResponse) ProtoMessage() {} func (*QueryAllAnonArticlesCountersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_12b6eb50b0e9fa00, []int{13} + return fileDescriptor_12b6eb50b0e9fa00, []int{11} } func (m *QueryAllAnonArticlesCountersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -692,8 +596,6 @@ func init() { proto.RegisterType((*QueryPublisherByIndexResponse)(nil), "bze.cointrunk.QueryPublisherByIndexResponse") proto.RegisterType((*QueryAllArticlesRequest)(nil), "bze.cointrunk.QueryAllArticlesRequest") proto.RegisterType((*QueryAllArticlesResponse)(nil), "bze.cointrunk.QueryAllArticlesResponse") - proto.RegisterType((*QueryAllBurnedCoinsRequest)(nil), "bze.cointrunk.QueryAllBurnedCoinsRequest") - proto.RegisterType((*QueryAllBurnedCoinsResponse)(nil), "bze.cointrunk.QueryAllBurnedCoinsResponse") proto.RegisterType((*QueryAllAnonArticlesCountersRequest)(nil), "bze.cointrunk.QueryAllAnonArticlesCountersRequest") proto.RegisterType((*QueryAllAnonArticlesCountersResponse)(nil), "bze.cointrunk.QueryAllAnonArticlesCountersResponse") } @@ -701,61 +603,56 @@ func init() { func init() { proto.RegisterFile("cointrunk/query.proto", fileDescriptor_12b6eb50b0e9fa00) } var fileDescriptor_12b6eb50b0e9fa00 = []byte{ - // 851 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcb, 0x6e, 0xd3, 0x4c, - 0x14, 0x8e, 0xfb, 0xff, 0x6d, 0xd5, 0x89, 0xa8, 0xd0, 0x90, 0x34, 0xa9, 0xdb, 0xa4, 0xa9, 0x7b, - 0x6f, 0xc1, 0x56, 0x53, 0xc4, 0x8a, 0x4d, 0x53, 0xc4, 0x75, 0x53, 0xb2, 0x44, 0xa0, 0x68, 0x9c, - 0x8c, 0x52, 0x0b, 0xc7, 0xe3, 0xc6, 0x0e, 0xea, 0x45, 0x6c, 0xe0, 0x01, 0xa8, 0xc4, 0x82, 0x05, - 0x0b, 0xf6, 0x6c, 0x11, 0xef, 0xd0, 0x0d, 0x52, 0x25, 0x36, 0xac, 0x10, 0x6a, 0x79, 0x01, 0xde, - 0x00, 0x79, 0x7c, 0xec, 0xd8, 0x13, 0xa7, 0x17, 0x94, 0x9d, 0x3d, 0xe7, 0x32, 0xdf, 0xf9, 0xce, - 0x99, 0x6f, 0x06, 0x65, 0xeb, 0xcc, 0xb0, 0xdc, 0x76, 0xc7, 0x7a, 0xa9, 0xed, 0x76, 0x68, 0x7b, - 0x5f, 0xb5, 0xdb, 0xcc, 0x65, 0xf8, 0x9a, 0x7e, 0x40, 0xd5, 0xd0, 0x24, 0x67, 0x9a, 0xac, 0xc9, - 0xb8, 0x45, 0xf3, 0xbe, 0x7c, 0x27, 0x79, 0xba, 0xc9, 0x58, 0xd3, 0xa4, 0x1a, 0xb1, 0x0d, 0x8d, - 0x58, 0x16, 0x73, 0x89, 0x6b, 0x30, 0xcb, 0x01, 0xeb, 0x6a, 0x9d, 0x39, 0x2d, 0xe6, 0x68, 0x3a, - 0x71, 0xa8, 0x9f, 0x5b, 0x7b, 0xb5, 0xae, 0x53, 0x97, 0xac, 0x6b, 0x36, 0x69, 0x1a, 0x16, 0x77, - 0x06, 0xdf, 0x89, 0x2e, 0x0a, 0x9b, 0xb4, 0x49, 0x2b, 0xc8, 0x31, 0xd3, 0x5d, 0x27, 0xf5, 0x3a, - 0xb5, 0x5d, 0xda, 0xa8, 0x35, 0x58, 0x8b, 0x18, 0x41, 0xe0, 0x64, 0x24, 0xb0, 0xa3, 0x9b, 0x86, - 0xb3, 0x43, 0xdb, 0x60, 0xca, 0x45, 0x62, 0xdb, 0xae, 0x51, 0x37, 0x29, 0x18, 0x16, 0x22, 0x06, - 0x8b, 0x59, 0x35, 0xb0, 0x3a, 0xb5, 0x3a, 0xeb, 0x58, 0x6e, 0x18, 0x3f, 0xdd, 0x75, 0xd3, 0x3b, - 0x6d, 0x8b, 0x36, 0x6a, 0xde, 0x02, 0x20, 0x53, 0x32, 0x08, 0x3f, 0xf5, 0x6a, 0xda, 0xe6, 0x70, - 0xab, 0x74, 0xb7, 0x43, 0x1d, 0x57, 0x79, 0x8c, 0x6e, 0xc4, 0x56, 0x1d, 0x9b, 0x59, 0x0e, 0xc5, - 0x1b, 0x68, 0xc4, 0x2f, 0x2b, 0x2f, 0x95, 0xa4, 0xe5, 0x74, 0x39, 0xab, 0xc6, 0xe8, 0x55, 0x7d, - 0xf7, 0xca, 0xff, 0xc7, 0x3f, 0x67, 0x52, 0x55, 0x70, 0x55, 0x1a, 0x48, 0xe6, 0xb9, 0x36, 0xa1, - 0xf0, 0x7b, 0xbc, 0x6e, 0xd8, 0x09, 0xdf, 0x47, 0xa8, 0xcb, 0x22, 0xa4, 0x5d, 0x54, 0x7d, 0xca, - 0x55, 0x8f, 0x72, 0xd5, 0x6f, 0x27, 0x50, 0xae, 0x6e, 0x93, 0x26, 0x85, 0xd8, 0x6a, 0x24, 0x52, - 0xf9, 0x22, 0xa1, 0xa9, 0xc4, 0x6d, 0x00, 0xfa, 0x13, 0x34, 0x4e, 0x62, 0x96, 0xbc, 0x54, 0xfa, - 0x6f, 0x39, 0x5d, 0x2e, 0x08, 0x25, 0xc4, 0xc3, 0xa1, 0x14, 0x21, 0x14, 0x3f, 0x88, 0x81, 0x1e, - 0xe2, 0xa0, 0x97, 0x2e, 0x04, 0xed, 0x23, 0x89, 0xa1, 0xae, 0xa1, 0xac, 0xcf, 0x73, 0xd0, 0xf3, - 0x41, 0xd3, 0xf2, 0x49, 0x42, 0x13, 0xe2, 0x0e, 0xc0, 0xc8, 0x5d, 0x34, 0x16, 0x8e, 0x1a, 0x90, - 0x91, 0x17, 0xfb, 0x19, 0xd8, 0x81, 0x87, 0x6e, 0xc0, 0xe0, 0x28, 0xb8, 0x8d, 0xa6, 0xe3, 0x00, - 0x2b, 0xfb, 0x8f, 0xac, 0x06, 0xdd, 0x0b, 0x98, 0xc8, 0xa0, 0x61, 0xc3, 0xfb, 0xe7, 0x24, 0x8c, - 0x55, 0xfd, 0x1f, 0xe5, 0x05, 0x2a, 0xf4, 0x89, 0x4a, 0xae, 0x4e, 0xba, 0x52, 0x75, 0x0a, 0x41, - 0x39, 0x7f, 0x98, 0x4c, 0x73, 0x13, 0x4e, 0x55, 0x72, 0x67, 0x86, 0xfe, 0xb9, 0x33, 0x1f, 0x25, - 0x94, 0xef, 0xdd, 0x03, 0xd0, 0xdf, 0x41, 0xa3, 0x70, 0x9a, 0xa1, 0x33, 0x13, 0xe2, 0x98, 0xfa, - 0x56, 0x40, 0x1e, 0x38, 0x0f, 0xae, 0x2b, 0xe1, 0xa1, 0x35, 0xcd, 0x0a, 0x17, 0x8d, 0x2d, 0x4f, - 0x33, 0x06, 0x3d, 0x9d, 0x9f, 0xc3, 0x43, 0x2b, 0x6c, 0x03, 0x34, 0x54, 0x50, 0x5a, 0xef, 0x2e, - 0x03, 0x15, 0xb2, 0x40, 0x45, 0x24, 0x10, 0xe8, 0x88, 0x06, 0x0d, 0x8e, 0x92, 0x16, 0x9a, 0x0b, - 0xfb, 0x65, 0x31, 0x2b, 0xe8, 0xd9, 0x96, 0x2f, 0xb6, 0x03, 0xe7, 0xe6, 0x9b, 0x84, 0xe6, 0xcf, - 0xdf, 0x0f, 0x48, 0x7a, 0x8e, 0x32, 0x49, 0x76, 0x60, 0x4b, 0x11, 0x07, 0xa7, 0xd7, 0x15, 0x58, - 0x4b, 0xcc, 0x32, 0x30, 0xfa, 0xca, 0x7f, 0x46, 0xd1, 0x30, 0xaf, 0x07, 0x5b, 0x68, 0xc4, 0xbf, - 0x28, 0xf0, 0xac, 0x00, 0xae, 0xf7, 0x26, 0x92, 0x95, 0xf3, 0x5c, 0xfc, 0x6d, 0x94, 0xc2, 0x9b, - 0xef, 0xbf, 0xdf, 0x0f, 0xe5, 0x70, 0x56, 0xd3, 0x0f, 0xa8, 0x26, 0x5e, 0xc1, 0xf8, 0x9d, 0x84, - 0xc6, 0xe3, 0xb2, 0x8e, 0x57, 0x92, 0xb2, 0x26, 0x5e, 0x50, 0xf2, 0xea, 0x65, 0x5c, 0x01, 0xc8, - 0x22, 0x07, 0x52, 0xc2, 0x45, 0x01, 0x88, 0x70, 0xe7, 0xe3, 0x43, 0x34, 0x16, 0x8a, 0x0f, 0x9e, - 0x4f, 0xac, 0x50, 0xb8, 0x10, 0xe4, 0x85, 0x0b, 0xbc, 0x00, 0xc1, 0x2c, 0x47, 0x30, 0x85, 0x27, - 0x45, 0x2a, 0x02, 0x4f, 0x07, 0x7f, 0x90, 0xd0, 0x75, 0x51, 0x36, 0xf1, 0xda, 0xb9, 0xe9, 0xe3, - 0x92, 0x2c, 0xdf, 0xbc, 0x9c, 0x33, 0x40, 0x5a, 0xe6, 0x90, 0x14, 0x5c, 0xea, 0x07, 0x49, 0x3b, - 0xe4, 0x9a, 0xfe, 0x1a, 0xbf, 0x95, 0x50, 0x3a, 0xa2, 0x86, 0x78, 0x31, 0x91, 0xfa, 0x1e, 0x49, - 0x96, 0x97, 0x2e, 0xf4, 0x03, 0x28, 0x73, 0x1c, 0x4a, 0x01, 0x4f, 0x89, 0xfd, 0x31, 0xcd, 0xf0, - 0xf5, 0x84, 0x8f, 0xbc, 0x71, 0x89, 0xe9, 0x51, 0x9f, 0x71, 0x49, 0x92, 0xc6, 0x3e, 0xe3, 0x92, - 0x28, 0x6f, 0xca, 0x12, 0x87, 0x33, 0x8b, 0x67, 0x12, 0xe0, 0x44, 0x9f, 0x6a, 0xf8, 0xab, 0x84, - 0x72, 0x7d, 0x64, 0x00, 0x97, 0xfb, 0x15, 0xdf, 0x5f, 0xa3, 0xe4, 0x8d, 0x2b, 0xc5, 0x00, 0xda, - 0x75, 0x8e, 0x76, 0x0d, 0xaf, 0x24, 0x91, 0x97, 0xf4, 0xfe, 0x74, 0x2a, 0x0f, 0x8f, 0x4f, 0x8b, - 0xd2, 0xc9, 0x69, 0x51, 0xfa, 0x75, 0x5a, 0x94, 0x8e, 0xce, 0x8a, 0xa9, 0x93, 0xb3, 0x62, 0xea, - 0xc7, 0x59, 0x31, 0xf5, 0x4c, 0x6d, 0x1a, 0xee, 0x4e, 0x47, 0x57, 0xeb, 0xac, 0xe5, 0xa5, 0xbb, - 0x45, 0x4c, 0x7b, 0x87, 0xb8, 0x94, 0xf0, 0x3f, 0x6d, 0x2f, 0x92, 0xde, 0xdd, 0xb7, 0xa9, 0xa3, - 0x8f, 0xf0, 0xd7, 0xea, 0xc6, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x50, 0x4a, 0x3d, 0xf6, 0xe7, - 0x0b, 0x00, 0x00, + // 769 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x4b, 0x6f, 0xd3, 0x4a, + 0x14, 0xc7, 0x33, 0xbd, 0xb7, 0xb9, 0xea, 0xa9, 0x6e, 0x75, 0x35, 0x37, 0x69, 0x52, 0xb7, 0x49, + 0x53, 0xf7, 0xdd, 0x82, 0xad, 0xa6, 0x88, 0x15, 0x9b, 0x16, 0xc4, 0x73, 0x53, 0xb2, 0x44, 0xa0, + 0x68, 0x92, 0x8c, 0x52, 0x0b, 0xc7, 0xe3, 0xc6, 0x0e, 0xea, 0x43, 0x6c, 0xe0, 0x03, 0x80, 0xc4, + 0x82, 0x05, 0x0b, 0x3e, 0x04, 0xe2, 0x3b, 0x74, 0x83, 0x54, 0x89, 0x0d, 0xab, 0x0a, 0xb5, 0x7c, + 0x10, 0x94, 0xf1, 0x71, 0x12, 0x4f, 0x9c, 0x3e, 0x50, 0x76, 0x71, 0xce, 0xeb, 0x77, 0xfe, 0x67, + 0xe6, 0xd8, 0x90, 0xae, 0x0a, 0xcb, 0xf1, 0x9b, 0x2d, 0xe7, 0xa5, 0xb9, 0xd7, 0xe2, 0xcd, 0x03, + 0xc3, 0x6d, 0x0a, 0x5f, 0xd0, 0x7f, 0x2b, 0x87, 0xdc, 0xe8, 0x98, 0xb4, 0x54, 0x5d, 0xd4, 0x85, + 0xb4, 0x98, 0xed, 0x5f, 0x81, 0x93, 0x36, 0x53, 0x17, 0xa2, 0x6e, 0x73, 0x93, 0xb9, 0x96, 0xc9, + 0x1c, 0x47, 0xf8, 0xcc, 0xb7, 0x84, 0xe3, 0xa1, 0x75, 0xad, 0x2a, 0xbc, 0x86, 0xf0, 0xcc, 0x0a, + 0xf3, 0x78, 0x90, 0xdb, 0x7c, 0xb5, 0x51, 0xe1, 0x3e, 0xdb, 0x30, 0x5d, 0x56, 0xb7, 0x1c, 0xe9, + 0x8c, 0xbe, 0x93, 0x5d, 0x0a, 0x97, 0x35, 0x59, 0x23, 0xcc, 0x31, 0xdb, 0xfd, 0x9f, 0x55, 0xab, + 0xdc, 0xf5, 0x79, 0xad, 0x5c, 0x13, 0x0d, 0x66, 0x85, 0x81, 0x53, 0x3d, 0x81, 0xad, 0x8a, 0x6d, + 0x79, 0xbb, 0xbc, 0x89, 0xa6, 0x4c, 0x4f, 0x6c, 0xd3, 0xb7, 0xaa, 0x36, 0x47, 0xc3, 0x62, 0x8f, + 0xc1, 0x11, 0x4e, 0x19, 0xad, 0x5e, 0xb9, 0x2a, 0x5a, 0x8e, 0x1f, 0xc6, 0xeb, 0x29, 0xa0, 0x4f, + 0xdb, 0xd4, 0x3b, 0x12, 0xa8, 0xc4, 0xf7, 0x5a, 0xdc, 0xf3, 0xf5, 0xc7, 0xf0, 0x7f, 0xe4, 0x5f, + 0xcf, 0x15, 0x8e, 0xc7, 0xe9, 0x26, 0x24, 0x03, 0xf0, 0x2c, 0x29, 0x90, 0x95, 0xf1, 0x62, 0xda, + 0x88, 0x08, 0x68, 0x04, 0xee, 0xdb, 0x7f, 0x1f, 0x9f, 0xce, 0x26, 0x4a, 0xe8, 0xaa, 0xd7, 0x40, + 0x93, 0xb9, 0xb6, 0xb0, 0xb5, 0x7b, 0xb2, 0x33, 0xac, 0x44, 0xef, 0x03, 0x74, 0x75, 0xc2, 0xb4, + 0x4b, 0x46, 0x20, 0xaa, 0xd1, 0x16, 0xd5, 0x08, 0x06, 0x86, 0xa2, 0x1a, 0x3b, 0xac, 0xce, 0x31, + 0xb6, 0xd4, 0x13, 0xa9, 0x7f, 0x21, 0x30, 0x1d, 0x5b, 0x06, 0xd1, 0x9f, 0xc0, 0x04, 0x8b, 0x58, + 0xb2, 0xa4, 0xf0, 0xd7, 0xca, 0x78, 0x31, 0xa7, 0xb4, 0x10, 0x0d, 0xc7, 0x56, 0x94, 0x50, 0xfa, + 0x20, 0x02, 0x3d, 0x22, 0xa1, 0x97, 0x2f, 0x85, 0x0e, 0x48, 0x22, 0xd4, 0x65, 0x48, 0x07, 0x3a, + 0x87, 0x53, 0x1d, 0xb6, 0x2c, 0x9f, 0x09, 0x4c, 0xaa, 0x15, 0x50, 0x91, 0x3b, 0x30, 0xd6, 0x39, + 0x4c, 0x28, 0x46, 0x56, 0x9d, 0x67, 0x68, 0x47, 0x1d, 0xba, 0x01, 0xc3, 0x93, 0xe0, 0x16, 0xcc, + 0x44, 0x01, 0xb7, 0x0f, 0x1e, 0x39, 0x35, 0xbe, 0x1f, 0x2a, 0x91, 0x82, 0x51, 0xab, 0xfd, 0x2c, + 0x45, 0x18, 0x2b, 0x05, 0x0f, 0xfa, 0x0b, 0xc8, 0x0d, 0x88, 0x8a, 0xef, 0x8e, 0x5c, 0xab, 0x3b, + 0x9d, 0x41, 0x26, 0x38, 0x4c, 0xb6, 0xbd, 0x85, 0xf7, 0x26, 0x7e, 0x32, 0x23, 0x7f, 0x3c, 0x99, + 0x4f, 0x04, 0xb2, 0xfd, 0x35, 0x90, 0xfe, 0x36, 0xfc, 0x83, 0xf7, 0x15, 0x27, 0x33, 0xa9, 0x1e, + 0xd3, 0xc0, 0x8a, 0xe4, 0xa1, 0xf3, 0xf0, 0xa6, 0xd2, 0x80, 0xf9, 0x0e, 0x9c, 0x23, 0x9c, 0x10, + 0xf0, 0x6e, 0xb0, 0x3b, 0xbc, 0x61, 0x1f, 0xd3, 0x6f, 0x04, 0x16, 0x2e, 0xae, 0x87, 0xc2, 0x3c, + 0x87, 0x54, 0x9c, 0x1d, 0x55, 0xd2, 0x55, 0x95, 0xfa, 0x5d, 0x51, 0xb1, 0xd8, 0x2c, 0x43, 0x93, + 0xaf, 0x78, 0x9a, 0x84, 0x51, 0xd9, 0x0f, 0x75, 0x20, 0x19, 0x6c, 0x45, 0x3a, 0xa7, 0xc0, 0xf5, + 0xaf, 0x5d, 0x4d, 0xbf, 0xc8, 0x25, 0x28, 0xa3, 0xe7, 0xde, 0x7c, 0xff, 0xf5, 0x61, 0x24, 0x43, + 0xd3, 0x66, 0xe5, 0x90, 0x9b, 0xea, 0x1b, 0x85, 0xbe, 0x23, 0x30, 0x11, 0xdd, 0x61, 0x74, 0x35, + 0x2e, 0x6b, 0xec, 0x36, 0xd6, 0xd6, 0xae, 0xe2, 0x8a, 0x20, 0x4b, 0x12, 0xa4, 0x40, 0xf3, 0x0a, + 0x88, 0xf2, 0x0a, 0xa3, 0x47, 0x30, 0xd6, 0xb9, 0x69, 0x74, 0x21, 0xb6, 0x43, 0x65, 0xfb, 0x69, + 0x8b, 0x97, 0x78, 0x21, 0xc1, 0x9c, 0x24, 0x98, 0xa6, 0x53, 0xaa, 0x14, 0xa1, 0xa7, 0x47, 0x3f, + 0x12, 0xf8, 0x4f, 0xdd, 0x11, 0x74, 0xfd, 0xc2, 0xf4, 0xd1, 0xfd, 0xa3, 0xdd, 0xb8, 0x9a, 0x33, + 0x22, 0xad, 0x48, 0x24, 0x9d, 0x16, 0x06, 0x21, 0x99, 0x47, 0x72, 0x81, 0xbd, 0xa6, 0x6f, 0x09, + 0x8c, 0xf7, 0x5c, 0x7d, 0xba, 0x14, 0x2b, 0x7d, 0xdf, 0xfe, 0xd1, 0x96, 0x2f, 0xf5, 0x43, 0x94, + 0x79, 0x89, 0x92, 0xa3, 0xd3, 0xea, 0x7c, 0x6c, 0xbb, 0xf3, 0x31, 0x40, 0xbf, 0x12, 0xc8, 0x0c, + 0xb8, 0x73, 0xb4, 0x38, 0xa8, 0xd2, 0xe0, 0x85, 0xa0, 0x6d, 0x5e, 0x2b, 0x06, 0x49, 0x37, 0x24, + 0xe9, 0x3a, 0x5d, 0x8d, 0x23, 0x8d, 0xfb, 0x76, 0xf1, 0xb6, 0x1f, 0x1e, 0x9f, 0xe5, 0xc9, 0xc9, + 0x59, 0x9e, 0xfc, 0x3c, 0xcb, 0x93, 0xf7, 0xe7, 0xf9, 0xc4, 0xc9, 0x79, 0x3e, 0xf1, 0xe3, 0x3c, + 0x9f, 0x78, 0x66, 0xd4, 0x2d, 0x7f, 0xb7, 0x55, 0x31, 0xaa, 0xa2, 0xd1, 0x4e, 0x77, 0x93, 0xd9, + 0xee, 0x2e, 0xf3, 0x39, 0x93, 0x4f, 0xe6, 0x7e, 0x4f, 0x7a, 0xff, 0xc0, 0xe5, 0x5e, 0x25, 0x29, + 0xbf, 0x83, 0x36, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x07, 0x8e, 0x2f, 0x50, 0x23, 0x0a, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -780,8 +677,6 @@ type QueryClient interface { PublisherByIndex(ctx context.Context, in *QueryPublisherByIndexRequest, opts ...grpc.CallOption) (*QueryPublisherByIndexResponse, error) // Queries a list of ArticlesByPrefix items. AllArticles(ctx context.Context, in *QueryAllArticlesRequest, opts ...grpc.CallOption) (*QueryAllArticlesResponse, error) - // Queries a list of CoinsBurnEvents items. - AllBurnedCoins(ctx context.Context, in *QueryAllBurnedCoinsRequest, opts ...grpc.CallOption) (*QueryAllBurnedCoinsResponse, error) // Queries a list of AllAnonArticlesCounters items. AllAnonArticlesCounters(ctx context.Context, in *QueryAllAnonArticlesCountersRequest, opts ...grpc.CallOption) (*QueryAllAnonArticlesCountersResponse, error) } @@ -839,15 +734,6 @@ func (c *queryClient) AllArticles(ctx context.Context, in *QueryAllArticlesReque return out, nil } -func (c *queryClient) AllBurnedCoins(ctx context.Context, in *QueryAllBurnedCoinsRequest, opts ...grpc.CallOption) (*QueryAllBurnedCoinsResponse, error) { - out := new(QueryAllBurnedCoinsResponse) - err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/AllBurnedCoins", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) AllAnonArticlesCounters(ctx context.Context, in *QueryAllAnonArticlesCountersRequest, opts ...grpc.CallOption) (*QueryAllAnonArticlesCountersResponse, error) { out := new(QueryAllAnonArticlesCountersResponse) err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/AllAnonArticlesCounters", in, out, opts...) @@ -869,8 +755,6 @@ type QueryServer interface { PublisherByIndex(context.Context, *QueryPublisherByIndexRequest) (*QueryPublisherByIndexResponse, error) // Queries a list of ArticlesByPrefix items. AllArticles(context.Context, *QueryAllArticlesRequest) (*QueryAllArticlesResponse, error) - // Queries a list of CoinsBurnEvents items. - AllBurnedCoins(context.Context, *QueryAllBurnedCoinsRequest) (*QueryAllBurnedCoinsResponse, error) // Queries a list of AllAnonArticlesCounters items. AllAnonArticlesCounters(context.Context, *QueryAllAnonArticlesCountersRequest) (*QueryAllAnonArticlesCountersResponse, error) } @@ -894,9 +778,6 @@ func (*UnimplementedQueryServer) PublisherByIndex(ctx context.Context, req *Quer func (*UnimplementedQueryServer) AllArticles(ctx context.Context, req *QueryAllArticlesRequest) (*QueryAllArticlesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AllArticles not implemented") } -func (*UnimplementedQueryServer) AllBurnedCoins(ctx context.Context, req *QueryAllBurnedCoinsRequest) (*QueryAllBurnedCoinsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllBurnedCoins not implemented") -} func (*UnimplementedQueryServer) AllAnonArticlesCounters(ctx context.Context, req *QueryAllAnonArticlesCountersRequest) (*QueryAllAnonArticlesCountersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AllAnonArticlesCounters not implemented") } @@ -995,24 +876,6 @@ func _Query_AllArticles_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } -func _Query_AllBurnedCoins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllBurnedCoinsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllBurnedCoins(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/bze.cointrunk.Query/AllBurnedCoins", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllBurnedCoins(ctx, req.(*QueryAllBurnedCoinsRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_AllAnonArticlesCounters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryAllAnonArticlesCountersRequest) if err := dec(in); err != nil { @@ -1055,10 +918,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "AllArticles", Handler: _Query_AllArticles_Handler, }, - { - MethodName: "AllBurnedCoins", - Handler: _Query_AllBurnedCoins_Handler, - }, { MethodName: "AllAnonArticlesCounters", Handler: _Query_AllAnonArticlesCounters_Handler, @@ -1439,90 +1298,6 @@ func (m *QueryAllArticlesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *QueryAllBurnedCoinsRequest) 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 *QueryAllBurnedCoinsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllBurnedCoinsRequest) 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 *QueryAllBurnedCoinsResponse) 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 *QueryAllBurnedCoinsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllBurnedCoinsResponse) 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.BurnedCoins) > 0 { - for iNdEx := len(m.BurnedCoins) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.BurnedCoins[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 *QueryAllAnonArticlesCountersRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1758,38 +1533,6 @@ func (m *QueryAllArticlesResponse) Size() (n int) { return n } -func (m *QueryAllBurnedCoinsRequest) 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 *QueryAllBurnedCoinsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.BurnedCoins) > 0 { - for _, e := range m.BurnedCoins { - 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 *QueryAllAnonArticlesCountersRequest) Size() (n int) { if m == nil { return 0 @@ -2744,212 +2487,6 @@ func (m *QueryAllArticlesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllBurnedCoinsRequest) 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: QueryAllBurnedCoinsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllBurnedCoinsRequest: 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 *QueryAllBurnedCoinsResponse) 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: QueryAllBurnedCoinsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllBurnedCoinsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BurnedCoins", 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.BurnedCoins = append(m.BurnedCoins, BurnedCoins{}) - if err := m.BurnedCoins[len(m.BurnedCoins)-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 *QueryAllAnonArticlesCountersRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/cointrunk/types/query.pb.gw.go b/x/cointrunk/types/query.pb.gw.go index d8e3edbd..d1dd7e47 100644 --- a/x/cointrunk/types/query.pb.gw.go +++ b/x/cointrunk/types/query.pb.gw.go @@ -213,42 +213,6 @@ func local_request_Query_AllArticles_0(ctx context.Context, marshaler runtime.Ma } -var ( - filter_Query_AllBurnedCoins_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_AllBurnedCoins_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllBurnedCoinsRequest - 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_AllBurnedCoins_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AllBurnedCoins(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AllBurnedCoins_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllBurnedCoinsRequest - 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_AllBurnedCoins_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AllBurnedCoins(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_Query_AllAnonArticlesCounters_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -406,29 +370,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_AllBurnedCoins_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_AllBurnedCoins_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_AllBurnedCoins_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_AllAnonArticlesCounters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -593,26 +534,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_AllBurnedCoins_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_AllBurnedCoins_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_AllBurnedCoins_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_AllAnonArticlesCounters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -647,8 +568,6 @@ var ( pattern_Query_AllArticles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "all_articles"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_AllBurnedCoins_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "all_burned_coins"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_AllAnonArticlesCounters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "all_anon_articles_counters"}, "", runtime.AssumeColonVerbOpt(true))) ) @@ -663,7 +582,5 @@ var ( forward_Query_AllArticles_0 = runtime.ForwardResponseMessage - forward_Query_AllBurnedCoins_0 = runtime.ForwardResponseMessage - forward_Query_AllAnonArticlesCounters_0 = runtime.ForwardResponseMessage ) From fda9163b18d4f05e6f109b3a846d3e476f9db210 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 8 Dec 2022 20:19:31 +0200 Subject: [PATCH 30/54] send paid article coins to burner module --- x/cointrunk/keeper/msg_server_add_article.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x/cointrunk/keeper/msg_server_add_article.go b/x/cointrunk/keeper/msg_server_add_article.go index 261f91c0..de5207bc 100644 --- a/x/cointrunk/keeper/msg_server_add_article.go +++ b/x/cointrunk/keeper/msg_server_add_article.go @@ -2,6 +2,7 @@ package keeper import ( "context" + burnermoduletypes "github.com/bze-alphateam/bze/x/burner/types" "github.com/bze-alphateam/bze/x/cointrunk/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -33,7 +34,7 @@ func (k msgServer) AddArticle(goCtx context.Context, msg *types.MsgAddArticle) ( panic(err) } - sdkErr := k.bankKeeper.SendCoinsFromAccountToModule(ctx, publisherAcc, types.ModuleName, articleCost) + sdkErr := k.bankKeeper.SendCoinsFromAccountToModule(ctx, publisherAcc, burnermoduletypes.ModuleName, articleCost) if sdkErr != nil { return nil, sdkErr } From 5d0735005dbf3588359eaccf5904f0fc6806fc46 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Fri, 9 Dec 2022 00:45:27 +0200 Subject: [PATCH 31/54] modified cmd names on cointrunk and implemented REST queries on burner module --- .../bze-alphateam/bze/bze.scavenge/index.ts | 40 +++++++++---------- .../bze/bze.scavenge/module/index.ts | 6 +-- x/burner/module.go | 2 + x/cointrunk/client/cli/gov.go | 4 +- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 36486b56..474b327f 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,6 +232,21 @@ export default { }, + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgRevealSolution(value) + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + }else{ + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + } + } + }, async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -262,22 +277,20 @@ export default { } } }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) const msg = await txClient.msgRevealSolution(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result + return msg } catch (e) { if (e == MissingWalletError) { throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + } else{ + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) @@ -304,19 +317,6 @@ export default { } } }, - async MsgRevealSolution({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) - } - } - }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 27b7f752..5f72a96b 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; +import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; -import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; }; diff --git a/x/burner/module.go b/x/burner/module.go index f784407b..9422d12a 100644 --- a/x/burner/module.go +++ b/x/burner/module.go @@ -1,6 +1,7 @@ package burner import ( + "context" "encoding/json" "fmt" // this line is used by starport scaffolding # 1 @@ -78,6 +79,7 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { // this line is used by starport scaffolding # 2 + types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } // GetTxCmd returns the capability module's root tx command. diff --git a/x/cointrunk/client/cli/gov.go b/x/cointrunk/client/cli/gov.go index a55ffed3..d1a77a4e 100644 --- a/x/cointrunk/client/cli/gov.go +++ b/x/cointrunk/client/cli/gov.go @@ -16,7 +16,7 @@ const ( func NewCmdSubmitAcceptedDomainProposal() *cobra.Command { cmd := &cobra.Command{ - Use: "accepted-domain [domain-name]", + Use: "add-accepted-domain [domain-name]", Args: cobra.ExactArgs(1), Short: "Submit an accepted domain proposal", Long: "Submit an accepted domain proposal along with an initial deposit.\n" + @@ -79,7 +79,7 @@ func NewCmdSubmitAcceptedDomainProposal() *cobra.Command { func NewCmdSubmitPublisherProposal() *cobra.Command { cmd := &cobra.Command{ - Use: "publisher [name] [address]", + Use: "add-publisher [name] [address]", Args: cobra.ExactArgs(2), Short: "Submit a publisher proposal", Long: "Submit a publishers proposal along with an initial deposit.\n" + From 06249fe70e3e1cf0e0173dad117aafaa05cacd01 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Fri, 9 Dec 2022 01:47:40 +0200 Subject: [PATCH 32/54] record article and publisher creation timestamp and article counter on publisher --- docs/static/openapi.yml | 39 +++++++ proto/cointrunk/article.proto | 1 + proto/cointrunk/publisher.proto | 4 +- .../bze/bze.cointrunk/module/rest.ts | 9 ++ .../module/types/cointrunk/article.ts | 19 ++++ .../module/types/cointrunk/publisher.ts | 70 +++++++++++- .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +++--- .../bze/bze.scavenge/module/index.ts | 6 +- x/cointrunk/keeper/gov.go | 8 +- x/cointrunk/keeper/msg_server_add_article.go | 6 + x/cointrunk/types/article.pb.go | 68 +++++++++--- x/cointrunk/types/publisher.pb.go | 105 +++++++++++++++--- 12 files changed, 311 insertions(+), 56 deletions(-) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 9e769025..93c8964b 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -437,6 +437,9 @@ paths: type: string paid: type: boolean + createdAt: + type: string + format: int64 pagination: type: object properties: @@ -602,6 +605,12 @@ paths: type: string active: type: boolean + articlesCount: + type: integer + format: int64 + createdAt: + type: string + format: int64 default: description: An unexpected error response. schema: @@ -648,6 +657,12 @@ paths: type: string active: type: boolean + articlesCount: + type: integer + format: int64 + createdAt: + type: string + format: int64 pagination: type: object properties: @@ -31236,6 +31251,9 @@ definitions: type: string paid: type: boolean + createdAt: + type: string + format: int64 bze.cointrunk.MsgAddArticleResponse: type: object bze.cointrunk.Params: @@ -31256,6 +31274,12 @@ definitions: type: string active: type: boolean + articlesCount: + type: integer + format: int64 + createdAt: + type: string + format: int64 bze.cointrunk.QueryAcceptedDomainResponse: type: object properties: @@ -31352,6 +31376,9 @@ definitions: type: string paid: type: boolean + createdAt: + type: string + format: int64 pagination: type: object properties: @@ -31402,6 +31429,12 @@ definitions: type: string active: type: boolean + articlesCount: + type: integer + format: int64 + createdAt: + type: string + format: int64 bze.cointrunk.QueryPublisherResponse: type: object properties: @@ -31416,6 +31449,12 @@ definitions: type: string active: type: boolean + articlesCount: + type: integer + format: int64 + createdAt: + type: string + format: int64 pagination: type: object properties: diff --git a/proto/cointrunk/article.proto b/proto/cointrunk/article.proto index 01f58310..cdd7e1ac 100644 --- a/proto/cointrunk/article.proto +++ b/proto/cointrunk/article.proto @@ -11,4 +11,5 @@ message Article { string picture = 4; string publisher = 5; bool paid = 6; + int64 createdAt = 7; } \ No newline at end of file diff --git a/proto/cointrunk/publisher.proto b/proto/cointrunk/publisher.proto index 57279dbc..35a09127 100644 --- a/proto/cointrunk/publisher.proto +++ b/proto/cointrunk/publisher.proto @@ -7,5 +7,7 @@ message Publisher { string name = 1; string address = 2; - bool active = 3; + bool active = 3; + uint32 articlesCount = 4; + int64 createdAt = 5; } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts index 9a3729f0..87f7f430 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts @@ -29,6 +29,9 @@ export interface CointrunkArticle { picture?: string; publisher?: string; paid?: boolean; + + /** @format int64 */ + createdAt?: string; } export type CointrunkMsgAddArticleResponse = object; @@ -46,6 +49,12 @@ export interface CointrunkPublisher { name?: string; address?: string; active?: boolean; + + /** @format int64 */ + articlesCount?: number; + + /** @format int64 */ + createdAt?: string; } export interface CointrunkQueryAcceptedDomainResponse { diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/article.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/article.ts index ccc272a3..44a59be5 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/article.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/article.ts @@ -11,6 +11,7 @@ export interface Article { picture: string; publisher: string; paid: boolean; + createdAt: number; } const baseArticle: object = { @@ -20,6 +21,7 @@ const baseArticle: object = { picture: "", publisher: "", paid: false, + createdAt: 0, }; export const Article = { @@ -42,6 +44,9 @@ export const Article = { if (message.paid === true) { writer.uint32(48).bool(message.paid); } + if (message.createdAt !== 0) { + writer.uint32(56).int64(message.createdAt); + } return writer; }, @@ -70,6 +75,9 @@ export const Article = { case 6: message.paid = reader.bool(); break; + case 7: + message.createdAt = longToNumber(reader.int64() as Long); + break; default: reader.skipType(tag & 7); break; @@ -110,6 +118,11 @@ export const Article = { } else { message.paid = false; } + if (object.createdAt !== undefined && object.createdAt !== null) { + message.createdAt = Number(object.createdAt); + } else { + message.createdAt = 0; + } return message; }, @@ -121,6 +134,7 @@ export const Article = { message.picture !== undefined && (obj.picture = message.picture); message.publisher !== undefined && (obj.publisher = message.publisher); message.paid !== undefined && (obj.paid = message.paid); + message.createdAt !== undefined && (obj.createdAt = message.createdAt); return obj; }, @@ -156,6 +170,11 @@ export const Article = { } else { message.paid = false; } + if (object.createdAt !== undefined && object.createdAt !== null) { + message.createdAt = object.createdAt; + } else { + message.createdAt = 0; + } return message; }, }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher.ts index a332649d..bbbbdec5 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher.ts @@ -1,5 +1,6 @@ /* eslint-disable */ -import { Writer, Reader } from "protobufjs/minimal"; +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; export const protobufPackage = "bze.cointrunk"; @@ -7,9 +8,17 @@ export interface Publisher { name: string; address: string; active: boolean; + articlesCount: number; + createdAt: number; } -const basePublisher: object = { name: "", address: "", active: false }; +const basePublisher: object = { + name: "", + address: "", + active: false, + articlesCount: 0, + createdAt: 0, +}; export const Publisher = { encode(message: Publisher, writer: Writer = Writer.create()): Writer { @@ -22,6 +31,12 @@ export const Publisher = { if (message.active === true) { writer.uint32(24).bool(message.active); } + if (message.articlesCount !== 0) { + writer.uint32(32).uint32(message.articlesCount); + } + if (message.createdAt !== 0) { + writer.uint32(40).int64(message.createdAt); + } return writer; }, @@ -41,6 +56,12 @@ export const Publisher = { case 3: message.active = reader.bool(); break; + case 4: + message.articlesCount = reader.uint32(); + break; + case 5: + message.createdAt = longToNumber(reader.int64() as Long); + break; default: reader.skipType(tag & 7); break; @@ -66,6 +87,16 @@ export const Publisher = { } else { message.active = false; } + if (object.articlesCount !== undefined && object.articlesCount !== null) { + message.articlesCount = Number(object.articlesCount); + } else { + message.articlesCount = 0; + } + if (object.createdAt !== undefined && object.createdAt !== null) { + message.createdAt = Number(object.createdAt); + } else { + message.createdAt = 0; + } return message; }, @@ -74,6 +105,9 @@ export const Publisher = { message.name !== undefined && (obj.name = message.name); message.address !== undefined && (obj.address = message.address); message.active !== undefined && (obj.active = message.active); + message.articlesCount !== undefined && + (obj.articlesCount = message.articlesCount); + message.createdAt !== undefined && (obj.createdAt = message.createdAt); return obj; }, @@ -94,10 +128,30 @@ export const Publisher = { } else { message.active = false; } + if (object.articlesCount !== undefined && object.articlesCount !== null) { + message.articlesCount = object.articlesCount; + } else { + message.articlesCount = 0; + } + if (object.createdAt !== undefined && object.createdAt !== null) { + message.createdAt = object.createdAt; + } else { + message.createdAt = 0; + } return message; }, }; +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + type Builtin = Date | Function | Uint8Array | string | number | undefined; export type DeepPartial = T extends Builtin ? T @@ -108,3 +162,15 @@ export type DeepPartial = T extends Builtin : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 474b327f..155d50b2 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -247,33 +247,33 @@ export default { } } }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgSubmitScavenge(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, @@ -291,29 +291,29 @@ export default { } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgSubmitScavenge(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 5f72a96b..9a3de64c 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -5,14 +5,14 @@ import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; import { MsgRevealSolution } from "./types/scavenge/tx"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; const types = [ ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ]; export const MissingWalletError = new Error("wallet is required"); @@ -46,8 +46,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/keeper/gov.go b/x/cointrunk/keeper/gov.go index 46157e34..d4e75cd6 100644 --- a/x/cointrunk/keeper/gov.go +++ b/x/cointrunk/keeper/gov.go @@ -7,10 +7,14 @@ import ( func (k Keeper) HandlePublisherProposal(ctx sdk.Context, proposal *types.PublisherProposal) error { _ = sdk.MustAccAddressFromBech32(proposal.Address) - publisher, _ := k.GetPublisher(ctx, proposal.Address) + publisher, found := k.GetPublisher(ctx, proposal.Address) publisher.Name = proposal.Name publisher.Active = proposal.Active - publisher.Address = proposal.Address + if !found { + publisher.Address = proposal.Address + publisher.CreatedAt = ctx.BlockHeader().Time.Unix() + publisher.ArticlesCount = 0 + } k.SetPublisher(ctx, publisher) return nil } diff --git a/x/cointrunk/keeper/msg_server_add_article.go b/x/cointrunk/keeper/msg_server_add_article.go index de5207bc..42da388e 100644 --- a/x/cointrunk/keeper/msg_server_add_article.go +++ b/x/cointrunk/keeper/msg_server_add_article.go @@ -47,10 +47,16 @@ func (k msgServer) AddArticle(goCtx context.Context, msg *types.MsgAddArticle) ( Publisher: msg.Publisher, Paid: paid, Id: 0, + CreatedAt: ctx.BlockHeader().Time.Unix(), } k.SetArticle(ctx, article) + if found { + publisher.ArticlesCount += 1 + k.SetPublisher(ctx, publisher) + } + _ = ctx return &types.MsgAddArticleResponse{}, nil diff --git a/x/cointrunk/types/article.pb.go b/x/cointrunk/types/article.pb.go index 6534616b..81727729 100644 --- a/x/cointrunk/types/article.pb.go +++ b/x/cointrunk/types/article.pb.go @@ -29,6 +29,7 @@ type Article struct { Picture string `protobuf:"bytes,4,opt,name=picture,proto3" json:"picture,omitempty"` Publisher string `protobuf:"bytes,5,opt,name=publisher,proto3" json:"publisher,omitempty"` Paid bool `protobuf:"varint,6,opt,name=paid,proto3" json:"paid,omitempty"` + CreatedAt int64 `protobuf:"varint,7,opt,name=createdAt,proto3" json:"createdAt,omitempty"` } func (m *Article) Reset() { *m = Article{} } @@ -106,6 +107,13 @@ func (m *Article) GetPaid() bool { return false } +func (m *Article) GetCreatedAt() int64 { + if m != nil { + return m.CreatedAt + } + return 0 +} + func init() { proto.RegisterType((*Article)(nil), "bze.cointrunk.Article") } @@ -113,22 +121,23 @@ func init() { func init() { proto.RegisterFile("cointrunk/article.proto", fileDescriptor_b0f4352c8e9bdd9e) } var fileDescriptor_b0f4352c8e9bdd9e = []byte{ - // 231 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x8f, 0xb1, 0x4e, 0xc3, 0x30, - 0x14, 0x45, 0xe3, 0x34, 0x6d, 0xa9, 0x25, 0x10, 0xb2, 0x90, 0xf0, 0x80, 0xac, 0x88, 0x29, 0x0b, - 0xc9, 0xc0, 0x17, 0xc0, 0xc4, 0x9c, 0x91, 0xcd, 0x4e, 0x9e, 0xc8, 0x13, 0xa6, 0xb6, 0xdc, 0x67, - 0x09, 0xfa, 0x0f, 0x48, 0x7c, 0x16, 0x63, 0x47, 0x46, 0x94, 0xfc, 0x08, 0xc2, 0x15, 0x64, 0xbb, - 0xe7, 0xdc, 0xbb, 0x5c, 0x7e, 0xd9, 0x39, 0xdc, 0x52, 0x88, 0xdb, 0xe7, 0x46, 0x07, 0xc2, 0xce, - 0x42, 0xed, 0x83, 0x23, 0x27, 0x4e, 0xcd, 0x1e, 0xea, 0xff, 0xf2, 0xfa, 0x9d, 0xf1, 0xf5, 0xdd, - 0x71, 0x20, 0xce, 0x78, 0x8e, 0xbd, 0x64, 0x25, 0xab, 0x8a, 0x36, 0xc7, 0x5e, 0x5c, 0xf0, 0x25, - 0x21, 0x59, 0x90, 0x79, 0xc9, 0xaa, 0x4d, 0x7b, 0x04, 0x71, 0xce, 0x17, 0x31, 0x58, 0xb9, 0x48, - 0xee, 0x37, 0x0a, 0xc9, 0xd7, 0x1e, 0x3b, 0x8a, 0x01, 0x64, 0x91, 0xec, 0x1f, 0x8a, 0x2b, 0xbe, - 0xf1, 0xd1, 0x58, 0xdc, 0x0d, 0x10, 0xe4, 0x32, 0x75, 0xb3, 0x10, 0x82, 0x17, 0x5e, 0x63, 0x2f, - 0x57, 0x25, 0xab, 0x4e, 0xda, 0x94, 0xef, 0x1f, 0x3e, 0x47, 0xc5, 0x0e, 0xa3, 0x62, 0xdf, 0xa3, - 0x62, 0x1f, 0x93, 0xca, 0x0e, 0x93, 0xca, 0xbe, 0x26, 0x95, 0x3d, 0xd6, 0x4f, 0x48, 0x43, 0x34, - 0x75, 0xe7, 0x5e, 0x1a, 0xb3, 0x87, 0x1b, 0x6d, 0xfd, 0xa0, 0x09, 0x74, 0xa2, 0xe6, 0xb5, 0x99, - 0x0f, 0xd3, 0x9b, 0x87, 0x9d, 0x59, 0xa5, 0xbf, 0xb7, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x54, - 0xd1, 0xe1, 0x23, 0x0a, 0x01, 0x00, 0x00, + // 246 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x90, 0x31, 0x4e, 0xc3, 0x30, + 0x14, 0x86, 0xe3, 0x24, 0x6d, 0xa8, 0x25, 0x10, 0xb2, 0x90, 0xf0, 0x80, 0xac, 0x88, 0x29, 0x0b, + 0xc9, 0xc0, 0x09, 0xca, 0xc4, 0x9c, 0x91, 0xcd, 0x76, 0x9e, 0x88, 0x85, 0x69, 0x2c, 0xf7, 0x59, + 0x82, 0x9e, 0x82, 0x7b, 0x70, 0x11, 0xc6, 0x8e, 0x8c, 0x28, 0xb9, 0x08, 0xaa, 0x23, 0xc8, 0xf6, + 0x7f, 0xdf, 0xff, 0xde, 0xf2, 0xd3, 0x6b, 0x3d, 0x98, 0x1d, 0xfa, 0xb0, 0x7b, 0x69, 0xa4, 0x47, + 0xa3, 0x2d, 0xd4, 0xce, 0x0f, 0x38, 0xb0, 0x73, 0x75, 0x80, 0xfa, 0xbf, 0xbc, 0xfd, 0x24, 0xb4, + 0xd8, 0xce, 0x07, 0xec, 0x82, 0xa6, 0xa6, 0xe3, 0xa4, 0x24, 0x55, 0xde, 0xa6, 0xa6, 0x63, 0x57, + 0x74, 0x85, 0x06, 0x2d, 0xf0, 0xb4, 0x24, 0xd5, 0xa6, 0x9d, 0x81, 0x5d, 0xd2, 0x2c, 0x78, 0xcb, + 0xb3, 0xe8, 0x4e, 0x91, 0x71, 0x5a, 0x38, 0xa3, 0x31, 0x78, 0xe0, 0x79, 0xb4, 0x7f, 0xc8, 0x6e, + 0xe8, 0xc6, 0x05, 0x65, 0xcd, 0xbe, 0x07, 0xcf, 0x57, 0xb1, 0x5b, 0x04, 0x63, 0x34, 0x77, 0xd2, + 0x74, 0x7c, 0x5d, 0x92, 0xea, 0xac, 0x8d, 0xf9, 0xf4, 0xa1, 0x3d, 0x48, 0x84, 0x6e, 0x8b, 0xbc, + 0x28, 0x49, 0x95, 0xb5, 0x8b, 0x78, 0x78, 0xfc, 0x1a, 0x05, 0x39, 0x8e, 0x82, 0xfc, 0x8c, 0x82, + 0x7c, 0x4c, 0x22, 0x39, 0x4e, 0x22, 0xf9, 0x9e, 0x44, 0xf2, 0x54, 0x3f, 0x1b, 0xec, 0x83, 0xaa, + 0xf5, 0xf0, 0xda, 0xa8, 0x03, 0xdc, 0x49, 0xeb, 0x7a, 0x89, 0x20, 0x23, 0x35, 0x6f, 0xcd, 0x32, + 0x07, 0xbe, 0x3b, 0xd8, 0xab, 0x75, 0x5c, 0xe3, 0xfe, 0x37, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x4c, + 0x12, 0xbc, 0x28, 0x01, 0x00, 0x00, } func (m *Article) Marshal() (dAtA []byte, err error) { @@ -151,6 +160,11 @@ func (m *Article) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.CreatedAt != 0 { + i = encodeVarintArticle(dAtA, i, uint64(m.CreatedAt)) + i-- + dAtA[i] = 0x38 + } if m.Paid { i-- if m.Paid { @@ -236,6 +250,9 @@ func (m *Article) Size() (n int) { if m.Paid { n += 2 } + if m.CreatedAt != 0 { + n += 1 + sovArticle(uint64(m.CreatedAt)) + } return n } @@ -441,6 +458,25 @@ func (m *Article) Unmarshal(dAtA []byte) error { } } m.Paid = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + m.CreatedAt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowArticle + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreatedAt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipArticle(dAtA[iNdEx:]) diff --git a/x/cointrunk/types/publisher.pb.go b/x/cointrunk/types/publisher.pb.go index a4de6be1..df664e75 100644 --- a/x/cointrunk/types/publisher.pb.go +++ b/x/cointrunk/types/publisher.pb.go @@ -23,9 +23,11 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Publisher struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - Active bool `protobuf:"varint,3,opt,name=active,proto3" json:"active,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + Active bool `protobuf:"varint,3,opt,name=active,proto3" json:"active,omitempty"` + ArticlesCount uint32 `protobuf:"varint,4,opt,name=articlesCount,proto3" json:"articlesCount,omitempty"` + CreatedAt int64 `protobuf:"varint,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` } func (m *Publisher) Reset() { *m = Publisher{} } @@ -82,6 +84,20 @@ func (m *Publisher) GetActive() bool { return false } +func (m *Publisher) GetArticlesCount() uint32 { + if m != nil { + return m.ArticlesCount + } + return 0 +} + +func (m *Publisher) GetCreatedAt() int64 { + if m != nil { + return m.CreatedAt + } + return 0 +} + func init() { proto.RegisterType((*Publisher)(nil), "bze.cointrunk.Publisher") } @@ -89,19 +105,22 @@ func init() { func init() { proto.RegisterFile("cointrunk/publisher.proto", fileDescriptor_13a2ab3c46c6721e) } var fileDescriptor_13a2ab3c46c6721e = []byte{ - // 188 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xce, 0xcf, 0xcc, - 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x2f, 0x28, 0x4d, 0xca, 0xc9, 0x2c, 0xce, 0x48, 0x2d, 0xd2, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x4b, 0x2b, 0x05, 0x72, - 0x71, 0x06, 0xc0, 0x54, 0x08, 0x09, 0x71, 0xb1, 0xe4, 0x25, 0xe6, 0xa6, 0x4a, 0x30, 0x2a, 0x30, - 0x6a, 0x70, 0x06, 0x81, 0xd9, 0x42, 0x12, 0x5c, 0xec, 0x89, 0x29, 0x29, 0x45, 0xa9, 0xc5, 0xc5, - 0x12, 0x4c, 0x60, 0x61, 0x18, 0x57, 0x48, 0x8c, 0x8b, 0x2d, 0x31, 0xb9, 0x24, 0xb3, 0x2c, 0x55, - 0x82, 0x59, 0x81, 0x51, 0x83, 0x23, 0x08, 0xca, 0x73, 0xf2, 0x38, 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, 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, - 0xfd, 0xa4, 0xaa, 0x54, 0xdd, 0xc4, 0x9c, 0x82, 0x8c, 0xc4, 0x92, 0xd4, 0x44, 0x30, 0x4f, 0xbf, - 0x42, 0x1f, 0xe1, 0xea, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x93, 0x8d, 0x01, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xc4, 0x47, 0xc8, 0x62, 0xcf, 0x00, 0x00, 0x00, + // 235 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x8f, 0xb1, 0x4e, 0xc3, 0x30, + 0x10, 0x86, 0x73, 0xb4, 0x14, 0x62, 0x29, 0x8b, 0x07, 0x64, 0x24, 0x64, 0x45, 0x88, 0x21, 0x0b, + 0xc9, 0xc0, 0x13, 0x00, 0x0b, 0x23, 0xca, 0xc8, 0x66, 0x3b, 0x27, 0x62, 0x91, 0xc6, 0x91, 0x7d, + 0x41, 0xd0, 0xa7, 0x60, 0xe1, 0x9d, 0x18, 0x3b, 0x32, 0xa2, 0xe4, 0x45, 0x90, 0x2c, 0x4a, 0xd5, + 0xed, 0xbe, 0xef, 0xfe, 0xe5, 0x63, 0xe7, 0xc6, 0xd9, 0x9e, 0xfc, 0xd8, 0xbf, 0x54, 0xc3, 0xa8, + 0x3b, 0x1b, 0x5a, 0xf4, 0xe5, 0xe0, 0x1d, 0x39, 0x9e, 0xe9, 0x0d, 0x96, 0xff, 0xef, 0xcb, 0x4f, + 0x60, 0xe9, 0xe3, 0x6e, 0xc2, 0x39, 0x5b, 0xf6, 0x6a, 0x8d, 0x02, 0x72, 0x28, 0xd2, 0x3a, 0xde, + 0x5c, 0xb0, 0x13, 0xd5, 0x34, 0x1e, 0x43, 0x10, 0x47, 0x51, 0xef, 0x90, 0x9f, 0xb1, 0x95, 0x32, + 0x64, 0x5f, 0x51, 0x2c, 0x72, 0x28, 0x4e, 0xeb, 0x3f, 0xe2, 0x57, 0x2c, 0x53, 0x9e, 0xac, 0xe9, + 0x30, 0xdc, 0xbb, 0xb1, 0x27, 0xb1, 0xcc, 0xa1, 0xc8, 0xea, 0x43, 0xc9, 0x2f, 0x58, 0x6a, 0x3c, + 0x2a, 0xc2, 0xe6, 0x96, 0xc4, 0x71, 0x0e, 0xc5, 0xa2, 0xde, 0x8b, 0xbb, 0x87, 0xaf, 0x49, 0xc2, + 0x76, 0x92, 0xf0, 0x33, 0x49, 0xf8, 0x98, 0x65, 0xb2, 0x9d, 0x65, 0xf2, 0x3d, 0xcb, 0xe4, 0xa9, + 0x7c, 0xb6, 0xd4, 0x8e, 0xba, 0x34, 0x6e, 0x5d, 0xe9, 0x0d, 0x5e, 0xab, 0x6e, 0x68, 0x15, 0xa1, + 0x8a, 0x54, 0xbd, 0x55, 0xfb, 0x74, 0x7a, 0x1f, 0x30, 0xe8, 0x55, 0xec, 0xbe, 0xf9, 0x0d, 0x00, + 0x00, 0xff, 0xff, 0x9b, 0x8c, 0x3f, 0xf6, 0x14, 0x01, 0x00, 0x00, } func (m *Publisher) Marshal() (dAtA []byte, err error) { @@ -124,6 +143,16 @@ func (m *Publisher) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.CreatedAt != 0 { + i = encodeVarintPublisher(dAtA, i, uint64(m.CreatedAt)) + i-- + dAtA[i] = 0x28 + } + if m.ArticlesCount != 0 { + i = encodeVarintPublisher(dAtA, i, uint64(m.ArticlesCount)) + i-- + dAtA[i] = 0x20 + } if m.Active { i-- if m.Active { @@ -179,6 +208,12 @@ func (m *Publisher) Size() (n int) { if m.Active { n += 2 } + if m.ArticlesCount != 0 { + n += 1 + sovPublisher(uint64(m.ArticlesCount)) + } + if m.CreatedAt != 0 { + n += 1 + sovPublisher(uint64(m.CreatedAt)) + } return n } @@ -301,6 +336,44 @@ func (m *Publisher) Unmarshal(dAtA []byte) error { } } m.Active = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ArticlesCount", wireType) + } + m.ArticlesCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPublisher + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ArticlesCount |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + m.CreatedAt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPublisher + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreatedAt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipPublisher(dAtA[iNdEx:]) From e720dc4632fca8ae253b96b1277acca7c669d45f Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Fri, 9 Dec 2022 01:53:42 +0200 Subject: [PATCH 33/54] clean unused proto and module imported functions --- x/burner/types/expected_keepers.go | 2 - x/cointrunk/types/burn_coins_proposal.pb.go | 369 -------------------- x/cointrunk/types/burned_coins.pb.go | 366 ------------------- x/cointrunk/types/expected_keepers.go | 5 - 4 files changed, 742 deletions(-) delete mode 100644 x/cointrunk/types/burn_coins_proposal.pb.go delete mode 100644 x/cointrunk/types/burned_coins.pb.go diff --git a/x/burner/types/expected_keepers.go b/x/burner/types/expected_keepers.go index 292be200..b26864aa 100644 --- a/x/burner/types/expected_keepers.go +++ b/x/burner/types/expected_keepers.go @@ -7,7 +7,6 @@ import ( // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI // Methods imported from account should be defined here } @@ -16,6 +15,5 @@ type AccountKeeper interface { type BankKeeper interface { GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins BurnCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error // Methods imported from bank should be defined here } diff --git a/x/cointrunk/types/burn_coins_proposal.pb.go b/x/cointrunk/types/burn_coins_proposal.pb.go deleted file mode 100644 index 676b7030..00000000 --- a/x/cointrunk/types/burn_coins_proposal.pb.go +++ /dev/null @@ -1,369 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cointrunk/burn_coins_proposal.proto - -package types - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/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 BurnCoinsProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` -} - -func (m *BurnCoinsProposal) Reset() { *m = BurnCoinsProposal{} } -func (m *BurnCoinsProposal) String() string { return proto.CompactTextString(m) } -func (*BurnCoinsProposal) ProtoMessage() {} -func (*BurnCoinsProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_c4370fe012c32bb1, []int{0} -} -func (m *BurnCoinsProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BurnCoinsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BurnCoinsProposal.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 *BurnCoinsProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_BurnCoinsProposal.Merge(m, src) -} -func (m *BurnCoinsProposal) XXX_Size() int { - return m.Size() -} -func (m *BurnCoinsProposal) XXX_DiscardUnknown() { - xxx_messageInfo_BurnCoinsProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_BurnCoinsProposal proto.InternalMessageInfo - -func (m *BurnCoinsProposal) GetTitle() string { - if m != nil { - return m.Title - } - return "" -} - -func (m *BurnCoinsProposal) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func init() { - proto.RegisterType((*BurnCoinsProposal)(nil), "bze.cointrunk.BurnCoinsProposal") -} - -func init() { - proto.RegisterFile("cointrunk/burn_coins_proposal.proto", fileDescriptor_c4370fe012c32bb1) -} - -var fileDescriptor_c4370fe012c32bb1 = []byte{ - // 189 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0xcf, 0xcc, - 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x2a, 0x2d, 0xca, 0x8b, 0x07, 0x71, 0x8b, 0xe3, 0x0b, - 0x8a, 0xf2, 0x0b, 0xf2, 0x8b, 0x13, 0x73, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x78, 0x93, - 0xaa, 0x52, 0xf5, 0xe0, 0x0a, 0x95, 0xbc, 0xb9, 0x04, 0x9d, 0x4a, 0x8b, 0xf2, 0x9c, 0x41, 0x4a, - 0x03, 0xa0, 0x2a, 0x85, 0x44, 0xb8, 0x58, 0x4b, 0x32, 0x4b, 0x72, 0x52, 0x25, 0x18, 0x15, 0x18, - 0x35, 0x38, 0x83, 0x20, 0x1c, 0x21, 0x05, 0x2e, 0xee, 0x94, 0xd4, 0xe2, 0xe4, 0xa2, 0xcc, 0x82, - 0x92, 0xcc, 0xfc, 0x3c, 0x09, 0x26, 0xb0, 0x1c, 0xb2, 0x90, 0x93, 0xc7, 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, 0xe9, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, - 0xe7, 0xea, 0x27, 0x55, 0xa5, 0xea, 0x26, 0xe6, 0x14, 0x64, 0x24, 0x96, 0xa4, 0x26, 0x82, 0x79, - 0xfa, 0x15, 0xfa, 0x08, 0x97, 0x97, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x6b, 0x0c, - 0x08, 0x00, 0x00, 0xff, 0xff, 0x36, 0x54, 0x9e, 0xd5, 0xd3, 0x00, 0x00, 0x00, -} - -func (m *BurnCoinsProposal) 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 *BurnCoinsProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BurnCoinsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintBurnCoinsProposal(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintBurnCoinsProposal(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintBurnCoinsProposal(dAtA []byte, offset int, v uint64) int { - offset -= sovBurnCoinsProposal(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *BurnCoinsProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovBurnCoinsProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovBurnCoinsProposal(uint64(l)) - } - return n -} - -func sovBurnCoinsProposal(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozBurnCoinsProposal(x uint64) (n int) { - return sovBurnCoinsProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *BurnCoinsProposal) 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 ErrIntOverflowBurnCoinsProposal - } - 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: BurnCoinsProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BurnCoinsProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBurnCoinsProposal - } - 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 ErrInvalidLengthBurnCoinsProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBurnCoinsProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBurnCoinsProposal - } - 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 ErrInvalidLengthBurnCoinsProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBurnCoinsProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBurnCoinsProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBurnCoinsProposal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipBurnCoinsProposal(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, ErrIntOverflowBurnCoinsProposal - } - 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, ErrIntOverflowBurnCoinsProposal - } - 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, ErrIntOverflowBurnCoinsProposal - } - 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, ErrInvalidLengthBurnCoinsProposal - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupBurnCoinsProposal - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthBurnCoinsProposal - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthBurnCoinsProposal = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowBurnCoinsProposal = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupBurnCoinsProposal = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/cointrunk/types/burned_coins.pb.go b/x/cointrunk/types/burned_coins.pb.go deleted file mode 100644 index bc57f433..00000000 --- a/x/cointrunk/types/burned_coins.pb.go +++ /dev/null @@ -1,366 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cointrunk/burned_coins.proto - -package types - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/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 BurnedCoins struct { - Burned string `protobuf:"bytes,1,opt,name=burned,proto3" json:"burned,omitempty"` - Height string `protobuf:"bytes,2,opt,name=height,proto3" json:"height,omitempty"` -} - -func (m *BurnedCoins) Reset() { *m = BurnedCoins{} } -func (m *BurnedCoins) String() string { return proto.CompactTextString(m) } -func (*BurnedCoins) ProtoMessage() {} -func (*BurnedCoins) Descriptor() ([]byte, []int) { - return fileDescriptor_787ee9a9009896ca, []int{0} -} -func (m *BurnedCoins) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BurnedCoins) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BurnedCoins.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 *BurnedCoins) XXX_Merge(src proto.Message) { - xxx_messageInfo_BurnedCoins.Merge(m, src) -} -func (m *BurnedCoins) XXX_Size() int { - return m.Size() -} -func (m *BurnedCoins) XXX_DiscardUnknown() { - xxx_messageInfo_BurnedCoins.DiscardUnknown(m) -} - -var xxx_messageInfo_BurnedCoins proto.InternalMessageInfo - -func (m *BurnedCoins) GetBurned() string { - if m != nil { - return m.Burned - } - return "" -} - -func (m *BurnedCoins) GetHeight() string { - if m != nil { - return m.Height - } - return "" -} - -func init() { - proto.RegisterType((*BurnedCoins)(nil), "bze.cointrunk.BurnedCoins") -} - -func init() { proto.RegisterFile("cointrunk/burned_coins.proto", fileDescriptor_787ee9a9009896ca) } - -var fileDescriptor_787ee9a9009896ca = []byte{ - // 168 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0xcf, 0xcc, - 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x2a, 0x2d, 0xca, 0x4b, 0x4d, 0x89, 0x07, 0x09, 0x14, - 0xeb, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xf1, 0x26, 0x55, 0xa5, 0xea, 0xc1, 0x55, 0x28, 0xd9, - 0x72, 0x71, 0x3b, 0x81, 0x15, 0x39, 0x83, 0xd4, 0x08, 0x89, 0x71, 0xb1, 0x41, 0xf4, 0x48, 0x30, - 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x41, 0x79, 0x20, 0xf1, 0x8c, 0xd4, 0xcc, 0xf4, 0x8c, 0x12, 0x09, - 0x26, 0x88, 0x38, 0x84, 0xe7, 0xe4, 0x71, 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, 0x7a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x49, 0x55, 0xa9, - 0xba, 0x89, 0x39, 0x05, 0x19, 0x89, 0x25, 0xa9, 0x89, 0x60, 0x9e, 0x7e, 0x85, 0x3e, 0xc2, 0x91, - 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xe7, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, - 0x32, 0x31, 0xf9, 0x8d, 0xbe, 0x00, 0x00, 0x00, -} - -func (m *BurnedCoins) 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 *BurnedCoins) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BurnedCoins) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Height) > 0 { - i -= len(m.Height) - copy(dAtA[i:], m.Height) - i = encodeVarintBurnedCoins(dAtA, i, uint64(len(m.Height))) - i-- - dAtA[i] = 0x12 - } - if len(m.Burned) > 0 { - i -= len(m.Burned) - copy(dAtA[i:], m.Burned) - i = encodeVarintBurnedCoins(dAtA, i, uint64(len(m.Burned))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintBurnedCoins(dAtA []byte, offset int, v uint64) int { - offset -= sovBurnedCoins(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *BurnedCoins) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Burned) - if l > 0 { - n += 1 + l + sovBurnedCoins(uint64(l)) - } - l = len(m.Height) - if l > 0 { - n += 1 + l + sovBurnedCoins(uint64(l)) - } - return n -} - -func sovBurnedCoins(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozBurnedCoins(x uint64) (n int) { - return sovBurnedCoins(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *BurnedCoins) 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 ErrIntOverflowBurnedCoins - } - 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: BurnedCoins: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BurnedCoins: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Burned", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBurnedCoins - } - 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 ErrInvalidLengthBurnedCoins - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBurnedCoins - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Burned = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBurnedCoins - } - 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 ErrInvalidLengthBurnedCoins - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBurnedCoins - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Height = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBurnedCoins(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBurnedCoins - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipBurnedCoins(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, ErrIntOverflowBurnedCoins - } - 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, ErrIntOverflowBurnedCoins - } - 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, ErrIntOverflowBurnedCoins - } - 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, ErrInvalidLengthBurnedCoins - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupBurnedCoins - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthBurnedCoins - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthBurnedCoins = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowBurnedCoins = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupBurnedCoins = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/cointrunk/types/expected_keepers.go b/x/cointrunk/types/expected_keepers.go index 2b006f63..360b6139 100644 --- a/x/cointrunk/types/expected_keepers.go +++ b/x/cointrunk/types/expected_keepers.go @@ -2,7 +2,6 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) type GovKeeper interface { @@ -11,15 +10,11 @@ type GovKeeper interface { // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI - GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - BurnCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error // Methods imported from bank should be defined here } From 9c41334f89b13a98af131d0b48513d07cfe65552 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Mon, 12 Dec 2022 00:49:06 +0200 Subject: [PATCH 34/54] added fund burner message --- docs/static/openapi.yml | 2 + proto/burner/tx.proto | 11 +- .../bze-alphateam/bze/bze.burner.v1/index.ts | 28 + .../bze/bze.burner.v1/module/index.ts | 3 + .../bze/bze.burner.v1/module/rest.ts | 2 + .../bze.burner.v1/module/types/burner/tx.ts | 142 ++++- x/burner/client/cli/tx.go | 1 + x/burner/client/cli/tx_fund_burner.go | 42 ++ x/burner/genesis.go | 2 +- x/burner/handler.go | 7 +- x/burner/keeper/msg_server_fund_burner.go | 30 + x/burner/module_simulation.go | 17 +- x/burner/simulation/fund_burner.go | 29 + x/burner/types/codec.go | 6 +- x/burner/types/expected_keepers.go | 1 + x/burner/types/message_fund_burner.go | 46 ++ x/burner/types/message_fund_burner_test.go | 40 ++ x/burner/types/tx.pb.go | 513 +++++++++++++++++- 18 files changed, 905 insertions(+), 17 deletions(-) create mode 100644 x/burner/client/cli/tx_fund_burner.go create mode 100644 x/burner/keeper/msg_server_fund_burner.go create mode 100644 x/burner/simulation/fund_burner.go create mode 100644 x/burner/types/message_fund_burner.go create mode 100644 x/burner/types/message_fund_burner_test.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 93c8964b..c0de73d6 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -30774,6 +30774,8 @@ definitions: type: string height: type: string + bze.burner.v1.MsgFundBurnerResponse: + type: object bze.burner.v1.Params: type: object description: Params defines the parameters for the module. diff --git a/proto/burner/tx.proto b/proto/burner/tx.proto index b3f60415..5d34a20c 100644 --- a/proto/burner/tx.proto +++ b/proto/burner/tx.proto @@ -7,7 +7,16 @@ option go_package = "github.com/bze-alphateam/bze/x/burner/types"; // Msg defines the Msg service. service Msg { - // this line is used by starport scaffolding # proto/tx/rpc + rpc FundBurner(MsgFundBurner) returns (MsgFundBurnerResponse); +// this line is used by starport scaffolding # proto/tx/rpc +} + +message MsgFundBurner { + string creator = 1; + string amount = 2; +} + +message MsgFundBurnerResponse { } // this line is used by starport scaffolding # proto/tx/message \ No newline at end of file diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts index e3cb0c00..a8dd1479 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts @@ -172,7 +172,35 @@ export default { }, + async sendMsgFundBurner({ rootGetters }, { value, fee = [], memo = '' }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgFundBurner(value) + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgFundBurner:Init Could not initialize signing client. Wallet is required.') + }else{ + throw new Error('TxClient:MsgFundBurner:Send Could not broadcast Tx: '+ e.message) + } + } + }, + async MsgFundBurner({ rootGetters }, { value }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgFundBurner(value) + return msg + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgFundBurner:Init Could not initialize signing client. Wallet is required.') + } else{ + throw new Error('TxClient:MsgFundBurner:Create Could not create message: ' + e.message) + } + } + }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/index.ts index 67d4b093..42664017 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/index.ts @@ -4,9 +4,11 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; +import { MsgFundBurner } from "./types/burner/tx"; const types = [ + ["/bze.burner.v1.MsgFundBurner", MsgFundBurner], ]; export const MissingWalletError = new Error("wallet is required"); @@ -39,6 +41,7 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + msgFundBurner: (data: MsgFundBurner): EncodeObject => ({ typeUrl: "/bze.burner.v1.MsgFundBurner", value: MsgFundBurner.fromPartial( data ) }), }; }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/rest.ts index d6cc2bdb..71bfd538 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/rest.ts @@ -25,6 +25,8 @@ export interface V1BurnedCoins { height?: string; } +export type V1MsgFundBurnerResponse = object; + /** * Params defines the parameters for the module. */ diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/tx.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/tx.ts index 8d4851cc..74a3b426 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/tx.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/tx.ts @@ -1,14 +1,143 @@ /* eslint-disable */ +import { Reader, Writer } from "protobufjs/minimal"; + export const protobufPackage = "bze.burner.v1"; +export interface MsgFundBurner { + creator: string; + amount: string; +} + +export interface MsgFundBurnerResponse {} + +const baseMsgFundBurner: object = { creator: "", amount: "" }; + +export const MsgFundBurner = { + encode(message: MsgFundBurner, writer: Writer = Writer.create()): Writer { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MsgFundBurner { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgFundBurner } as MsgFundBurner; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgFundBurner { + const message = { ...baseMsgFundBurner } as MsgFundBurner; + if (object.creator !== undefined && object.creator !== null) { + message.creator = String(object.creator); + } else { + message.creator = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + return message; + }, + + toJSON(message: MsgFundBurner): unknown { + const obj: any = {}; + message.creator !== undefined && (obj.creator = message.creator); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, + + fromPartial(object: DeepPartial): MsgFundBurner { + const message = { ...baseMsgFundBurner } as MsgFundBurner; + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } else { + message.creator = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + return message; + }, +}; + +const baseMsgFundBurnerResponse: object = {}; + +export const MsgFundBurnerResponse = { + encode(_: MsgFundBurnerResponse, writer: Writer = Writer.create()): Writer { + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MsgFundBurnerResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgFundBurnerResponse } as MsgFundBurnerResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgFundBurnerResponse { + const message = { ...baseMsgFundBurnerResponse } as MsgFundBurnerResponse; + return message; + }, + + toJSON(_: MsgFundBurnerResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgFundBurnerResponse { + const message = { ...baseMsgFundBurnerResponse } as MsgFundBurnerResponse; + return message; + }, +}; + /** Msg defines the Msg service. */ -export interface Msg {} +export interface Msg { + /** this line is used by starport scaffolding # proto/tx/rpc */ + FundBurner(request: MsgFundBurner): Promise; +} export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; } + FundBurner(request: MsgFundBurner): Promise { + const data = MsgFundBurner.encode(request).finish(); + const promise = this.rpc.request("bze.burner.v1.Msg", "FundBurner", data); + return promise.then((data) => + MsgFundBurnerResponse.decode(new Reader(data)) + ); + } } interface Rpc { @@ -18,3 +147,14 @@ interface Rpc { data: Uint8Array ): Promise; } + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/x/burner/client/cli/tx.go b/x/burner/client/cli/tx.go index 62bf9e5d..fbc0e477 100644 --- a/x/burner/client/cli/tx.go +++ b/x/burner/client/cli/tx.go @@ -30,6 +30,7 @@ func GetTxCmd() *cobra.Command { RunE: client.ValidateCmd, } + cmd.AddCommand(CmdFundBurner()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/burner/client/cli/tx_fund_burner.go b/x/burner/client/cli/tx_fund_burner.go new file mode 100644 index 00000000..fe3dceca --- /dev/null +++ b/x/burner/client/cli/tx_fund_burner.go @@ -0,0 +1,42 @@ +package cli + +import ( + "strconv" + + "github.com/bze-alphateam/bze/x/burner/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 CmdFundBurner() *cobra.Command { + cmd := &cobra.Command{ + Use: "fund-burner [amount]", + Short: "Broadcast message fund-burner", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAmount := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgFundBurner( + clientCtx.GetFromAddress().String(), + argAmount, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/burner/genesis.go b/x/burner/genesis.go index 2e2064e7..659060b4 100644 --- a/x/burner/genesis.go +++ b/x/burner/genesis.go @@ -22,7 +22,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) genesis.BurnedCoinsList = k.GetAllBurnedCoins(ctx) - + // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/burner/handler.go b/x/burner/handler.go index bf58a2ea..d77f2b12 100644 --- a/x/burner/handler.go +++ b/x/burner/handler.go @@ -11,13 +11,16 @@ import ( // NewHandler ... func NewHandler(k keeper.Keeper) sdk.Handler { - // this line is used by starport scaffolding # handler/msgServer + msgServer := keeper.NewMsgServerImpl(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { - // this line is used by starport scaffolding # 1 + case *types.MsgFundBurner: + res, err := msgServer.FundBurner(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + // this line is used by starport scaffolding # 1 default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) diff --git a/x/burner/keeper/msg_server_fund_burner.go b/x/burner/keeper/msg_server_fund_burner.go new file mode 100644 index 00000000..1b98518b --- /dev/null +++ b/x/burner/keeper/msg_server_fund_burner.go @@ -0,0 +1,30 @@ +package keeper + +import ( + "context" + + "github.com/bze-alphateam/bze/x/burner/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) FundBurner(goCtx context.Context, msg *types.MsgFundBurner) (*types.MsgFundBurnerResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + amount, err := sdk.ParseCoinsNormalized(msg.Amount) + if err != nil { + return nil, err + } + + creatorAccount, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return nil, err + } + + err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, creatorAccount, types.ModuleName, amount) + if err != nil { + return nil, err + } + + _ = ctx + + return &types.MsgFundBurnerResponse{}, nil +} diff --git a/x/burner/module_simulation.go b/x/burner/module_simulation.go index a288587b..8976c6ff 100644 --- a/x/burner/module_simulation.go +++ b/x/burner/module_simulation.go @@ -24,7 +24,11 @@ var ( ) const ( -// this line is used by starport scaffolding # simapp/module/const + opWeightMsgFundBurner = "op_weight_msg_fund_burner" + // TODO: Determine the simulation weight value + defaultWeightMsgFundBurner int = 100 + + // this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module @@ -58,6 +62,17 @@ func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) + var weightMsgFundBurner int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgFundBurner, &weightMsgFundBurner, nil, + func(_ *rand.Rand) { + weightMsgFundBurner = defaultWeightMsgFundBurner + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgFundBurner, + burnersimulation.SimulateMsgFundBurner(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations diff --git a/x/burner/simulation/fund_burner.go b/x/burner/simulation/fund_burner.go new file mode 100644 index 00000000..3e15daa1 --- /dev/null +++ b/x/burner/simulation/fund_burner.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/bze-alphateam/bze/x/burner/keeper" + "github.com/bze-alphateam/bze/x/burner/types" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +func SimulateMsgFundBurner( + 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.MsgFundBurner{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the FundBurner simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "FundBurner simulation not implemented"), nil, nil + } +} diff --git a/x/burner/types/codec.go b/x/burner/types/codec.go index 6bf5b72f..0faafdbd 100644 --- a/x/burner/types/codec.go +++ b/x/burner/types/codec.go @@ -5,16 +5,20 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/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(&BurnCoinsProposal{}, "burner/BurnCoinsProposal", nil) + cdc.RegisterConcrete(&MsgFundBurner{}, "burner/FundBurner", nil) // this line is used by starport scaffolding # 2 } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgFundBurner{}, + ) // this line is used by starport scaffolding # 3 registry.RegisterImplementations( (*govtypes.Content)(nil), diff --git a/x/burner/types/expected_keepers.go b/x/burner/types/expected_keepers.go index b26864aa..eedd352f 100644 --- a/x/burner/types/expected_keepers.go +++ b/x/burner/types/expected_keepers.go @@ -15,5 +15,6 @@ type AccountKeeper interface { type BankKeeper interface { GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins BurnCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error // Methods imported from bank should be defined here } diff --git a/x/burner/types/message_fund_burner.go b/x/burner/types/message_fund_burner.go new file mode 100644 index 00000000..7caf4f15 --- /dev/null +++ b/x/burner/types/message_fund_burner.go @@ -0,0 +1,46 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgFundBurner = "fund_burner" + +var _ sdk.Msg = &MsgFundBurner{} + +func NewMsgFundBurner(creator string, amount string) *MsgFundBurner { + return &MsgFundBurner{ + Creator: creator, + Amount: amount, + } +} + +func (msg *MsgFundBurner) Route() string { + return RouterKey +} + +func (msg *MsgFundBurner) Type() string { + return TypeMsgFundBurner +} + +func (msg *MsgFundBurner) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgFundBurner) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgFundBurner) 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/burner/types/message_fund_burner_test.go b/x/burner/types/message_fund_burner_test.go new file mode 100644 index 00000000..7ff1b6d2 --- /dev/null +++ b/x/burner/types/message_fund_burner_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + "github.com/bze-alphateam/bze/testutil/sample" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgFundBurner_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgFundBurner + err error + }{ + { + name: "invalid address", + msg: MsgFundBurner{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgFundBurner{ + 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/burner/types/tx.pb.go b/x/burner/types/tx.pb.go index 29a69c9a..95ca76e0 100644 --- a/x/burner/types/tx.pb.go +++ b/x/burner/types/tx.pb.go @@ -9,7 +9,11 @@ import ( grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/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,18 +27,117 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type MsgFundBurner struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Amount string `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *MsgFundBurner) Reset() { *m = MsgFundBurner{} } +func (m *MsgFundBurner) String() string { return proto.CompactTextString(m) } +func (*MsgFundBurner) ProtoMessage() {} +func (*MsgFundBurner) Descriptor() ([]byte, []int) { + return fileDescriptor_64ba45d2ae09f032, []int{0} +} +func (m *MsgFundBurner) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFundBurner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFundBurner.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 *MsgFundBurner) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFundBurner.Merge(m, src) +} +func (m *MsgFundBurner) XXX_Size() int { + return m.Size() +} +func (m *MsgFundBurner) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFundBurner.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFundBurner proto.InternalMessageInfo + +func (m *MsgFundBurner) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgFundBurner) GetAmount() string { + if m != nil { + return m.Amount + } + return "" +} + +type MsgFundBurnerResponse struct { +} + +func (m *MsgFundBurnerResponse) Reset() { *m = MsgFundBurnerResponse{} } +func (m *MsgFundBurnerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgFundBurnerResponse) ProtoMessage() {} +func (*MsgFundBurnerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_64ba45d2ae09f032, []int{1} +} +func (m *MsgFundBurnerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFundBurnerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFundBurnerResponse.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 *MsgFundBurnerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFundBurnerResponse.Merge(m, src) +} +func (m *MsgFundBurnerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgFundBurnerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFundBurnerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFundBurnerResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgFundBurner)(nil), "bze.burner.v1.MsgFundBurner") + proto.RegisterType((*MsgFundBurnerResponse)(nil), "bze.burner.v1.MsgFundBurnerResponse") +} + func init() { proto.RegisterFile("burner/tx.proto", fileDescriptor_64ba45d2ae09f032) } var fileDescriptor_64ba45d2ae09f032 = []byte{ - // 127 bytes of a gzipped FileDescriptorProto + // 211 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0x2a, 0x2d, 0xca, 0x4b, 0x2d, 0xd2, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, - 0xd5, 0x83, 0x08, 0xea, 0x95, 0x19, 0x1a, 0xb1, 0x72, 0x31, 0xfb, 0x16, 0xa7, 0x3b, 0xb9, 0x9e, - 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, - 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x76, 0x7a, 0x66, 0x49, 0x46, 0x69, - 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x52, 0x55, 0xaa, 0x6e, 0x62, 0x4e, 0x41, 0x46, 0x62, 0x49, - 0x6a, 0x22, 0x98, 0xa7, 0x5f, 0xa1, 0x0f, 0x33, 0xbf, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x6c, - 0x87, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x1d, 0xd9, 0xe0, 0xfe, 0x76, 0x00, 0x00, 0x00, + 0xd5, 0x83, 0x08, 0xea, 0x95, 0x19, 0x2a, 0x39, 0x72, 0xf1, 0xfa, 0x16, 0xa7, 0xbb, 0x95, 0xe6, + 0xa5, 0x38, 0x81, 0xc5, 0x84, 0x24, 0xb8, 0xd8, 0x93, 0x8b, 0x52, 0x13, 0x4b, 0xf2, 0x8b, 0x24, + 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x60, 0x5c, 0x21, 0x31, 0x2e, 0xb6, 0xc4, 0xdc, 0xfc, 0xd2, + 0xbc, 0x12, 0x09, 0x26, 0xb0, 0x04, 0x94, 0xa7, 0x24, 0xce, 0x25, 0x8a, 0x62, 0x44, 0x50, 0x6a, + 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x51, 0x38, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x50, 0x00, 0x17, + 0x17, 0x92, 0xf9, 0x32, 0x7a, 0x28, 0x0e, 0xd0, 0x43, 0xd1, 0x2a, 0xa5, 0x82, 0x4f, 0x16, 0x66, + 0xb0, 0x93, 0xeb, 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, 0x69, 0xa7, 0x67, + 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x27, 0x55, 0xa5, 0xea, 0x26, 0xe6, 0x14, + 0x64, 0x24, 0x96, 0xa4, 0x26, 0x82, 0x79, 0xfa, 0x15, 0xfa, 0xb0, 0xd0, 0xa8, 0x2c, 0x48, 0x2d, + 0x4e, 0x62, 0x03, 0x87, 0x88, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x96, 0x2d, 0x6b, 0x8b, 0x24, + 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -49,6 +152,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 { + FundBurner(ctx context.Context, in *MsgFundBurner, opts ...grpc.CallOption) (*MsgFundBurnerResponse, error) } type msgClient struct { @@ -59,22 +163,411 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } +func (c *msgClient) FundBurner(ctx context.Context, in *MsgFundBurner, opts ...grpc.CallOption) (*MsgFundBurnerResponse, error) { + out := new(MsgFundBurnerResponse) + err := c.cc.Invoke(ctx, "/bze.burner.v1.Msg/FundBurner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { + FundBurner(context.Context, *MsgFundBurner) (*MsgFundBurnerResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. type UnimplementedMsgServer struct { } +func (*UnimplementedMsgServer) FundBurner(ctx context.Context, req *MsgFundBurner) (*MsgFundBurnerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FundBurner not implemented") +} + func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +func _Msg_FundBurner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFundBurner) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FundBurner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bze.burner.v1.Msg/FundBurner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FundBurner(ctx, req.(*MsgFundBurner)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "bze.burner.v1.Msg", HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{}, - Metadata: "burner/tx.proto", + Methods: []grpc.MethodDesc{ + { + MethodName: "FundBurner", + Handler: _Msg_FundBurner_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "burner/tx.proto", +} + +func (m *MsgFundBurner) 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 *MsgFundBurner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFundBurner) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + i -= len(m.Amount) + copy(dAtA[i:], m.Amount) + i = encodeVarintTx(dAtA, i, uint64(len(m.Amount))) + i-- + dAtA[i] = 0x12 + } + 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 *MsgFundBurnerResponse) 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 *MsgFundBurnerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFundBurnerResponse) 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 *MsgFundBurner) 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)) + } + l = len(m.Amount) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgFundBurnerResponse) 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 *MsgFundBurner) 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: MsgFundBurner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFundBurner: 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 != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount = 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 *MsgFundBurnerResponse) 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: MsgFundBurnerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFundBurnerResponse: 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 4ad6ba59a115b0824d4b4a1a3b7b215097d361e6 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Mon, 12 Dec 2022 02:06:03 +0200 Subject: [PATCH 35/54] added upgrades handlers and store upgrades --- app/app.go | 34 +++++++++++++--- app/upgrades/v512/upgrades.go | 16 ++++++++ app/upgrades/v6/upgrades.go | 3 -- app/upgrades/v600/upgrades.go | 16 ++++++++ .../bze-alphateam/bze/bze.scavenge/index.ts | 40 +++++++++---------- .../bze/bze.scavenge/module/index.ts | 6 +-- 6 files changed, 84 insertions(+), 31 deletions(-) create mode 100644 app/upgrades/v512/upgrades.go delete mode 100644 app/upgrades/v6/upgrades.go create mode 100644 app/upgrades/v600/upgrades.go diff --git a/app/app.go b/app/app.go index 5c5cbb1f..872df6a2 100644 --- a/app/app.go +++ b/app/app.go @@ -1,6 +1,9 @@ package app import ( + v512 "github.com/bze-alphateam/bze/app/upgrades/v512" + v600 "github.com/bze-alphateam/bze/app/upgrades/v600" + storetypes "github.com/cosmos/cosmos-sdk/store/types" "io" "net/http" "os" @@ -580,11 +583,32 @@ func New( func (app *App) setupUpgradeHandlers() { app.UpgradeKeeper.SetUpgradeHandler( - "v5.1.2", - func(ctx sdk.Context, _plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - //do nothing on purpose - return vm, nil - }) + v512.UpgradeName, + v512.CreateUpgradeHandler(), + ) + + app.UpgradeKeeper.SetUpgradeHandler( + v600.UpgradeName, + v600.CreateUpgradeHandler(), + ) + + upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() + if err != nil { + panic(err) + } + + if app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + return + } + + if upgradeInfo.Name == v600.UpgradeName { + storeUpgrades := storetypes.StoreUpgrades{ + Added: []string{"burner", "cointrunk"}, + } + + // configure store loader that checks if version == upgradeHeight and applies store upgrades + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) + } } // Name returns the name of the App diff --git a/app/upgrades/v512/upgrades.go b/app/upgrades/v512/upgrades.go new file mode 100644 index 00000000..19d75823 --- /dev/null +++ b/app/upgrades/v512/upgrades.go @@ -0,0 +1,16 @@ +package v512 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" +) + +const UpgradeName = "v5.1.2" + +func CreateUpgradeHandler() upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + //do nothing on purpose + return vm, nil + } +} diff --git a/app/upgrades/v6/upgrades.go b/app/upgrades/v6/upgrades.go deleted file mode 100644 index 5ead4b28..00000000 --- a/app/upgrades/v6/upgrades.go +++ /dev/null @@ -1,3 +0,0 @@ -package v6 - -const UpgradeName = "v6.0.0" diff --git a/app/upgrades/v600/upgrades.go b/app/upgrades/v600/upgrades.go new file mode 100644 index 00000000..d304fe7c --- /dev/null +++ b/app/upgrades/v600/upgrades.go @@ -0,0 +1,16 @@ +package v600 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" +) + +const UpgradeName = "v6.0.0" + +func CreateUpgradeHandler() upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + //do nothing on purpose + return vm, nil + } +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 155d50b2..40cc1ba4 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,21 +232,6 @@ export default { }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) - } - } - }, async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -277,20 +262,22 @@ export default { } } }, - - async MsgRevealSolution({ rootGetters }, { value }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) const msg = await txClient.msgRevealSolution(value) - return msg + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result } catch (e) { if (e == MissingWalletError) { throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + }else{ + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) @@ -317,6 +304,19 @@ export default { } } }, + async MsgRevealSolution({ rootGetters }, { value }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgRevealSolution(value) + return msg + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + } else{ + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + } + } + }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 9a3de64c..c023b54d 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; +import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; }; From f42afaea53b8657ea19bbcbca19dcf6a4e1c6c5e Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 15 Dec 2022 23:08:41 +0200 Subject: [PATCH 36/54] upgrade store modules --- app/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 872df6a2..7f9b396a 100644 --- a/app/app.go +++ b/app/app.go @@ -603,7 +603,7 @@ func (app *App) setupUpgradeHandlers() { if upgradeInfo.Name == v600.UpgradeName { storeUpgrades := storetypes.StoreUpgrades{ - Added: []string{"burner", "cointrunk"}, + Added: []string{burnermoduletypes.StoreKey, cointrunkmoduletypes.StoreKey}, } // configure store loader that checks if version == upgradeHeight and applies store upgrades From 559841b82901f8c8cd3fdb4d101f8f398bf3d230 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 15 Dec 2022 23:49:43 +0200 Subject: [PATCH 37/54] added readme details --- readme.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index d5ce1026..f57b6cbe 100644 --- a/readme.md +++ b/readme.md @@ -1,2 +1,47 @@ -# BZE -**BeeZee** is a blockchain built using Cosmos SDK +# BeeZee (BZE) +A blockchain governed by the community built on top of Cosmos SDK. BZE moved to Cosmos from +Zcash codebase in 2022 with the help of the community. + +## Official accounts and links: +[Official website](https://getbze.com/) +[Official Twitter account](https://twitter.com/BZEdgeCoin) +[Official Medium](https://medium.com/@bzedge) + +### Wallets: +[Vidulum App](https://vidulum.app/) +[Keplr Browser Extension](https://keplr.getbze.com/) + +### Explorers: +https://explorer.erialos.me/beezee +https://explorers.vidulum.app/beezee + +### Trading: +[Osmosis Pool](https://frontier.osmosis.zone/pool/856) +[Dex tracker]( https://dexscreener.com/osmosis/856) + +### Resources: +[Configs & Utils](https://github.com/bze-alphateam/bze-configs) +⚠️ Use Chain-assets repo to get details needed to run a node.⚠️ +[Cosmos Chain-assets](https://github.com/cosmos/chain-registry/tree/master/beezee) +[Graphics](https://github.com/bze-alphateam/Official-BZEdge-Graphics) + +### Genesis files: +[Mainnet (beezee-1)](https://github.com/bze-alphateam/bze/blob/main/genesis.json) +[Testnet (bzetestnet-2)](https://github.com/bze-alphateam/bze/blob/main/genesis-testnet-2.json) + +### IBC: +#### BZE - Osmosis: +**BZE**: channel-0 +**Osmosis**: channel-340 + +### Building from source +#### Checkout to the branch/tag you want to build +`git checkout v6.0.0` + +#### Build binaries: +`make build-all` +This will build binaries for all supported platforms and compress them in ./build directory + +#### Build for specific platform: +`make build-linux` +This will build the binary for linux amd64 - check Makefile for more details and platforms From 8580ebe4731cd3d276d2b1d88c4eb2d75236e103 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 15 Dec 2022 23:51:49 +0200 Subject: [PATCH 38/54] updated golang cross version in makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 14768648..5a697e58 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PACKAGES=$(shell go list ./... | grep -v '/simulation') PACKAGE_NAME:=github.com/bze-alphateam/bze-v5 -GOLANG_CROSS_VERSION = v1.17.2 +GOLANG_CROSS_VERSION = v1.19.3 VERSION := $(shell echo $(shell git describe --tags 2>/dev/null ) | sed 's/^v//') COMMIT := $(shell git log -1 --format='%H') NETWORK ?= mainnet From 894b9a47c7468a7e3308d95c8edb7bab183ab078 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Fri, 23 Dec 2022 17:49:52 +0200 Subject: [PATCH 39/54] added authz module --- app/app.go | 20 +- docs/static/openapi.yml | 7028 +++++++++++------ go.mod | 12 +- go.sum | 20 +- .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +- .../bze/bze.scavenge/module/index.ts | 12 +- 6 files changed, 4773 insertions(+), 2351 deletions(-) diff --git a/app/app.go b/app/app.go index 7f9b396a..d39dac30 100644 --- a/app/app.go +++ b/app/app.go @@ -29,6 +29,9 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + "github.com/cosmos/cosmos-sdk/x/authz" + authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" + authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -156,6 +159,7 @@ var ( crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, + authzmodule.AppModuleBasic{}, ibc.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, @@ -216,6 +220,7 @@ type App struct { // keepers AccountKeeper authkeeper.AccountKeeper + AuthzKeeper *authzkeeper.Keeper BankKeeper bankkeeper.Keeper CapabilityKeeper *capabilitykeeper.Keeper StakingKeeper stakingkeeper.Keeper @@ -281,6 +286,7 @@ func New( evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, + authzkeeper.StoreKey, scavengemoduletypes.StoreKey, cointrunkmoduletypes.StoreKey, burnermoduletypes.StoreKey, @@ -317,6 +323,14 @@ func New( app.AccountKeeper = authkeeper.NewAccountKeeper( appCodec, keys[authtypes.StoreKey], app.GetSubspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms, ) + + authzKeeper := authzkeeper.NewKeeper( + keys[authzkeeper.StoreKey], + appCodec, + bApp.MsgServiceRouter(), + ) + app.AuthzKeeper = &authzKeeper + app.BankKeeper = bankkeeper.NewBaseKeeper( appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.ModuleAccountAddrs(), ) @@ -446,6 +460,7 @@ func New( slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), + authzmodule.NewAppModule(appCodec, *app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), upgrade.NewAppModule(app.UpgradeKeeper), evidence.NewAppModule(app.EvidenceKeeper), ibc.NewAppModule(app.IBCKeeper), @@ -479,6 +494,7 @@ func New( evidencetypes.ModuleName, scavengemoduletypes.ModuleName, vestingtypes.ModuleName, + authz.ModuleName, ibctransfertypes.ModuleName, cointrunkmoduletypes.ModuleName, burnermoduletypes.ModuleName, @@ -502,6 +518,7 @@ func New( evidencetypes.ModuleName, scavengemoduletypes.ModuleName, vestingtypes.ModuleName, + authz.ModuleName, ibctransfertypes.ModuleName, cointrunkmoduletypes.ModuleName, burnermoduletypes.ModuleName, @@ -530,6 +547,7 @@ func New( feegrant.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, + authz.ModuleName, paramstypes.ModuleName, cointrunkmoduletypes.ModuleName, burnermoduletypes.ModuleName, @@ -603,7 +621,7 @@ func (app *App) setupUpgradeHandlers() { if upgradeInfo.Name == v600.UpgradeName { storeUpgrades := storetypes.StoreUpgrades{ - Added: []string{burnermoduletypes.StoreKey, cointrunkmoduletypes.StoreKey}, + Added: []string{burnermoduletypes.StoreKey, cointrunkmoduletypes.StoreKey, authzkeeper.StoreKey}, } // configure store loader that checks if version == upgradeHeight and applies store upgrades diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index c0de73d6..327786b8 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -2540,36 +2540,207 @@ paths: } tags: - Query - '/cosmos/bank/v1beta1/balances/{address}': + /cosmos/authz/v1beta1/grants: get: - summary: AllBalances queries the balance of all coins for a single account. - operationId: CosmosBankV1Beta1AllBalances + summary: 'Returns list of `Authorization`, granted to the grantee by the granter.' + operationId: CosmosAuthzV1Beta1Grants responses: '200': description: A successful response. schema: type: object properties: - balances: + grants: type: array items: type: object properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + 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 - NOTE: The amount field is an Int which implements the custom - method + one "/" character. The last segment of the URL's + path must represent - signatures required by gogoproto. - description: balances is the balances of all the coins. + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the 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 + 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 the pagination in the response. + description: pagination defines an pagination for the response. type: object properties: next_key: @@ -2587,10 +2758,8 @@ paths: was set, its value is undefined otherwise description: >- - QueryAllBalancesResponse is the response type for the - Query/AllBalances RPC - - method. + QueryGrantsResponse is the response type for the + Query/Authorizations RPC method. default: description: An unexpected error response. schema: @@ -2608,62 +2777,239 @@ paths: 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. + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - It is less efficient than using key. Only one of offset or key - should + protocol buffer message. This string must contain at + least - 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. + one "/" character. The last segment of the URL's path + must represent - 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 + the fully qualified name of the type (as in - a count of the total number of items available for pagination in - UIs. + `path/google.protobuf.Duration`). The name should be in + a canonical form - count_total is only respected when offset is used. It is ignored - when key + (e.g., leading "." is not accepted). - 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 + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the 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. @@ -2673,398 +3019,232 @@ paths: type: boolean tags: - Query - '/cosmos/bank/v1beta1/balances/{address}/by_denom': + '/cosmos/authz/v1beta1/grants/grantee/{grantee}': get: - summary: Balance queries the balance of a single coin for a single account. - operationId: CosmosBankV1Beta1Balance + summary: GranteeGrants returns a list of `GrantAuthorization` by grantee. + description: 'Since: cosmos-sdk 0.45.2' + operationId: CosmosAuthzV1Beta1GranteeGrants responses: '200': description: A successful response. schema: type: object properties: - 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: >- - 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: + grants: type: array items: type: object properties: - '@type': + granter: 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/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: + grantee: 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 + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - raise the base_denom to in order to equal the - given DenomUnit's denom + protocol buffer message. This string must contain at + least - 1 denom = 1^exponent base_denom + one "/" character. The last segment of the URL's + path must represent - (e.g. with a base_denom of uatom, one can create a - DenomUnit of 'atom' with + the fully qualified name of the type (as in - 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 + `path/google.protobuf.Duration`). The name should be + in a canonical form - be the same as the display. + (e.g., leading "." is not accepted). - Since: cosmos-sdk 0.43 - 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 - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + In practice, teams usually precompile into the + binary all types that they - was set, its value is undefined otherwise - description: >- - QueryDenomsMetadataResponse is the response type for the - Query/DenomsMetadata RPC + expect it to use in the context of Any. However, for + URLs which use the - method. - default: - description: An unexpected 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. + scheme `http`, `https`, or no scheme, one can + optionally set up a type - It is less efficient than using key. Only one of offset or key - should + server that maps type URLs to message definitions as + follows: - 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 + * If no scheme is provided, `https` is assumed. - a count of the total number of items available for pagination in - UIs. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - count_total is only respected when offset is used. It is ignored - when key + Note: this functionality is not currently available + in the official - 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. + protobuf release, and it is not used for type URLs + beginning with + type.googleapis.com. - 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: - 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 + Schemes other than `http`, `https` (or the empty + scheme) might be - 1 denom = 1^exponent base_denom + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - (e.g. with a base_denom of uatom, one can create a - DenomUnit of 'atom' with + URL that describes the type of the serialized message. - 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. + Protobuf library provides support to pack/unpack Any + values in the form + of utility functions or additional generated methods of + the Any type. - Since: cosmos-sdk 0.43 - description: |- - Metadata represents a struct that describes - a basic token. - 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': + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the 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 - 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: + format: date-time + description: 'Since: cosmos-sdk 0.45.2' + 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: - 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 + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - sendable). - default_send_enabled: - type: boolean - description: Params defines the parameters for the bank module. + was set, its value is undefined otherwise description: >- - QueryParamsResponse defines the response type for querying x/bank - parameters. + QueryGranteeGrantsResponse is the response type for the + Query/GranteeGrants RPC method. default: description: An unexpected error response. schema: @@ -3082,83 +3262,176 @@ paths: properties: '@type': type: string - additionalProperties: {} - tags: - - Query - '/cosmos/bank/v1beta1/spendable_balances/{address}': - get: - summary: |- - SpendableBalances queries the spenable balance of all coins for a single - account. - 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. + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + protocol buffer message. This string must contain at + least - NOTE: The amount field is an Int which implements the custom - method + one "/" character. The last segment of the URL's path + must represent - 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 - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + the fully qualified name of the type (as in - was set, its value is undefined otherwise - description: >- - QuerySpendableBalancesResponse defines the gRPC response structure - for querying + `path/google.protobuf.Duration`). The name should be in + a canonical form - an account's spendable balances. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the 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 address to query spendable balances for. + - name: grantee in: path required: true type: string @@ -3220,165 +3493,232 @@ paths: type: boolean tags: - Query - /cosmos/bank/v1beta1/supply: + '/cosmos/authz/v1beta1/grants/granter/{granter}': get: - summary: TotalSupply queries the total supply of all coins. - operationId: CosmosBankV1Beta1TotalSupply + summary: 'GranterGrants returns list of `GrantAuthorization`, granted by granter.' + description: 'Since: cosmos-sdk 0.45.2' + operationId: CosmosAuthzV1Beta1GranterGrants responses: '200': description: A successful response. schema: type: object properties: - supply: + grants: type: array items: type: object properties: - denom: + granter: type: string - amount: + grantee: type: string - description: >- - Coin defines a token with a denomination and an amount. + 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 - NOTE: The amount field is an Int which implements the custom - method + one "/" character. The last segment of the URL's + path must represent - signatures required by gogoproto. - title: supply is the supply of the coins - pagination: - description: |- - pagination defines the pagination in the response. + the fully qualified name of the type (as in - Since: cosmos-sdk 0.43 - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + `path/google.protobuf.Duration`). The name should be + in a canonical form - was set, its value is undefined otherwise - title: >- - QueryTotalSupplyResponse is the response type for the - Query/TotalSupply RPC + (e.g., leading "." is not accepted). - method - default: - description: An unexpected 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 + In practice, teams usually precompile into the + binary all types that they - 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. + expect it to use in the context of Any. However, for + URLs which use the - 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 + scheme `http`, `https`, or no scheme, one can + optionally set up a type - a count of the total number of items available for pagination in - UIs. + server that maps type URLs to message definitions as + follows: - 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. + * If no scheme is provided, `https` is assumed. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - tags: - - Query - '/cosmos/bank/v1beta1/supply/{denom}': - get: - summary: SupplyOf queries the supply of a single coin. - operationId: CosmosBankV1Beta1SupplyOf - responses: - '200': - description: A successful response. - schema: - type: object - properties: - amount: + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the 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 + description: 'Since: cosmos-sdk 0.45.2' + 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: - denom: + next_key: type: string - amount: + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: 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 + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - signatures required by gogoproto. + was set, its value is undefined otherwise description: >- - QuerySupplyOfResponse is the response type for the Query/SupplyOf - RPC method. + QueryGranterGrantsResponse is the response type for the + Query/GranterGrants RPC method. default: description: An unexpected error response. schema: @@ -3396,15 +3736,1102 @@ paths: properties: '@type': type: string - additionalProperties: {} - parameters: - - name: denom - description: denom is the coin denom to query balances for. - in: path - required: true - type: string - tags: - - Query + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the 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. + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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: + 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: >- + 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/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 = 1^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 + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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: + 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 = 1^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 + description: |- + Metadata represents a struct that describes + a basic token. + 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). + 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/spendable_balances/{address}': + get: + summary: |- + SpendableBalances queries the spenable balance of all coins for a single + account. + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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. + default: + description: An unexpected 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/supply: + get: + summary: TotalSupply queries the total supply of all coins. + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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/{denom}': + get: + summary: SupplyOf queries the supply of a single coin. + operationId: CosmosBankV1Beta1SupplyOf + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amount: + 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: >- + 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: path + required: true + type: string + tags: + - Query /cosmos/base/tendermint/v1beta1/blocks/latest: get: summary: GetLatestBlock returns the latest block. @@ -28666,92 +30093,332 @@ paths: Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the 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: Consensus state associated with the request identifier + 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 - Example 3: Pack and unpack a message in Python. + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + methods only use the fully qualified type name after the + last '/' - Example 4: Pack and unpack a message in Go + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + name "y.z". - The pack methods provided by protobuf library will by default - use - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - methods only use the fully qualified type name after the last - '/' + JSON - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + ==== - name "y.z". + The JSON representation of an `Any` value uses the regular + representation of the deserialized, embedded message, with + an + additional field `@type` which contains the type URL. + Example: - JSON + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - ==== + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - The JSON representation of an `Any` value uses the regular + If the embedded message type is well-known and has a custom + JSON - representation of the deserialized, embedded message, with an + representation, that representation will be embedded adding + a field - additional field `@type` which contains the type URL. Example: + `value` which holds the custom JSON in addition to the + `@type` - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@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 - If the embedded message type is well-known and has a custom - JSON + RevisionNumber the same. However some consensus algorithms may + choose to - representation, that representation will be embedded adding a - field + reset the height in certain conditions e.g. hard forks, + state-machine - `value` which holds the custom JSON in addition to the `@type` + breaking changes In these cases, the RevisionNumber is + incremented so that - field. Example (for message [google.protobuf.Duration][]): + height continues to be monitonically increasing even as the + RevisionHeight - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: Consensus state associated with the request identifier - description: |- - QueryUpgradedConsensusStateResponse is the response type for the - Query/UpgradedConsensusState RPC method. + gets reset + title: |- + QueryClientConnectionsResponse is the response type for the + Query/ClientConnections RPC method default: description: An unexpected error response. schema: @@ -28916,52 +30583,162 @@ paths: string last_name = 2; } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the 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. - If the embedded message type is well-known and has a custom - JSON + The constructed key from the Path and the key will + be append(Path.KeyPath, - representation, that representation will be embedded adding - a field + 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 - `value` which holds the custom JSON in addition to the - `@type` + identifier field. + description: list of stored connections of the chain. + pagination: + title: pagination response + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - field. Example (for message [google.protobuf.Duration][]): + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the - { - "@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 + 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: @@ -28989,9 +30766,11 @@ paths: RevisionHeight gets reset - title: |- - QueryClientConnectionsResponse is the response type for the - Query/ClientConnections RPC method + description: >- + QueryConnectionsResponse is the response type for the + Query/Connections RPC + + method. default: description: An unexpected error response. schema: @@ -29178,140 +30957,163 @@ paths: "value": "1.212s" } parameters: - - name: client_id - description: client identifier associated with a connection - in: path - required: true + - 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 tags: - Query - /ibc/core/connection/v1/connections: + '/ibc/core/connection/v1/connections/{connection_id}': get: - summary: Connections queries all the IBC connections of a chain. - operationId: IbcCoreConnectionV1Connections + summary: Connection queries an IBC connection end. + operationId: IbcCoreConnectionV1Connection 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. + 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: - client_id: + identifier: type: string - description: >- - identifies the client on the counterparty chain - associated with a given + 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 - connection. - connection_id: - type: string - description: >- - identifies the connection end on the counterparty - chain associated with a + 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 - 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. + connection. + connection_id: + type: string + description: >- + identifies the connection end on the counterparty + chain associated with a - The constructed key from the Path and the key will - be append(Path.KeyPath, + 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. - 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 + The constructed key from the Path and the key will be + append(Path.KeyPath, - identifier field. - description: list of stored connections of the chain. - pagination: - title: pagination response - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + append(Path.KeyPrefix, key...)) + delay_period: type: string format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + description: >- + delay period that must pass before a consensus state can + be used for - was set, its value is undefined otherwise + packet-verification NOTE: delay period logic is only + implemented by some + + clients. description: >- - PageResponse is to be embedded in gRPC response messages where - the + ConnectionEnd defines a stateful object on a chain connected + to another - corresponding request message has used PageRequest. + separate one. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - height: - title: query block height + 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: @@ -29340,10 +31142,13 @@ paths: gets reset description: >- - QueryConnectionsResponse is the response type for the - Query/Connections RPC + QueryConnectionResponse is the response type for the + Query/Connection RPC - method. + 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: @@ -29530,157 +31335,211 @@ paths: "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 + - name: connection_id + description: connection unique identifier + in: path + required: true type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + 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: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' - It is less efficient than using key. Only one of offset or key - should + in the type URL, for example "foo.bar.com/x/y.z" will + yield type - 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. + name "y.z". - 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 + JSON - is set. - 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 + The JSON representation of an `Any` value uses the regular - 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 + representation of the deserialized, embedded message, with + an - connection. - connection_id: - type: string - description: >- - identifies the connection end on the counterparty - chain associated with a + additional field `@type` which contains the type URL. + Example: - 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. + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - The constructed key from the Path and the key will be - append(Path.KeyPath, + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - append(Path.KeyPrefix, key...)) - delay_period: - type: string - format: uint64 - description: >- - delay period that must pass before a consensus state can - be used for + If the embedded message type is well-known and has a + custom JSON - packet-verification NOTE: delay period logic is only - implemented by some + representation, that representation will be embedded + adding a field - clients. - description: >- - ConnectionEnd defines a stateful object on a chain connected - to another + `value` which holds the custom JSON in addition to the + `@type` - separate one. + field. Example (for message [google.protobuf.Duration][]): - NOTE: there must only be 2 defined ConnectionEnds to establish + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: client state + description: >- + IdentifiedClientState defines a client state with an + additional client - a connection between two chains. + identifier field. proof: type: string format: byte @@ -29714,14 +31573,9 @@ paths: 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. + title: |- + QueryConnectionClientStateResponse is the response type for the + Query/ConnectionClientState RPC method default: description: An unexpected error response. schema: @@ -29909,210 +31763,197 @@ paths: } parameters: - name: connection_id - description: connection unique identifier + description: connection identifier in: path required: true type: string tags: - Query - '/ibc/core/connection/v1/connections/{connection_id}/client_state': + '/ibc/core/connection/v1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height}': get: summary: |- - ConnectionClientState queries the client state associated with the + ConnectionConsensusState queries the consensus state associated with the connection. - operationId: IbcCoreConnectionV1ConnectionClientState + operationId: IbcCoreConnectionV1ConnectionConsensusState responses: '200': description: A successful response. schema: type: object properties: - identified_client_state: - title: client state associated with the channel + consensus_state: type: object properties: - client_id: + '@type': type: string - title: client identifier - 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 + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - one "/" character. The last segment of the URL's path - must represent + protocol buffer message. This string must contain at least - the fully qualified name of the type (as in + one "/" character. The last segment of the URL's path must + represent - `path/google.protobuf.Duration`). The name should be - in a canonical form + the fully qualified name of the type (as in - (e.g., leading "." is not accepted). + `path/google.protobuf.Duration`). The name should be in a + canonical form + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary - all types that they - expect it to use in the context of Any. However, for - URLs which use the + In practice, teams usually precompile into the binary all + types that they - scheme `http`, `https`, or no scheme, one can - optionally set up a type + expect it to use in the context of Any. However, for URLs + which use the - server that maps type URLs to message definitions as - follows: + scheme `http`, `https`, or no scheme, one can optionally + set up a type + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * If no scheme is provided, `https` is assumed. - Note: this functionality is not currently available in - the official + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - protobuf release, and it is not used for type URLs - beginning with + Note: this functionality is not currently available in the + official - type.googleapis.com. + protobuf release, and it is not used for type URLs + beginning with + type.googleapis.com. - Schemes other than `http`, `https` (or the empty - scheme) might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + Schemes other than `http`, `https` (or the empty scheme) + might be - URL that describes the type of the serialized message. + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any - values in the form - of utility functions or additional generated methods of - the Any type. + Protobuf library provides support to pack/unpack Any values in + the form + of utility functions or additional generated methods of the + Any type. - Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Example 1: Pack and unpack a message in C++. - Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Example 2: Pack and unpack a message in Java. - Example 3: Pack and unpack a message in Python. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + Example 3: Pack and unpack a message in Python. - Example 4: Pack and unpack a message in Go + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + Example 4: Pack and unpack a message in Go - The pack methods provided by protobuf library will by - default use + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - 'type.googleapis.com/full.type.name' as the type URL and - the unpack + The pack methods provided by protobuf library will by default + use - methods only use the fully qualified type name after the - last '/' + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - in the type URL, for example "foo.bar.com/x/y.z" will - yield type + methods only use the fully qualified type name after the last + '/' - name "y.z". + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + name "y.z". - JSON - ==== + JSON - The JSON representation of an `Any` value uses the regular + ==== - representation of the deserialized, embedded message, with - an + The JSON representation of an `Any` value uses the regular - additional field `@type` which contains the type URL. - Example: + representation of the deserialized, embedded message, with an - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + additional field `@type` which contains the type URL. Example: - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - If the embedded message type is well-known and has a - custom JSON + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - representation, that representation will be embedded - adding a field + If the embedded message type is well-known and has a custom + JSON - `value` which holds the custom JSON in addition to the - `@type` + representation, that representation will be embedded adding a + field - field. Example (for message [google.protobuf.Duration][]): + `value` which holds the custom JSON in addition to the `@type` - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: client state - description: >- - IdentifiedClientState defines a client state with an - additional client + field. Example (for message [google.protobuf.Duration][]): - identifier field. + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: consensus state associated with the channel + client_id: + type: string + title: client ID associated with the consensus state proof: type: string format: byte @@ -30147,8 +31988,8 @@ paths: gets reset title: |- - QueryConnectionClientStateResponse is the response type for the - Query/ConnectionClientState RPC method + QueryConnectionConsensusStateResponse is the response type for the + Query/ConnectionConsensusState RPC method default: description: An unexpected error response. schema: @@ -30297,499 +32138,805 @@ paths: JSON - ==== + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the 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 +definitions: + bze.burner.v1.BurnedCoins: + type: object + properties: + burned: + type: string + height: + type: string + bze.burner.v1.MsgFundBurnerResponse: + type: object + bze.burner.v1.Params: + type: object + description: Params defines the parameters for the module. + bze.burner.v1.QueryAllBurnedCoinsResponse: + type: object + properties: + burnedCoins: + type: array + items: + type: object + properties: + burned: + type: string + height: + type: string + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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. - The JSON representation of an `Any` value uses the regular + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + bze.burner.v1.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. + 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. - representation of the deserialized, embedded message, with - an + 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 - additional field `@type` which contains the type URL. - Example: + a count of the total number of items available for pagination in UIs. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + count_total is only respected when offset is used. It is ignored when + key - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + is set. + reverse: + type: boolean + description: >- + reverse is set to true if results are to be returned in the descending + order. - If the embedded message type is well-known and has a custom - JSON - representation, that representation will be embedded adding - a field + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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. - `value` which holds the custom JSON in addition to the - `@type` + 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 - field. Example (for message [google.protobuf.Duration][]): + protocol buffer message. This string must contain at least - { - "@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: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + one "/" character. The last segment of the URL's path must represent - protocol buffer message. This string must contain at least + the fully qualified name of the type (as in - one "/" character. The last segment of the URL's path must - represent + `path/google.protobuf.Duration`). The name should be in a canonical + form - the fully qualified name of the type (as in + (e.g., leading "." is not accepted). - `path/google.protobuf.Duration`). The name should be in a - canonical form - (e.g., leading "." is not accepted). + In practice, teams usually precompile into the binary all types that + they + expect it to use in the context of Any. However, for URLs which use + the - In practice, teams usually precompile into the binary all - types that they + scheme `http`, `https`, or no scheme, one can optionally set up a type - expect it to use in the context of Any. However, for URLs - which use the + server that maps type URLs to message definitions as follows: - scheme `http`, `https`, or no scheme, one can optionally - set up a type - server that maps type URLs to message definitions as - follows: + * If no scheme is provided, `https` is assumed. + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - * If no scheme is provided, `https` is assumed. + Note: this functionality is not currently available in the official - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + protobuf release, and it is not used for type URLs beginning with - Note: this functionality is not currently available in the - official + type.googleapis.com. - protobuf release, and it is not used for type URLs - beginning with - type.googleapis.com. + Schemes other than `http`, `https` (or the empty scheme) might be + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along with + a - Schemes other than `http`, `https` (or the empty scheme) - might be + URL that describes the type of the serialized message. - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - URL that describes the type of the serialized message. + Protobuf library provides support to pack/unpack Any values in the form + of utility functions or additional generated methods of the Any type. - Protobuf library provides support to pack/unpack Any values in - the form - of utility functions or additional generated methods of the - Any type. + Example 1: Pack and unpack a message in C++. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 1: Pack and unpack a message in C++. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 2: Pack and unpack a message in Java. + Example 3: Pack and unpack a message in Python. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 3: Pack and unpack a message in Python. + Example 4: Pack and unpack a message in Go - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - Example 4: Pack and unpack a message in Go + The pack methods provided by protobuf library will by default use - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + 'type.googleapis.com/full.type.name' as the type URL and the unpack - The pack methods provided by protobuf library will by default - use + methods only use the fully qualified type name after the last '/' - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + in the type URL, for example "foo.bar.com/x/y.z" will yield type - methods only use the fully qualified type name after the last - '/' + name "y.z". - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - name "y.z". + JSON + ==== - JSON + The JSON representation of an `Any` value uses the regular - ==== + representation of the deserialized, embedded message, with an - The JSON representation of an `Any` value uses the regular + additional field `@type` which contains the type URL. Example: - representation of the deserialized, embedded message, with an + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - additional field `@type` which contains the type URL. Example: + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + If the embedded message type is well-known and has a custom JSON - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + representation, that representation will be embedded adding a field - If the embedded message type is well-known and has a custom - JSON + `value` which holds the custom JSON in addition to the `@type` - representation, that representation will be embedded adding a - field + field. Example (for message [google.protobuf.Duration][]): - `value` which holds the custom JSON in addition to the `@type` + { + "@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 - field. Example (for message [google.protobuf.Duration][]): + protocol buffer message. This string must contain at least - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: consensus state associated with the channel - 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 + one "/" character. The last segment of the URL's path must + represent - RevisionNumber the same. However some consensus algorithms may - choose to + the fully qualified name of the type (as in - reset the height in certain conditions e.g. hard forks, - state-machine + `path/google.protobuf.Duration`). The name should be in a + canonical form - breaking changes In these cases, the RevisionNumber is - incremented so that + (e.g., leading "." is not accepted). - 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 + In practice, teams usually precompile into the binary all types + that they - protocol buffer message. This string must contain at - least + expect it to use in the context of Any. However, for URLs which + use the - one "/" character. The last segment of the URL's path - must represent + scheme `http`, `https`, or no scheme, one can optionally set up + a type - the fully qualified name of the type (as in + server that maps type URLs to message definitions as follows: - `path/google.protobuf.Duration`). The name should be in - a canonical form - (e.g., leading "." is not accepted). + * If no scheme is provided, `https` is assumed. + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - In practice, teams usually precompile into the binary - all types that they + Note: this functionality is not currently available in the + official - expect it to use in the context of Any. However, for - URLs which use the + protobuf release, and it is not used for type URLs beginning + with - scheme `http`, `https`, or no scheme, one can optionally - set up a type + type.googleapis.com. - server that maps type URLs to message definitions as - follows: + Schemes other than `http`, `https` (or the empty scheme) might + be - * If no scheme is provided, `https` is assumed. + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + URL that describes the type of the serialized message. - Note: this functionality is not currently available in - the official - protobuf release, and it is not used for type URLs - beginning with + Protobuf library provides support to pack/unpack Any values in the + form - type.googleapis.com. + of utility functions or additional generated methods of the Any + type. - Schemes other than `http`, `https` (or the empty scheme) - might be + Example 1: Pack and unpack a message in C++. - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - URL that describes the type of the serialized message. + Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Protobuf library provides support to pack/unpack Any values - in the form + Example 3: Pack and unpack a message in Python. - of utility functions or additional generated methods of the - Any type. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + Example 4: Pack and unpack a message in Go - Example 1: Pack and unpack a message in C++. + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + The pack methods provided by protobuf library will by default use - Example 2: Pack and unpack a message in Java. + 'type.googleapis.com/full.type.name' as the type URL and the unpack - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + methods only use the fully qualified type name after the last '/' - Example 3: Pack and unpack a message in Python. + in the type URL, for example "foo.bar.com/x/y.z" will yield type - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + name "y.z". - Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - The pack methods provided by protobuf library will by - default use + JSON - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + ==== - methods only use the fully qualified type name after the - last '/' + The JSON representation of an `Any` value uses the regular - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + representation of the deserialized, embedded message, with an - name "y.z". + additional field `@type` which contains the type URL. Example: + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - JSON + If the embedded message type is well-known and has a custom JSON - ==== + representation, that representation will be embedded adding a field - The JSON representation of an `Any` value uses the regular + `value` which holds the custom JSON in addition to the `@type` - representation of the deserialized, embedded message, with - an + field. Example (for message [google.protobuf.Duration][]): - additional field `@type` which contains the type URL. - Example: + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + bze.cointrunk.AcceptedDomain: + type: object + properties: + domain: + type: string + active: + type: boolean + bze.cointrunk.AnonArticlesCounter: + type: object + properties: + key: + type: string + counter: + type: string + format: uint64 + bze.cointrunk.Article: + type: object + properties: + id: + type: string + format: uint64 + title: + type: string + url: + type: string + picture: + type: string + publisher: + type: string + paid: + type: boolean + createdAt: + type: string + format: int64 + bze.cointrunk.MsgAddArticleResponse: + type: object + bze.cointrunk.Params: + type: object + properties: + anonArticleLimit: + type: string + format: uint64 + anonArticleCost: + type: string + description: Params defines the parameters for the module. + bze.cointrunk.Publisher: + type: object + properties: + name: + type: string + address: + type: string + active: + type: boolean + articlesCount: + type: integer + format: int64 + createdAt: + type: string + format: int64 + bze.cointrunk.QueryAcceptedDomainResponse: + type: object + properties: + acceptedDomain: + type: array + items: + type: object + properties: + domain: + type: string + active: + type: boolean + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + 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. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + bze.cointrunk.QueryAllAnonArticlesCountersResponse: + type: object + properties: + AnonArticlesCounters: + type: array + items: + type: object + properties: + key: + type: string + counter: + type: string + format: uint64 + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - If the embedded message type is well-known and has a custom - JSON + 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. - representation, that representation will be embedded adding - a field + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + bze.cointrunk.QueryAllArticlesResponse: + type: object + properties: + article: + type: array + items: + type: object + properties: + id: + type: string + format: uint64 + title: + type: string + url: + type: string + picture: + type: string + publisher: + type: string + paid: + type: boolean + createdAt: + type: string + format: int64 + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - `value` which holds the custom JSON in addition to the - `@type` + 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. - field. Example (for message [google.protobuf.Duration][]): + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + bze.cointrunk.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + anonArticleLimit: + type: string + format: uint64 + anonArticleCost: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. + bze.cointrunk.QueryPublisherByIndexResponse: + type: object + properties: + publisher: + type: object + properties: + name: + type: string + address: + type: string + active: + type: boolean + articlesCount: + type: integer + format: int64 + createdAt: + type: string + format: int64 + bze.cointrunk.QueryPublisherResponse: + type: object + properties: + publisher: + type: array + items: + type: object + properties: + name: + type: string + address: + type: string + active: + type: boolean + articlesCount: + type: integer + format: int64 + createdAt: + type: string + format: int64 + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - { - "@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 -definitions: - bze.burner.v1.BurnedCoins: + 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; + } + bze.scavenge.Commit: type: object properties: - burned: + index: type: string - height: + solutionHash: type: string - bze.burner.v1.MsgFundBurnerResponse: + solutionScavengerHash: + type: string + bze.scavenge.MsgCommitSolutionResponse: type: object - bze.burner.v1.Params: + bze.scavenge.MsgRevealSolutionResponse: type: object - description: Params defines the parameters for the module. - bze.burner.v1.QueryAllBurnedCoinsResponse: + bze.scavenge.MsgSubmitScavengeResponse: + type: object + bze.scavenge.QueryAllCommitResponse: type: object properties: - burnedCoins: + commit: type: array items: type: object properties: - burned: + index: type: string - height: + solutionHash: + type: string + solutionScavengerHash: type: string pagination: type: object @@ -30816,251 +32963,282 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - bze.burner.v1.QueryParamsResponse: + bze.scavenge.QueryAllScavengeResponse: + type: object + properties: + scavenge: + type: array + items: + type: object + properties: + index: + type: string + solutionHash: + type: string + solution: + type: string + description: + type: string + reward: + type: string + scavenger: + type: string + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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; + } + bze.scavenge.QueryGetCommitResponse: + type: object + properties: + commit: + type: object + properties: + index: + type: string + solutionHash: + type: string + solutionScavengerHash: + type: string + bze.scavenge.QueryGetScavengeResponse: + type: object + properties: + scavenge: + type: object + properties: + index: + type: string + solutionHash: + type: string + solution: + type: string + description: + type: string + reward: + type: string + scavenger: + type: string + bze.scavenge.Scavenge: 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. - cosmos.base.query.v1beta1.PageRequest: + index: + type: string + solutionHash: + type: string + solution: + type: string + description: + type: string + reward: + type: string + scavenger: + type: string + cosmos.auth.v1beta1.Params: type: object properties: - key: + max_memo_characters: 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: + format: uint64 + tx_sig_limit: 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: + tx_size_cost_per_byte: 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: + sig_verify_cost_ed25519: type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + format: uint64 + sig_verify_cost_secp256k1: 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: + description: Params defines the parameters for the auth module. + cosmos.auth.v1beta1.QueryAccountResponse: type: object properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + 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 + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a canonical - form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary all types that - they + In practice, teams usually precompile into the binary all types + that they - expect it to use in the context of Any. However, for URLs which use - the + expect it to use in the context of Any. However, for URLs which + use the - scheme `http`, `https`, or no scheme, one can optionally set up a type + scheme `http`, `https`, or no scheme, one can optionally set up a + type - server that maps type URLs to message definitions as follows: + server that maps type URLs to message definitions as follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in the official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs beginning with + protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) might be + Schemes other than `http`, `https` (or the empty scheme) might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along with - a + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values in the form + Protobuf library provides support to pack/unpack Any values in the + form - of utility functions or additional generated methods of the Any type. + of utility functions or additional generated methods of the Any type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - The pack methods provided by protobuf library will by default use + The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the unpack + 'type.googleapis.com/full.type.name' as the type URL and the unpack - methods only use the fully qualified type name after the last '/' + methods only use the fully qualified type name after the last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type + in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". + name "y.z". - JSON + JSON - ==== + ==== - The JSON representation of an `Any` value uses the regular + The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an + representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + additional field `@type` which contains the type URL. Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If the embedded message type is well-known and has a custom JSON + If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field + representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` + `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - google.rpc.Status: + { + "@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: - code: - type: integer - format: int32 - message: - type: string - details: + accounts: type: array items: type: object @@ -31201,263 +33379,30 @@ definitions: package google.profile; message Person { string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - bze.cointrunk.AcceptedDomain: - type: object - properties: - domain: - type: string - active: - type: boolean - bze.cointrunk.AnonArticlesCounter: - type: object - properties: - key: - type: string - counter: - type: string - format: uint64 - bze.cointrunk.Article: - type: object - properties: - id: - type: string - format: uint64 - title: - type: string - url: - type: string - picture: - type: string - publisher: - type: string - paid: - type: boolean - createdAt: - type: string - format: int64 - bze.cointrunk.MsgAddArticleResponse: - type: object - bze.cointrunk.Params: - type: object - properties: - anonArticleLimit: - type: string - format: uint64 - anonArticleCost: - type: string - description: Params defines the parameters for the module. - bze.cointrunk.Publisher: - type: object - properties: - name: - type: string - address: - type: string - active: - type: boolean - articlesCount: - type: integer - format: int64 - createdAt: - type: string - format: int64 - bze.cointrunk.QueryAcceptedDomainResponse: - type: object - properties: - acceptedDomain: - type: array - items: - type: object - properties: - domain: - type: string - active: - type: boolean - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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; - } - bze.cointrunk.QueryAllAnonArticlesCountersResponse: - type: object - properties: - AnonArticlesCounters: - type: array - items: - type: object - properties: - key: - type: string - counter: - type: string - format: uint64 - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - 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; - } - bze.cointrunk.QueryAllArticlesResponse: - type: object - properties: - article: - type: array - items: - type: object - properties: - id: - type: string - format: uint64 - title: - type: string - url: - type: string - picture: - type: string - publisher: - type: string - paid: - type: boolean - createdAt: - type: string - format: int64 - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + string last_name = 2; + } - 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. + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - bze.cointrunk.QueryParamsResponse: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - anonArticleLimit: - type: string - format: uint64 - anonArticleCost: - type: string - description: QueryParamsResponse is response type for the Query/Params RPC method. - bze.cointrunk.QueryPublisherByIndexResponse: - type: object - properties: - publisher: - type: object - properties: - name: - type: string - address: - type: string - active: - type: boolean - articlesCount: - type: integer - format: int64 - createdAt: - type: string - format: int64 - bze.cointrunk.QueryPublisherResponse: - type: object - properties: - publisher: - type: array - items: - type: object - properties: - name: - type: string - address: - type: string - active: - type: boolean - articlesCount: - type: integer - format: int64 - createdAt: - type: string - format: int64 + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the 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: @@ -31474,181 +33419,372 @@ definitions: 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. + description: >- + QueryAccountsResponse is the response type for the Query/Accounts RPC + method. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - bze.scavenge.Commit: - type: object - properties: - index: - type: string - solutionHash: - type: string - solutionScavengerHash: - type: string - bze.scavenge.MsgCommitSolutionResponse: - type: object - bze.scavenge.MsgRevealSolutionResponse: - type: object - bze.scavenge.MsgSubmitScavengeResponse: - type: object - bze.scavenge.QueryAllCommitResponse: + + Since: cosmos-sdk 0.43 + cosmos.auth.v1beta1.QueryModuleAccountByNameResponse: type: object properties: - commit: - type: array - items: - type: object - properties: - index: - type: string - solutionHash: - type: string - solutionScavengerHash: - type: string - pagination: + account: type: object properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + '@type': type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular - 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. + representation of the deserialized, embedded message, with an - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - bze.scavenge.QueryAllScavengeResponse: + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the 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.QueryParamsResponse: type: object properties: - scavenge: - type: array - items: - type: object - properties: - index: - type: string - solutionHash: - type: string - solution: - type: string - description: - type: string - reward: - type: string - scavenger: - type: string - pagination: + params: + description: params defines the parameters of the module. type: object properties: - next_key: + max_memo_characters: type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + format: uint64 + tx_sig_limit: 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; - } - bze.scavenge.QueryGetCommitResponse: - type: object - properties: - commit: - type: object - properties: - index: + tx_size_cost_per_byte: type: string - solutionHash: + format: uint64 + sig_verify_cost_ed25519: type: string - solutionScavengerHash: + format: uint64 + sig_verify_cost_secp256k1: type: string - bze.scavenge.QueryGetScavengeResponse: + format: uint64 + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.authz.v1beta1.Grant: type: object properties: - scavenge: + authorization: type: object properties: - index: - type: string - solutionHash: - type: string - solution: - type: string - description: - type: string - reward: - type: string - scavenger: + '@type': type: string - bze.scavenge.Scavenge: - type: object - properties: - index: - type: string - solutionHash: - type: string - solution: - type: string - description: - type: string - reward: - type: string - scavenger: + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the 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 - cosmos.auth.v1beta1.Params: + format: date-time + description: |- + Grant gives permissions to execute + the provide method with expiration time. + cosmos.authz.v1beta1.GrantAuthorization: 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: + granter: type: string - format: uint64 - sig_verify_cost_secp256k1: + grantee: type: string - format: uint64 - description: Params defines the parameters for the auth module. - cosmos.auth.v1beta1.QueryAccountResponse: - type: object - properties: - account: + authorization: type: object properties: '@type': @@ -31801,181 +33937,435 @@ definitions: field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + description: 'Since: cosmos-sdk 0.45.2' + 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 + description: 'Since: cosmos-sdk 0.45.2' + 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 + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + 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: >- - QueryAccountResponse is the response type for the Query/Account RPC - method. - cosmos.auth.v1beta1.QueryAccountsResponse: + QueryGranteeGrantsResponse is the response type for the + Query/GranteeGrants RPC method. + cosmos.authz.v1beta1.QueryGranterGrantsResponse: type: object properties: - accounts: + grants: type: array items: type: object properties: - '@type': + granter: type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + 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 + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary all types - that they + In practice, teams usually precompile into the binary all + types that they - expect it to use in the context of Any. However, for URLs which - use the + expect it to use in the context of Any. However, for URLs + which use the - scheme `http`, `https`, or no scheme, one can optionally set up - a type + scheme `http`, `https`, or no scheme, one can optionally set + up a type - server that maps type URLs to message definitions as follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in the - official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs beginning - with + protobuf release, and it is not used for type URLs beginning + with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) might - be + Schemes other than `http`, `https` (or the empty scheme) + might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values in the - form + Protobuf library provides support to pack/unpack Any values in + the form - of utility functions or additional generated methods of the Any - type. + of utility functions or additional generated methods of the Any + type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - The pack methods provided by protobuf library will by default use + The pack methods provided by protobuf library will by default + use - 'type.googleapis.com/full.type.name' as the type URL and the unpack + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - methods only use the fully qualified type name after the last '/' + methods only use the fully qualified type name after the last + '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type + in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". + name "y.z". - JSON + JSON - ==== + ==== - The JSON representation of an `Any` value uses the regular + The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an + representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + additional field `@type` which contains the type URL. Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If the embedded message type is well-known and has a custom JSON + If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field + representation, that representation will be embedded adding a + field - `value` which holds the custom JSON in addition to the `@type` + `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: accounts are the existing accounts + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + description: 'Since: cosmos-sdk 0.45.2' + 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 the pagination in the response. + description: pagination defines an pagination for the response. type: object properties: next_key: @@ -31993,197 +34383,211 @@ definitions: 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: + QueryGranterGrantsResponse is the response type for the + Query/GranterGrants RPC method. + cosmos.authz.v1beta1.QueryGrantsResponse: type: object properties: - account: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + 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 + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary all types - that they + In practice, teams usually precompile into the binary all + types that they - expect it to use in the context of Any. However, for URLs which - use the + expect it to use in the context of Any. However, for URLs + which use the - scheme `http`, `https`, or no scheme, one can optionally set up a - type + scheme `http`, `https`, or no scheme, one can optionally set + up a type - server that maps type URLs to message definitions as follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in the - official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs beginning with + protobuf release, and it is not used for type URLs beginning + with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) might be + Schemes other than `http`, `https` (or the empty scheme) + might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values in the - form + Protobuf library provides support to pack/unpack Any values in + the form - of utility functions or additional generated methods of the Any type. + of utility functions or additional generated methods of the Any + type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - The pack methods provided by protobuf library will by default use + The pack methods provided by protobuf library will by default + use - 'type.googleapis.com/full.type.name' as the type URL and the unpack + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - methods only use the fully qualified type name after the last '/' + methods only use the fully qualified type name after the last + '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type + in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". + name "y.z". - JSON + JSON - ==== + ==== - The JSON representation of an `Any` value uses the regular + The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an + representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + additional field `@type` which contains the type URL. Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If the embedded message type is well-known and has a custom JSON + If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field + representation, that representation will be embedded adding a + field - `value` which holds the custom JSON in addition to the `@type` + `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + 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.QueryParamsResponse: - type: object - properties: - params: - description: params defines the parameters of the module. + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + 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: - 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: + next_key: type: string - format: uint64 - sig_verify_cost_secp256k1: + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: type: string format: uint64 - description: QueryParamsResponse is the response type for the Query/Params RPC method. + 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.DenomUnit: type: object properties: diff --git a/go.mod b/go.mod index 700c3ef9..f108c1ed 100644 --- a/go.mod +++ b/go.mod @@ -16,8 +16,8 @@ require ( github.com/tendermint/starport v0.19.2 github.com/tendermint/tendermint v0.34.22 github.com/tendermint/tm-db v0.6.6 - google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1 - google.golang.org/grpc v1.50.1 + google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 + google.golang.org/grpc v1.51.0 gopkg.in/errgo.v2 v2.1.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -119,10 +119,10 @@ require ( go.etcd.io/bbolt v1.3.6 // indirect golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect - golang.org/x/net v0.2.0 // indirect - golang.org/x/sys v0.2.0 // indirect - golang.org/x/term v0.2.0 // indirect - golang.org/x/text v0.4.0 // indirect + golang.org/x/net v0.3.0 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/term v0.3.0 // indirect + golang.org/x/text v0.5.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 95a7fdc5..f174aa5f 100644 --- a/go.sum +++ b/go.sum @@ -1714,8 +1714,8 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.3.0 h1:VWL6FNY2bEEmsGVKabSlHu5Irp34xmMRoqb/9lF9lxk= +golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1859,14 +1859,14 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1876,8 +1876,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2086,8 +2086,8 @@ google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaE google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1 h1:jCw9YRd2s40X9Vxi4zKsPRvSPlHWNqadVkpbMsCPzPQ= -google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 h1:jmIfw8+gSvXcZSgaFAGyInDXeWzUhvYH57G/5GKMn70= +google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 40cc1ba4..474b327f 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,18 +232,18 @@ export default { }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -262,32 +262,32 @@ export default { } } }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, @@ -304,16 +304,16 @@ export default { } } }, - async MsgRevealSolution({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index c023b54d..5f72a96b 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgCommitSolution } from "./types/scavenge/tx"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; +import { MsgCommitSolution } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], + ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), + msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), }; }; From 84ab2c154ca7200bb969ca571a27f211a45d140a Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Sat, 24 Dec 2022 00:24:15 +0200 Subject: [PATCH 40/54] added v1 to cointrunk routes --- proto/cointrunk/query.proto | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/proto/cointrunk/query.proto b/proto/cointrunk/query.proto index 29b11d9f..8d38cc86 100644 --- a/proto/cointrunk/query.proto +++ b/proto/cointrunk/query.proto @@ -17,31 +17,31 @@ option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; service Query { // Parameters queries the parameters of the module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/bze/cointrunk/params"; + option (google.api.http).get = "/bze/cointrunk/v1/params"; } // Queries a list of AcceptedDomain items. rpc AcceptedDomain(QueryAcceptedDomainRequest) returns (QueryAcceptedDomainResponse) { - option (google.api.http).get = "/bze/cointrunk/accepted_domain"; + option (google.api.http).get = "/bze/cointrunk/v1/accepted_domain"; } // Queries a list of Publisher items. rpc Publisher(QueryPublisherRequest) returns (QueryPublisherResponse) { - option (google.api.http).get = "/bze/cointrunk/publishers"; + option (google.api.http).get = "/bze/cointrunk/v1/publishers"; } // Queries publisher by index/address. rpc PublisherByIndex(QueryPublisherByIndexRequest) returns (QueryPublisherByIndexResponse) { - option (google.api.http).get = "/bze/cointrunk/publisher/{index}"; + option (google.api.http).get = "/bze/cointrunk/v1/publisher/{index}"; } // Queries a list of ArticlesByPrefix items. rpc AllArticles(QueryAllArticlesRequest) returns (QueryAllArticlesResponse) { - option (google.api.http).get = "/bze/cointrunk/all_articles"; + option (google.api.http).get = "/bze/cointrunk/v1/articles"; } // Queries a list of AllAnonArticlesCounters items. rpc AllAnonArticlesCounters(QueryAllAnonArticlesCountersRequest) returns (QueryAllAnonArticlesCountersResponse) { - option (google.api.http).get = "/bze/cointrunk/all_anon_articles_counters"; + option (google.api.http).get = "/bze/cointrunk/v1/all_anon_articles_counters"; } // this line is used by starport scaffolding # 2 From a9bcdb5918fac9293ea0a0c1d5171ec32672f751 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Sat, 24 Dec 2022 01:17:46 +0200 Subject: [PATCH 41/54] modified cointrunk param from string to sdk coin --- config.yml | 4 +- docs/static/openapi.yml | 78 +++-- proto/cointrunk/params.proto | 7 +- testutil/keeper/cointrunk.go | 1 + .../bze/bze.cointrunk/module/rest.ts | 44 ++- .../module/types/cointrunk/params.ts | 23 +- .../module/types/cosmos/base/v1beta1/coin.ts | 301 ++++++++++++++++++ .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +- .../bze/bze.scavenge/module/index.ts | 12 +- x/cointrunk/keeper/msg_server_add_article.go | 6 +- x/cointrunk/keeper/params.go | 2 +- x/cointrunk/types/params.go | 23 +- x/cointrunk/types/params.pb.go | 74 +++-- x/cointrunk/types/query.pb.go | 100 +++--- x/cointrunk/types/query.pb.gw.go | 12 +- 15 files changed, 545 insertions(+), 174 deletions(-) create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cosmos/base/v1beta1/coin.ts diff --git a/config.yml b/config.yml index a7b3b0d8..1f14a3c8 100644 --- a/config.yml +++ b/config.yml @@ -36,4 +36,6 @@ genesis: cointrunk: params: anonArticleLimit: 5 - anonArticleCost: "25000000000utestbze" \ No newline at end of file + anonArticleCost: + denom: "utestbze" + amount: "25000000000" \ No newline at end of file diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 327786b8..01f4630a 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -162,7 +162,7 @@ paths: additionalProperties: {} tags: - Query - /bze/cointrunk/accepted_domain: + /bze/cointrunk/v1/accepted_domain: get: summary: Queries a list of AcceptedDomain items. operationId: BzeCointrunkAcceptedDomain @@ -285,7 +285,7 @@ paths: type: boolean tags: - Query - /bze/cointrunk/all_anon_articles_counters: + /bze/cointrunk/v1/all_anon_articles_counters: get: summary: Queries a list of AllAnonArticlesCounters items. operationId: BzeCointrunkAllAnonArticlesCounters @@ -409,7 +409,7 @@ paths: type: boolean tags: - Query - /bze/cointrunk/all_articles: + /bze/cointrunk/v1/articles: get: summary: Queries a list of ArticlesByPrefix items. operationId: BzeCointrunkAllArticles @@ -544,7 +544,7 @@ paths: type: boolean tags: - Query - /bze/cointrunk/params: + /bze/cointrunk/v1/params: get: summary: Parameters queries the parameters of the module. operationId: BzeCointrunkParams @@ -562,7 +562,20 @@ paths: type: string format: uint64 anonArticleCost: - type: string + 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: >- QueryParamsResponse is response type for the Query/Params RPC method. @@ -586,7 +599,7 @@ paths: additionalProperties: {} tags: - Query - '/bze/cointrunk/publisher/{index}': + '/bze/cointrunk/v1/publisher/{index}': get: summary: Queries publisher by index/address. operationId: BzeCointrunkPublisherByIndex @@ -636,7 +649,7 @@ paths: type: string tags: - Query - /bze/cointrunk/publishers: + /bze/cointrunk/v1/publishers: get: summary: Queries a list of Publisher items. operationId: BzeCointrunkPublisher @@ -32692,7 +32705,17 @@ definitions: type: string format: uint64 anonArticleCost: - type: string + 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: Params defines the parameters for the module. bze.cointrunk.Publisher: type: object @@ -32844,7 +32867,20 @@ definitions: type: string format: uint64 anonArticleCost: - type: string + 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: QueryParamsResponse is response type for the Query/Params RPC method. bze.cointrunk.QueryPublisherByIndexResponse: type: object @@ -32909,6 +32945,18 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + 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. bze.scavenge.Commit: type: object properties: @@ -35117,18 +35165,6 @@ definitions: 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.tendermint.v1beta1.GetBlockByHeightResponse: type: object properties: diff --git a/proto/cointrunk/params.proto b/proto/cointrunk/params.proto index 7cbde734..7755f315 100644 --- a/proto/cointrunk/params.proto +++ b/proto/cointrunk/params.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package bze.cointrunk; import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; @@ -10,5 +11,9 @@ message Params { option (gogoproto.goproto_stringer) = false; uint64 anonArticleLimit = 1 [(gogoproto.moretags) = "yaml:\"anon_article_limit\""]; - string anonArticleCost = 2 [(gogoproto.moretags) = "yaml:\"anon_article_cost\""]; + cosmos.base.v1beta1.Coin anonArticleCost = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"anon_article_cost\"", + (gogoproto.jsontag) = "anon_article_cost,omitempty" + ]; } \ No newline at end of file diff --git a/testutil/keeper/cointrunk.go b/testutil/keeper/cointrunk.go index 22effda4..1f8986de 100644 --- a/testutil/keeper/cointrunk.go +++ b/testutil/keeper/cointrunk.go @@ -43,6 +43,7 @@ func CointrunkKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { paramsSubspace, nil, nil, + nil, ) ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts index 87f7f430..fd610052 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts @@ -42,7 +42,14 @@ export type CointrunkMsgAddArticleResponse = object; export interface CointrunkParams { /** @format uint64 */ anonArticleLimit?: string; - anonArticleCost?: string; + + /** + * 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. + */ + anonArticleCost?: V1Beta1Coin; } export interface CointrunkPublisher { @@ -140,6 +147,17 @@ export interface RpcStatus { details?: ProtobufAny[]; } +/** +* 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. +*/ +export interface V1Beta1Coin { + denom?: string; + amount?: string; +} + /** * message SomeRequest { Foo some_parameter = 1; @@ -405,7 +423,7 @@ export class Api extends HttpClient extends HttpClient this.request({ - path: `/bze/cointrunk/accepted_domain`, + path: `/bze/cointrunk/v1/accepted_domain`, method: "GET", query: query, format: "json", @@ -431,7 +449,7 @@ export class Api extends HttpClient extends HttpClient this.request({ - path: `/bze/cointrunk/all_anon_articles_counters`, + path: `/bze/cointrunk/v1/all_anon_articles_counters`, method: "GET", query: query, format: "json", @@ -457,7 +475,7 @@ export class Api extends HttpClient extends HttpClient this.request({ - path: `/bze/cointrunk/all_articles`, + path: `/bze/cointrunk/v1/articles`, method: "GET", query: query, format: "json", @@ -483,11 +501,11 @@ export class Api extends HttpClient this.request({ - path: `/bze/cointrunk/params`, + path: `/bze/cointrunk/v1/params`, method: "GET", format: "json", ...params, @@ -499,11 +517,11 @@ export class Api extends HttpClient this.request({ - path: `/bze/cointrunk/publisher/${index}`, + path: `/bze/cointrunk/v1/publisher/${index}`, method: "GET", format: "json", ...params, @@ -515,7 +533,7 @@ export class Api extends HttpClient extends HttpClient this.request({ - path: `/bze/cointrunk/publishers`, + path: `/bze/cointrunk/v1/publishers`, method: "GET", query: query, format: "json", diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/params.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/params.ts index 321d5a99..4d159a9e 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/params.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/params.ts @@ -1,24 +1,25 @@ /* eslint-disable */ import * as Long from "long"; import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import { Coin } from "../cosmos/base/v1beta1/coin"; export const protobufPackage = "bze.cointrunk"; /** Params defines the parameters for the module. */ export interface Params { anonArticleLimit: number; - anonArticleCost: string; + anonArticleCost: Coin | undefined; } -const baseParams: object = { anonArticleLimit: 0, anonArticleCost: "" }; +const baseParams: object = { anonArticleLimit: 0 }; export const Params = { encode(message: Params, writer: Writer = Writer.create()): Writer { if (message.anonArticleLimit !== 0) { writer.uint32(8).uint64(message.anonArticleLimit); } - if (message.anonArticleCost !== "") { - writer.uint32(18).string(message.anonArticleCost); + if (message.anonArticleCost !== undefined) { + Coin.encode(message.anonArticleCost, writer.uint32(18).fork()).ldelim(); } return writer; }, @@ -34,7 +35,7 @@ export const Params = { message.anonArticleLimit = longToNumber(reader.uint64() as Long); break; case 2: - message.anonArticleCost = reader.string(); + message.anonArticleCost = Coin.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -58,9 +59,9 @@ export const Params = { object.anonArticleCost !== undefined && object.anonArticleCost !== null ) { - message.anonArticleCost = String(object.anonArticleCost); + message.anonArticleCost = Coin.fromJSON(object.anonArticleCost); } else { - message.anonArticleCost = ""; + message.anonArticleCost = undefined; } return message; }, @@ -70,7 +71,9 @@ export const Params = { message.anonArticleLimit !== undefined && (obj.anonArticleLimit = message.anonArticleLimit); message.anonArticleCost !== undefined && - (obj.anonArticleCost = message.anonArticleCost); + (obj.anonArticleCost = message.anonArticleCost + ? Coin.toJSON(message.anonArticleCost) + : undefined); return obj; }, @@ -88,9 +91,9 @@ export const Params = { object.anonArticleCost !== undefined && object.anonArticleCost !== null ) { - message.anonArticleCost = object.anonArticleCost; + message.anonArticleCost = Coin.fromPartial(object.anonArticleCost); } else { - message.anonArticleCost = ""; + message.anonArticleCost = undefined; } return message; }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cosmos/base/v1beta1/coin.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cosmos/base/v1beta1/coin.ts new file mode 100644 index 00000000..ce2ac984 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,301 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.v1beta1"; + +/** + * 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. + */ +export interface Coin { + denom: string; + amount: string; +} + +/** + * 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. + */ +export interface DecCoin { + denom: string; + amount: string; +} + +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProto { + int: string; +} + +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProto { + dec: string; +} + +const baseCoin: object = { denom: "", amount: "" }; + +export const Coin = { + encode(message: Coin, writer: Writer = Writer.create()): Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Coin { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCoin } as Coin; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Coin { + const message = { ...baseCoin } as Coin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + return message; + }, + + toJSON(message: Coin): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, + + fromPartial(object: DeepPartial): Coin { + const message = { ...baseCoin } as Coin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + return message; + }, +}; + +const baseDecCoin: object = { denom: "", amount: "" }; + +export const DecCoin = { + encode(message: DecCoin, writer: Writer = Writer.create()): Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DecCoin { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDecCoin } as DecCoin; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DecCoin { + const message = { ...baseDecCoin } as DecCoin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + return message; + }, + + toJSON(message: DecCoin): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, + + fromPartial(object: DeepPartial): DecCoin { + const message = { ...baseDecCoin } as DecCoin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + return message; + }, +}; + +const baseIntProto: object = { int: "" }; + +export const IntProto = { + encode(message: IntProto, writer: Writer = Writer.create()): Writer { + if (message.int !== "") { + writer.uint32(10).string(message.int); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): IntProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseIntProto } as IntProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.int = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IntProto { + const message = { ...baseIntProto } as IntProto; + if (object.int !== undefined && object.int !== null) { + message.int = String(object.int); + } else { + message.int = ""; + } + return message; + }, + + toJSON(message: IntProto): unknown { + const obj: any = {}; + message.int !== undefined && (obj.int = message.int); + return obj; + }, + + fromPartial(object: DeepPartial): IntProto { + const message = { ...baseIntProto } as IntProto; + if (object.int !== undefined && object.int !== null) { + message.int = object.int; + } else { + message.int = ""; + } + return message; + }, +}; + +const baseDecProto: object = { dec: "" }; + +export const DecProto = { + encode(message: DecProto, writer: Writer = Writer.create()): Writer { + if (message.dec !== "") { + writer.uint32(10).string(message.dec); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DecProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDecProto } as DecProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dec = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DecProto { + const message = { ...baseDecProto } as DecProto; + if (object.dec !== undefined && object.dec !== null) { + message.dec = String(object.dec); + } else { + message.dec = ""; + } + return message; + }, + + toJSON(message: DecProto): unknown { + const obj: any = {}; + message.dec !== undefined && (obj.dec = message.dec); + return obj; + }, + + fromPartial(object: DeepPartial): DecProto { + const message = { ...baseDecProto } as DecProto; + if (object.dec !== undefined && object.dec !== null) { + message.dec = object.dec; + } else { + message.dec = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 474b327f..40cc1ba4 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,18 +232,18 @@ export default { }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -262,32 +262,32 @@ export default { } } }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgRevealSolution({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, @@ -304,16 +304,16 @@ export default { } } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgRevealSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 5f72a96b..c023b54d 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgRevealSolution } from "./types/scavenge/tx"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; +import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/keeper/msg_server_add_article.go b/x/cointrunk/keeper/msg_server_add_article.go index 42da388e..b488384a 100644 --- a/x/cointrunk/keeper/msg_server_add_article.go +++ b/x/cointrunk/keeper/msg_server_add_article.go @@ -24,11 +24,7 @@ func (k msgServer) AddArticle(goCtx context.Context, msg *types.MsgAddArticle) ( return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Paid article limit reached for current period") } - articleCost, err := sdk.ParseCoinsNormalized(k.AnonArticleCost(ctx)) - if err != nil { - panic(err) - } - + articleCost := sdk.NewCoins(k.AnonArticleCost(ctx)) publisherAcc, err := sdk.AccAddressFromBech32(msg.Publisher) if err != nil { panic(err) diff --git a/x/cointrunk/keeper/params.go b/x/cointrunk/keeper/params.go index f8e0411e..8d08a19a 100644 --- a/x/cointrunk/keeper/params.go +++ b/x/cointrunk/keeper/params.go @@ -25,7 +25,7 @@ func (k Keeper) AnonArticleLimit(ctx sdk.Context) (res uint64) { } // AnonArticleCost returns the AnonArticleCost param -func (k Keeper) AnonArticleCost(ctx sdk.Context) (res string) { +func (k Keeper) AnonArticleCost(ctx sdk.Context) (res sdk.Coin) { k.paramstore.Get(ctx, types.KeyAnonArticleCost, &res) return } diff --git a/x/cointrunk/types/params.go b/x/cointrunk/types/params.go index c66b7a1a..d769f2a6 100644 --- a/x/cointrunk/types/params.go +++ b/x/cointrunk/types/params.go @@ -3,21 +3,25 @@ package types import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" ) var _ paramtypes.ParamSet = (*Params)(nil) +const ( + DefaultDenom = "ubze" + DefaultAnonArticleCostAmount = 25000000000 +) + var ( KeyAnonArticleLimit = []byte("AnonArticleLimit") DefaultAnonArticleLimit uint64 = 5 ) var ( - KeyAnonArticleCost = []byte("AnonArticleCost") - DefaultAnonArticleCost string = "50000000000ubze" + KeyAnonArticleCost = []byte("AnonArticleCost") + DefaultAnonArticleCost = sdk.NewCoin(DefaultDenom, sdk.NewInt(DefaultAnonArticleCostAmount)) ) // ParamKeyTable the param key table for launch module @@ -28,7 +32,7 @@ func ParamKeyTable() paramtypes.KeyTable { // NewParams creates a new Params instance func NewParams( anonArticleLimit uint64, - anonArticleCost string, + anonArticleCost sdk.Coin, ) Params { return Params{ AnonArticleLimit: anonArticleLimit, @@ -88,16 +92,13 @@ func validateAnonArticleLimit(v interface{}) error { // validateAnonArticleCost validates the AnonArticleCost param func validateAnonArticleCost(v interface{}) error { - anonArticleCost, ok := v.(string) + anonArticleCost, ok := v.(sdk.Coin) if !ok { - return fmt.Errorf("invalid parameter type: %T", v) + return fmt.Errorf("invalid parameter anonArticleLimit type: %T", v) } - - _, err := sdk.ParseCoinsNormalized(anonArticleCost) - if err != nil { - return err + if !anonArticleCost.IsValid() { + return fmt.Errorf("invalid anonArticleLimit coin: %s", anonArticleCost.String()) } - _ = anonArticleCost return nil } diff --git a/x/cointrunk/types/params.pb.go b/x/cointrunk/types/params.pb.go index f211fe5e..eb02d6f3 100644 --- a/x/cointrunk/types/params.pb.go +++ b/x/cointrunk/types/params.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" @@ -25,8 +26,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { - AnonArticleLimit uint64 `protobuf:"varint,1,opt,name=anonArticleLimit,proto3" json:"anonArticleLimit,omitempty" yaml:"anon_article_limit"` - AnonArticleCost string `protobuf:"bytes,2,opt,name=anonArticleCost,proto3" json:"anonArticleCost,omitempty" yaml:"anon_article_cost"` + AnonArticleLimit uint64 `protobuf:"varint,1,opt,name=anonArticleLimit,proto3" json:"anonArticleLimit,omitempty" yaml:"anon_article_limit"` + AnonArticleCost types.Coin `protobuf:"bytes,2,opt,name=anonArticleCost,proto3" json:"anon_article_cost,omitempty" yaml:"anon_article_cost"` } func (m *Params) Reset() { *m = Params{} } @@ -68,11 +69,11 @@ func (m *Params) GetAnonArticleLimit() uint64 { return 0 } -func (m *Params) GetAnonArticleCost() string { +func (m *Params) GetAnonArticleCost() types.Coin { if m != nil { return m.AnonArticleCost } - return "" + return types.Coin{} } func init() { @@ -82,22 +83,27 @@ func init() { func init() { proto.RegisterFile("cointrunk/params.proto", fileDescriptor_f29b1ecdb66bf452) } var fileDescriptor_f29b1ecdb66bf452 = []byte{ - // 238 bytes of a gzipped FileDescriptorProto + // 305 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4b, 0xce, 0xcf, 0xcc, 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0xcb, 0x49, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, - 0x83, 0x65, 0xf4, 0x41, 0x2c, 0x88, 0x22, 0xa5, 0x85, 0x8c, 0x5c, 0x6c, 0x01, 0x60, 0x5d, 0x42, - 0x9e, 0x5c, 0x02, 0x89, 0x79, 0xf9, 0x79, 0x8e, 0x45, 0x25, 0x99, 0xc9, 0x39, 0xa9, 0x3e, 0x99, - 0xb9, 0x99, 0x25, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x2c, 0x4e, 0xb2, 0x9f, 0xee, 0xc9, 0x4b, 0x56, - 0x26, 0xe6, 0xe6, 0x58, 0x29, 0x81, 0x54, 0xc4, 0x27, 0x42, 0x94, 0xc4, 0xe7, 0x80, 0xd4, 0x28, - 0x05, 0x61, 0x68, 0x13, 0x72, 0xe3, 0xe2, 0x47, 0x12, 0x73, 0xce, 0x2f, 0x2e, 0x91, 0x60, 0x52, - 0x60, 0xd4, 0xe0, 0x74, 0x92, 0xf9, 0x74, 0x4f, 0x5e, 0x02, 0x8b, 0x49, 0xc9, 0xf9, 0xc5, 0x25, - 0x4a, 0x41, 0xe8, 0x9a, 0xac, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0xf2, 0x38, 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, 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, - 0xfc, 0x5c, 0xfd, 0xa4, 0xaa, 0x54, 0xdd, 0xc4, 0x9c, 0x82, 0x8c, 0xc4, 0x92, 0xd4, 0x44, 0x30, - 0x4f, 0xbf, 0x42, 0x1f, 0x11, 0x32, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x4f, 0x1b, - 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x25, 0x0c, 0x6d, 0x6e, 0x33, 0x01, 0x00, 0x00, + 0x83, 0x65, 0xf4, 0x41, 0x2c, 0x88, 0x22, 0x29, 0xb9, 0xe4, 0xfc, 0xe2, 0xdc, 0xfc, 0x62, 0xfd, + 0xa4, 0xc4, 0xe2, 0x54, 0xfd, 0x32, 0xc3, 0xa4, 0xd4, 0x92, 0x44, 0x43, 0x7d, 0x90, 0x26, 0x88, + 0xbc, 0xd2, 0x03, 0x46, 0x2e, 0xb6, 0x00, 0xb0, 0xa9, 0x42, 0x9e, 0x5c, 0x02, 0x89, 0x79, 0xf9, + 0x79, 0x8e, 0x45, 0x25, 0x99, 0xc9, 0x39, 0xa9, 0x3e, 0x99, 0xb9, 0x99, 0x25, 0x12, 0x8c, 0x0a, + 0x8c, 0x1a, 0x2c, 0x4e, 0xb2, 0x9f, 0xee, 0xc9, 0x4b, 0x56, 0x26, 0xe6, 0xe6, 0x58, 0x29, 0x81, + 0x54, 0xc4, 0x27, 0x42, 0x94, 0xc4, 0xe7, 0x80, 0xd4, 0x28, 0x05, 0x61, 0x68, 0x13, 0x6a, 0x61, + 0xe4, 0xe2, 0x47, 0x12, 0x74, 0xce, 0x2f, 0x2e, 0x91, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x36, 0x92, + 0xd4, 0x83, 0x38, 0x48, 0x0f, 0xe4, 0x20, 0x3d, 0xa8, 0x83, 0xf4, 0x9c, 0xf3, 0x33, 0xf3, 0x9c, + 0xec, 0x4f, 0xdc, 0x93, 0x67, 0x78, 0x75, 0x4f, 0x5e, 0x1a, 0xc5, 0x8e, 0xe4, 0xfc, 0xe2, 0x12, + 0x9d, 0xfc, 0xdc, 0xcc, 0x92, 0xd4, 0xdc, 0x82, 0x92, 0xca, 0x4f, 0xf7, 0xe4, 0x25, 0xb0, 0x38, + 0x04, 0xa4, 0x48, 0x29, 0x08, 0xdd, 0x4a, 0x2b, 0x96, 0x19, 0x0b, 0xe4, 0x19, 0x9c, 0x3c, 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, 0x4a, 0x2f, 0x3d, 0xb3, 0x24, 0xa3, 0x34, + 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0xa9, 0x2a, 0x55, 0x37, 0x31, 0xa7, 0x20, 0x23, 0xb1, 0x24, + 0x35, 0x11, 0xcc, 0xd3, 0xaf, 0xd0, 0x47, 0x04, 0x7c, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, + 0x38, 0xcc, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x03, 0x5f, 0xd2, 0x92, 0x01, 0x00, + 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -120,13 +126,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.AnonArticleCost) > 0 { - i -= len(m.AnonArticleCost) - copy(dAtA[i:], m.AnonArticleCost) - i = encodeVarintParams(dAtA, i, uint64(len(m.AnonArticleCost))) - i-- - dAtA[i] = 0x12 + { + size, err := m.AnonArticleCost.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 if m.AnonArticleLimit != 0 { i = encodeVarintParams(dAtA, i, uint64(m.AnonArticleLimit)) i-- @@ -155,10 +164,8 @@ func (m *Params) Size() (n int) { if m.AnonArticleLimit != 0 { n += 1 + sovParams(uint64(m.AnonArticleLimit)) } - l = len(m.AnonArticleCost) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } + l = m.AnonArticleCost.Size() + n += 1 + l + sovParams(uint64(l)) return n } @@ -220,7 +227,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AnonArticleCost", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowParams @@ -230,23 +237,24 @@ func (m *Params) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthParams } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthParams } if postIndex > l { return io.ErrUnexpectedEOF } - m.AnonArticleCost = string(dAtA[iNdEx:postIndex]) + if err := m.AnonArticleCost.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/cointrunk/types/query.pb.go b/x/cointrunk/types/query.pb.go index 9b4d9579..8fc32b4c 100644 --- a/x/cointrunk/types/query.pb.go +++ b/x/cointrunk/types/query.pb.go @@ -603,56 +603,56 @@ func init() { func init() { proto.RegisterFile("cointrunk/query.proto", fileDescriptor_12b6eb50b0e9fa00) } var fileDescriptor_12b6eb50b0e9fa00 = []byte{ - // 769 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x4b, 0x6f, 0xd3, 0x4a, - 0x14, 0xc7, 0x33, 0xbd, 0xb7, 0xb9, 0xea, 0xa9, 0x6e, 0x75, 0x35, 0x37, 0x69, 0x52, 0xb7, 0x49, - 0x53, 0xf7, 0xdd, 0x82, 0xad, 0xa6, 0x88, 0x15, 0x9b, 0x16, 0xc4, 0x73, 0x53, 0xb2, 0x44, 0xa0, - 0x68, 0x92, 0x8c, 0x52, 0x0b, 0xc7, 0xe3, 0xc6, 0x0e, 0xea, 0x43, 0x6c, 0xe0, 0x03, 0x80, 0xc4, - 0x82, 0x05, 0x0b, 0x3e, 0x04, 0xe2, 0x3b, 0x74, 0x83, 0x54, 0x89, 0x0d, 0xab, 0x0a, 0xb5, 0x7c, - 0x10, 0x94, 0xf1, 0x71, 0x12, 0x4f, 0x9c, 0x3e, 0x50, 0x76, 0x71, 0xce, 0xeb, 0x77, 0xfe, 0x67, - 0xe6, 0xd8, 0x90, 0xae, 0x0a, 0xcb, 0xf1, 0x9b, 0x2d, 0xe7, 0xa5, 0xb9, 0xd7, 0xe2, 0xcd, 0x03, - 0xc3, 0x6d, 0x0a, 0x5f, 0xd0, 0x7f, 0x2b, 0x87, 0xdc, 0xe8, 0x98, 0xb4, 0x54, 0x5d, 0xd4, 0x85, - 0xb4, 0x98, 0xed, 0x5f, 0x81, 0x93, 0x36, 0x53, 0x17, 0xa2, 0x6e, 0x73, 0x93, 0xb9, 0x96, 0xc9, - 0x1c, 0x47, 0xf8, 0xcc, 0xb7, 0x84, 0xe3, 0xa1, 0x75, 0xad, 0x2a, 0xbc, 0x86, 0xf0, 0xcc, 0x0a, - 0xf3, 0x78, 0x90, 0xdb, 0x7c, 0xb5, 0x51, 0xe1, 0x3e, 0xdb, 0x30, 0x5d, 0x56, 0xb7, 0x1c, 0xe9, - 0x8c, 0xbe, 0x93, 0x5d, 0x0a, 0x97, 0x35, 0x59, 0x23, 0xcc, 0x31, 0xdb, 0xfd, 0x9f, 0x55, 0xab, - 0xdc, 0xf5, 0x79, 0xad, 0x5c, 0x13, 0x0d, 0x66, 0x85, 0x81, 0x53, 0x3d, 0x81, 0xad, 0x8a, 0x6d, - 0x79, 0xbb, 0xbc, 0x89, 0xa6, 0x4c, 0x4f, 0x6c, 0xd3, 0xb7, 0xaa, 0x36, 0x47, 0xc3, 0x62, 0x8f, - 0xc1, 0x11, 0x4e, 0x19, 0xad, 0x5e, 0xb9, 0x2a, 0x5a, 0x8e, 0x1f, 0xc6, 0xeb, 0x29, 0xa0, 0x4f, - 0xdb, 0xd4, 0x3b, 0x12, 0xa8, 0xc4, 0xf7, 0x5a, 0xdc, 0xf3, 0xf5, 0xc7, 0xf0, 0x7f, 0xe4, 0x5f, - 0xcf, 0x15, 0x8e, 0xc7, 0xe9, 0x26, 0x24, 0x03, 0xf0, 0x2c, 0x29, 0x90, 0x95, 0xf1, 0x62, 0xda, - 0x88, 0x08, 0x68, 0x04, 0xee, 0xdb, 0x7f, 0x1f, 0x9f, 0xce, 0x26, 0x4a, 0xe8, 0xaa, 0xd7, 0x40, - 0x93, 0xb9, 0xb6, 0xb0, 0xb5, 0x7b, 0xb2, 0x33, 0xac, 0x44, 0xef, 0x03, 0x74, 0x75, 0xc2, 0xb4, - 0x4b, 0x46, 0x20, 0xaa, 0xd1, 0x16, 0xd5, 0x08, 0x06, 0x86, 0xa2, 0x1a, 0x3b, 0xac, 0xce, 0x31, - 0xb6, 0xd4, 0x13, 0xa9, 0x7f, 0x21, 0x30, 0x1d, 0x5b, 0x06, 0xd1, 0x9f, 0xc0, 0x04, 0x8b, 0x58, - 0xb2, 0xa4, 0xf0, 0xd7, 0xca, 0x78, 0x31, 0xa7, 0xb4, 0x10, 0x0d, 0xc7, 0x56, 0x94, 0x50, 0xfa, - 0x20, 0x02, 0x3d, 0x22, 0xa1, 0x97, 0x2f, 0x85, 0x0e, 0x48, 0x22, 0xd4, 0x65, 0x48, 0x07, 0x3a, - 0x87, 0x53, 0x1d, 0xb6, 0x2c, 0x9f, 0x09, 0x4c, 0xaa, 0x15, 0x50, 0x91, 0x3b, 0x30, 0xd6, 0x39, - 0x4c, 0x28, 0x46, 0x56, 0x9d, 0x67, 0x68, 0x47, 0x1d, 0xba, 0x01, 0xc3, 0x93, 0xe0, 0x16, 0xcc, - 0x44, 0x01, 0xb7, 0x0f, 0x1e, 0x39, 0x35, 0xbe, 0x1f, 0x2a, 0x91, 0x82, 0x51, 0xab, 0xfd, 0x2c, - 0x45, 0x18, 0x2b, 0x05, 0x0f, 0xfa, 0x0b, 0xc8, 0x0d, 0x88, 0x8a, 0xef, 0x8e, 0x5c, 0xab, 0x3b, - 0x9d, 0x41, 0x26, 0x38, 0x4c, 0xb6, 0xbd, 0x85, 0xf7, 0x26, 0x7e, 0x32, 0x23, 0x7f, 0x3c, 0x99, - 0x4f, 0x04, 0xb2, 0xfd, 0x35, 0x90, 0xfe, 0x36, 0xfc, 0x83, 0xf7, 0x15, 0x27, 0x33, 0xa9, 0x1e, - 0xd3, 0xc0, 0x8a, 0xe4, 0xa1, 0xf3, 0xf0, 0xa6, 0xd2, 0x80, 0xf9, 0x0e, 0x9c, 0x23, 0x9c, 0x10, - 0xf0, 0x6e, 0xb0, 0x3b, 0xbc, 0x61, 0x1f, 0xd3, 0x6f, 0x04, 0x16, 0x2e, 0xae, 0x87, 0xc2, 0x3c, - 0x87, 0x54, 0x9c, 0x1d, 0x55, 0xd2, 0x55, 0x95, 0xfa, 0x5d, 0x51, 0xb1, 0xd8, 0x2c, 0x43, 0x93, - 0xaf, 0x78, 0x9a, 0x84, 0x51, 0xd9, 0x0f, 0x75, 0x20, 0x19, 0x6c, 0x45, 0x3a, 0xa7, 0xc0, 0xf5, - 0xaf, 0x5d, 0x4d, 0xbf, 0xc8, 0x25, 0x28, 0xa3, 0xe7, 0xde, 0x7c, 0xff, 0xf5, 0x61, 0x24, 0x43, - 0xd3, 0x66, 0xe5, 0x90, 0x9b, 0xea, 0x1b, 0x85, 0xbe, 0x23, 0x30, 0x11, 0xdd, 0x61, 0x74, 0x35, - 0x2e, 0x6b, 0xec, 0x36, 0xd6, 0xd6, 0xae, 0xe2, 0x8a, 0x20, 0x4b, 0x12, 0xa4, 0x40, 0xf3, 0x0a, - 0x88, 0xf2, 0x0a, 0xa3, 0x47, 0x30, 0xd6, 0xb9, 0x69, 0x74, 0x21, 0xb6, 0x43, 0x65, 0xfb, 0x69, - 0x8b, 0x97, 0x78, 0x21, 0xc1, 0x9c, 0x24, 0x98, 0xa6, 0x53, 0xaa, 0x14, 0xa1, 0xa7, 0x47, 0x3f, - 0x12, 0xf8, 0x4f, 0xdd, 0x11, 0x74, 0xfd, 0xc2, 0xf4, 0xd1, 0xfd, 0xa3, 0xdd, 0xb8, 0x9a, 0x33, - 0x22, 0xad, 0x48, 0x24, 0x9d, 0x16, 0x06, 0x21, 0x99, 0x47, 0x72, 0x81, 0xbd, 0xa6, 0x6f, 0x09, - 0x8c, 0xf7, 0x5c, 0x7d, 0xba, 0x14, 0x2b, 0x7d, 0xdf, 0xfe, 0xd1, 0x96, 0x2f, 0xf5, 0x43, 0x94, - 0x79, 0x89, 0x92, 0xa3, 0xd3, 0xea, 0x7c, 0x6c, 0xbb, 0xf3, 0x31, 0x40, 0xbf, 0x12, 0xc8, 0x0c, - 0xb8, 0x73, 0xb4, 0x38, 0xa8, 0xd2, 0xe0, 0x85, 0xa0, 0x6d, 0x5e, 0x2b, 0x06, 0x49, 0x37, 0x24, - 0xe9, 0x3a, 0x5d, 0x8d, 0x23, 0x8d, 0xfb, 0x76, 0xf1, 0xb6, 0x1f, 0x1e, 0x9f, 0xe5, 0xc9, 0xc9, - 0x59, 0x9e, 0xfc, 0x3c, 0xcb, 0x93, 0xf7, 0xe7, 0xf9, 0xc4, 0xc9, 0x79, 0x3e, 0xf1, 0xe3, 0x3c, - 0x9f, 0x78, 0x66, 0xd4, 0x2d, 0x7f, 0xb7, 0x55, 0x31, 0xaa, 0xa2, 0xd1, 0x4e, 0x77, 0x93, 0xd9, - 0xee, 0x2e, 0xf3, 0x39, 0x93, 0x4f, 0xe6, 0x7e, 0x4f, 0x7a, 0xff, 0xc0, 0xe5, 0x5e, 0x25, 0x29, - 0xbf, 0x83, 0x36, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x07, 0x8e, 0x2f, 0x50, 0x23, 0x0a, 0x00, - 0x00, + // 770 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcd, 0x4e, 0x13, 0x51, + 0x14, 0xc7, 0x7b, 0x51, 0x6a, 0x38, 0x44, 0x62, 0xae, 0x05, 0xea, 0x58, 0x0a, 0x0c, 0xdf, 0x1f, + 0xce, 0x84, 0x42, 0x5c, 0xb9, 0x01, 0x8d, 0x9f, 0x1b, 0xec, 0xd2, 0x68, 0x9a, 0xdb, 0xf6, 0xa6, + 0x4c, 0x9c, 0xce, 0x1d, 0x3a, 0x53, 0x02, 0x18, 0x5d, 0xf0, 0x04, 0x46, 0x77, 0xba, 0xf0, 0x21, + 0xdc, 0xf8, 0x08, 0x6c, 0x4c, 0x48, 0xdc, 0xb8, 0x32, 0x06, 0x5c, 0xfa, 0x10, 0xa6, 0xf7, 0x9e, + 0x69, 0x3b, 0xd3, 0x69, 0x01, 0xd3, 0x5d, 0xa7, 0xe7, 0xeb, 0x77, 0xfe, 0xe7, 0xde, 0x33, 0x03, + 0xa3, 0x25, 0x61, 0x39, 0x7e, 0xad, 0xee, 0xbc, 0x36, 0x77, 0xeb, 0xbc, 0x76, 0x60, 0xb8, 0x35, + 0xe1, 0x0b, 0x7a, 0xbd, 0x78, 0xc8, 0x8d, 0xa6, 0x49, 0x4b, 0x55, 0x44, 0x45, 0x48, 0x8b, 0xd9, + 0xf8, 0xa5, 0x9c, 0xb4, 0x4c, 0x45, 0x88, 0x8a, 0xcd, 0x4d, 0xe6, 0x5a, 0x26, 0x73, 0x1c, 0xe1, + 0x33, 0xdf, 0x12, 0x8e, 0x87, 0xd6, 0xe5, 0x92, 0xf0, 0xaa, 0xc2, 0x33, 0x8b, 0xcc, 0xe3, 0x2a, + 0xb7, 0xb9, 0xb7, 0x56, 0xe4, 0x3e, 0x5b, 0x33, 0x5d, 0x56, 0xb1, 0x1c, 0xe9, 0x8c, 0xbe, 0x63, + 0x2d, 0x0a, 0x97, 0xd5, 0x58, 0x35, 0xc8, 0x31, 0xd9, 0xfa, 0x9f, 0x95, 0x4a, 0xdc, 0xf5, 0x79, + 0xb9, 0x50, 0x16, 0x55, 0x66, 0x05, 0x81, 0xb7, 0xda, 0x02, 0xeb, 0x45, 0xdb, 0xf2, 0x76, 0x78, + 0x0d, 0x4d, 0xe3, 0x6d, 0xb1, 0x35, 0xdf, 0x2a, 0xd9, 0x1c, 0x0d, 0x73, 0x6d, 0x06, 0x47, 0x38, + 0x05, 0xb4, 0x7a, 0x85, 0x92, 0xa8, 0x3b, 0x7e, 0x10, 0xaf, 0xa7, 0x80, 0x3e, 0x6f, 0x50, 0x6f, + 0x4b, 0xa0, 0x3c, 0xdf, 0xad, 0x73, 0xcf, 0xd7, 0x9f, 0xc2, 0xcd, 0xd0, 0xbf, 0x9e, 0x2b, 0x1c, + 0x8f, 0xd3, 0x75, 0x48, 0x2a, 0xf0, 0x34, 0x99, 0x22, 0x8b, 0xc3, 0xb9, 0x51, 0x23, 0x24, 0xa0, + 0xa1, 0xdc, 0xb7, 0xae, 0x1e, 0xff, 0x9a, 0x4c, 0xe4, 0xd1, 0x55, 0x2f, 0x83, 0x26, 0x73, 0x6d, + 0x62, 0x6b, 0x0f, 0x64, 0x67, 0x58, 0x89, 0x3e, 0x04, 0x68, 0xe9, 0x84, 0x69, 0xe7, 0x0d, 0x25, + 0xaa, 0xd1, 0x10, 0xd5, 0x50, 0x03, 0x43, 0x51, 0x8d, 0x6d, 0x56, 0xe1, 0x18, 0x9b, 0x6f, 0x8b, + 0xd4, 0xbf, 0x12, 0xb8, 0x1d, 0x5b, 0x06, 0xd1, 0x9f, 0xc1, 0x08, 0x0b, 0x59, 0xd2, 0x64, 0xea, + 0xca, 0xe2, 0x70, 0x6e, 0x22, 0xd2, 0x42, 0x38, 0x1c, 0x5b, 0x89, 0x84, 0xd2, 0x47, 0x21, 0xe8, + 0x01, 0x09, 0xbd, 0x70, 0x2e, 0xb4, 0x22, 0x09, 0x51, 0x17, 0x60, 0x54, 0xe9, 0x1c, 0x4c, 0xb5, + 0xdf, 0xb2, 0x7c, 0x21, 0x30, 0x16, 0xad, 0x80, 0x8a, 0xdc, 0x83, 0xa1, 0xe6, 0x61, 0x42, 0x31, + 0xd2, 0xd1, 0x79, 0x06, 0x76, 0xd4, 0xa1, 0x15, 0xd0, 0x3f, 0x09, 0x36, 0x20, 0x13, 0x06, 0xdc, + 0x3a, 0x78, 0xe2, 0x94, 0xf9, 0x7e, 0xa0, 0x44, 0x0a, 0x06, 0xad, 0xc6, 0xb3, 0x14, 0x61, 0x28, + 0xaf, 0x1e, 0xf4, 0x57, 0x30, 0xd1, 0x25, 0x2a, 0xbe, 0x3b, 0x72, 0xa9, 0xee, 0x74, 0x06, 0xe3, + 0xea, 0x30, 0xd9, 0xf6, 0x26, 0xde, 0x9b, 0xf8, 0xc9, 0x0c, 0xfc, 0xf7, 0x64, 0x3e, 0x13, 0x48, + 0x77, 0xd6, 0x40, 0xfa, 0xbb, 0x70, 0x0d, 0xef, 0x2b, 0x4e, 0x66, 0x2c, 0x7a, 0x4c, 0x95, 0x15, + 0xc9, 0x03, 0xe7, 0xfe, 0x4d, 0xa5, 0x0a, 0x33, 0x4d, 0x38, 0x47, 0x38, 0x01, 0xe0, 0x7d, 0xb5, + 0x3b, 0xbc, 0x7e, 0x1f, 0xd3, 0xef, 0x04, 0x66, 0x7b, 0xd7, 0x43, 0x61, 0x5e, 0x42, 0x2a, 0xce, + 0x8e, 0x2a, 0xe9, 0x51, 0x95, 0x3a, 0x5d, 0x51, 0xb1, 0xd8, 0x2c, 0x7d, 0x93, 0x2f, 0xf7, 0x37, + 0x09, 0x83, 0xb2, 0x1f, 0xba, 0x0b, 0x49, 0xb5, 0x15, 0xe9, 0x74, 0x04, 0xae, 0x73, 0xed, 0x6a, + 0x7a, 0x2f, 0x17, 0x55, 0x46, 0x9f, 0x3a, 0xfa, 0xf1, 0xe7, 0xe3, 0x80, 0x46, 0xd3, 0x66, 0xf1, + 0x90, 0x9b, 0xad, 0x25, 0xbf, 0xb7, 0x86, 0x2f, 0x15, 0xfa, 0x81, 0xc0, 0x48, 0x78, 0x8d, 0xd1, + 0xa5, 0xb8, 0xc4, 0xb1, 0x0b, 0x59, 0x5b, 0xbe, 0x88, 0x2b, 0xb2, 0x2c, 0x49, 0x96, 0x19, 0x3a, + 0xdd, 0xc9, 0x12, 0x79, 0x91, 0xd1, 0x77, 0x30, 0xd4, 0xbc, 0x6f, 0x74, 0x36, 0xb6, 0xcf, 0xc8, + 0x0e, 0xd4, 0xe6, 0xce, 0xf1, 0x42, 0x88, 0x59, 0x09, 0x91, 0xa5, 0x99, 0x18, 0x41, 0x02, 0x67, + 0x8f, 0x7e, 0x22, 0x70, 0x23, 0xba, 0x2c, 0xe8, 0x4a, 0xcf, 0x0a, 0xe1, 0x45, 0xa4, 0xad, 0x5e, + 0xcc, 0x19, 0xa9, 0x56, 0x24, 0xd5, 0x1c, 0x9d, 0xe9, 0x41, 0x65, 0xbe, 0x91, 0xcb, 0xec, 0x2d, + 0x3d, 0x22, 0x30, 0xdc, 0xb6, 0x06, 0xe8, 0x7c, 0xec, 0x0c, 0x3a, 0x76, 0x91, 0xb6, 0x70, 0xae, + 0x1f, 0xd2, 0xe8, 0x92, 0x26, 0x43, 0xb5, 0x98, 0x41, 0x05, 0x45, 0xbf, 0x11, 0x18, 0xef, 0x72, + 0xfd, 0x68, 0xae, 0x5b, 0xa1, 0xee, 0xbb, 0x41, 0x5b, 0xbf, 0x54, 0x0c, 0x82, 0x6e, 0x48, 0x50, + 0x83, 0xae, 0xc6, 0x80, 0xda, 0x76, 0x21, 0xf6, 0x4b, 0xc6, 0xdb, 0x7a, 0x7c, 0x7c, 0x9a, 0x25, + 0x27, 0xa7, 0x59, 0xf2, 0xfb, 0x34, 0x4b, 0xde, 0x9f, 0x65, 0x13, 0x27, 0x67, 0xd9, 0xc4, 0xcf, + 0xb3, 0x6c, 0xe2, 0x85, 0x51, 0xb1, 0xfc, 0x9d, 0x7a, 0xd1, 0x28, 0x89, 0x6a, 0x23, 0xe3, 0x1d, + 0x66, 0xbb, 0x3b, 0xcc, 0xe7, 0x4c, 0x3e, 0x99, 0xfb, 0x6d, 0x15, 0xfc, 0x03, 0x97, 0x7b, 0xc5, + 0xa4, 0xfc, 0x2a, 0x5a, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0x91, 0xa0, 0xf0, 0x83, 0x31, 0x0a, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/cointrunk/types/query.pb.gw.go b/x/cointrunk/types/query.pb.gw.go index d1dd7e47..896f3233 100644 --- a/x/cointrunk/types/query.pb.gw.go +++ b/x/cointrunk/types/query.pb.gw.go @@ -558,17 +558,17 @@ 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{"bze", "cointrunk", "params"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze", "cointrunk", "v1", "params"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_AcceptedDomain_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "accepted_domain"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_AcceptedDomain_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze", "cointrunk", "v1", "accepted_domain"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_Publisher_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "publishers"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_Publisher_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze", "cointrunk", "v1", "publishers"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_PublisherByIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"bze", "cointrunk", "publisher", "index"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_PublisherByIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"bze", "cointrunk", "v1", "publisher", "index"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_AllArticles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "all_articles"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_AllArticles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze", "cointrunk", "v1", "articles"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_AllAnonArticlesCounters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"bze", "cointrunk", "all_anon_articles_counters"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_AllAnonArticlesCounters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"bze", "cointrunk", "v1", "all_anon_articles_counters"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( From 7a500aa9f8ee6299809f84a3319b4721aaf33dc4 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Sat, 24 Dec 2022 01:22:04 +0200 Subject: [PATCH 42/54] added respect to publisher --- go.mod | 3 ++ go.sum | 5 +++ proto/cointrunk/publisher.proto | 1 + x/cointrunk/keeper/gov.go | 1 + x/cointrunk/types/publisher.pb.go | 68 +++++++++++++++++++++++-------- 5 files changed, 62 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index f108c1ed..95260012 100644 --- a/go.mod +++ b/go.mod @@ -54,11 +54,13 @@ require ( github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.4 // 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.5.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect + github.com/golang/glog v1.0.0 // indirect github.com/golang/snappy v0.0.3 // indirect github.com/google/btree v1.0.0 // indirect github.com/google/go-cmp v0.5.9 // indirect @@ -67,6 +69,7 @@ require ( github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect diff --git a/go.sum b/go.sum index f174aa5f..81fcb86a 100644 --- a/go.sum +++ b/go.sum @@ -528,6 +528,7 @@ github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASx github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +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= @@ -633,6 +634,8 @@ github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/ github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -790,6 +793,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= 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.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= diff --git a/proto/cointrunk/publisher.proto b/proto/cointrunk/publisher.proto index 35a09127..0f966dc7 100644 --- a/proto/cointrunk/publisher.proto +++ b/proto/cointrunk/publisher.proto @@ -10,4 +10,5 @@ message Publisher { bool active = 3; uint32 articlesCount = 4; int64 createdAt = 5; + int64 respect = 6; } diff --git a/x/cointrunk/keeper/gov.go b/x/cointrunk/keeper/gov.go index d4e75cd6..e3f7411a 100644 --- a/x/cointrunk/keeper/gov.go +++ b/x/cointrunk/keeper/gov.go @@ -14,6 +14,7 @@ func (k Keeper) HandlePublisherProposal(ctx sdk.Context, proposal *types.Publish publisher.Address = proposal.Address publisher.CreatedAt = ctx.BlockHeader().Time.Unix() publisher.ArticlesCount = 0 + publisher.Respect = 0 } k.SetPublisher(ctx, publisher) return nil diff --git a/x/cointrunk/types/publisher.pb.go b/x/cointrunk/types/publisher.pb.go index df664e75..af30b8f9 100644 --- a/x/cointrunk/types/publisher.pb.go +++ b/x/cointrunk/types/publisher.pb.go @@ -28,6 +28,7 @@ type Publisher struct { Active bool `protobuf:"varint,3,opt,name=active,proto3" json:"active,omitempty"` ArticlesCount uint32 `protobuf:"varint,4,opt,name=articlesCount,proto3" json:"articlesCount,omitempty"` CreatedAt int64 `protobuf:"varint,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + Respect int64 `protobuf:"varint,6,opt,name=respect,proto3" json:"respect,omitempty"` } func (m *Publisher) Reset() { *m = Publisher{} } @@ -98,6 +99,13 @@ func (m *Publisher) GetCreatedAt() int64 { return 0 } +func (m *Publisher) GetRespect() int64 { + if m != nil { + return m.Respect + } + return 0 +} + func init() { proto.RegisterType((*Publisher)(nil), "bze.cointrunk.Publisher") } @@ -105,22 +113,23 @@ func init() { func init() { proto.RegisterFile("cointrunk/publisher.proto", fileDescriptor_13a2ab3c46c6721e) } var fileDescriptor_13a2ab3c46c6721e = []byte{ - // 235 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x8f, 0xb1, 0x4e, 0xc3, 0x30, - 0x10, 0x86, 0x73, 0xb4, 0x14, 0x62, 0x29, 0x8b, 0x07, 0x64, 0x24, 0x64, 0x45, 0x88, 0x21, 0x0b, - 0xc9, 0xc0, 0x13, 0x00, 0x0b, 0x23, 0xca, 0xc8, 0x66, 0x3b, 0x27, 0x62, 0x91, 0xc6, 0x91, 0x7d, - 0x41, 0xd0, 0xa7, 0x60, 0xe1, 0x9d, 0x18, 0x3b, 0x32, 0xa2, 0xe4, 0x45, 0x90, 0x2c, 0x4a, 0xd5, - 0xed, 0xbe, 0xef, 0xfe, 0xe5, 0x63, 0xe7, 0xc6, 0xd9, 0x9e, 0xfc, 0xd8, 0xbf, 0x54, 0xc3, 0xa8, - 0x3b, 0x1b, 0x5a, 0xf4, 0xe5, 0xe0, 0x1d, 0x39, 0x9e, 0xe9, 0x0d, 0x96, 0xff, 0xef, 0xcb, 0x4f, - 0x60, 0xe9, 0xe3, 0x6e, 0xc2, 0x39, 0x5b, 0xf6, 0x6a, 0x8d, 0x02, 0x72, 0x28, 0xd2, 0x3a, 0xde, - 0x5c, 0xb0, 0x13, 0xd5, 0x34, 0x1e, 0x43, 0x10, 0x47, 0x51, 0xef, 0x90, 0x9f, 0xb1, 0x95, 0x32, - 0x64, 0x5f, 0x51, 0x2c, 0x72, 0x28, 0x4e, 0xeb, 0x3f, 0xe2, 0x57, 0x2c, 0x53, 0x9e, 0xac, 0xe9, - 0x30, 0xdc, 0xbb, 0xb1, 0x27, 0xb1, 0xcc, 0xa1, 0xc8, 0xea, 0x43, 0xc9, 0x2f, 0x58, 0x6a, 0x3c, - 0x2a, 0xc2, 0xe6, 0x96, 0xc4, 0x71, 0x0e, 0xc5, 0xa2, 0xde, 0x8b, 0xbb, 0x87, 0xaf, 0x49, 0xc2, - 0x76, 0x92, 0xf0, 0x33, 0x49, 0xf8, 0x98, 0x65, 0xb2, 0x9d, 0x65, 0xf2, 0x3d, 0xcb, 0xe4, 0xa9, - 0x7c, 0xb6, 0xd4, 0x8e, 0xba, 0x34, 0x6e, 0x5d, 0xe9, 0x0d, 0x5e, 0xab, 0x6e, 0x68, 0x15, 0xa1, - 0x8a, 0x54, 0xbd, 0x55, 0xfb, 0x74, 0x7a, 0x1f, 0x30, 0xe8, 0x55, 0xec, 0xbe, 0xf9, 0x0d, 0x00, - 0x00, 0xff, 0xff, 0x9b, 0x8c, 0x3f, 0xf6, 0x14, 0x01, 0x00, 0x00, + // 247 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xb1, 0x4a, 0xc5, 0x30, + 0x14, 0x86, 0x1b, 0xef, 0xb5, 0xda, 0x40, 0x97, 0x0c, 0x12, 0x41, 0x42, 0x11, 0x87, 0x2e, 0xb6, + 0x83, 0x4f, 0xa0, 0x2e, 0x8e, 0xd2, 0xd1, 0x2d, 0x49, 0x0f, 0x36, 0xd8, 0xdb, 0x84, 0xe4, 0x54, + 0xf4, 0x3e, 0x85, 0x6f, 0xe2, 0x6b, 0x38, 0xde, 0xd1, 0x51, 0xda, 0x17, 0x11, 0x83, 0xf5, 0xe2, + 0x76, 0xbe, 0xef, 0x3f, 0xf0, 0xc3, 0x4f, 0x4f, 0xb5, 0x35, 0x03, 0xfa, 0x71, 0x78, 0xaa, 0xdd, + 0xa8, 0x7a, 0x13, 0x3a, 0xf0, 0x95, 0xf3, 0x16, 0x2d, 0xcb, 0xd5, 0x16, 0xaa, 0xbf, 0xf8, 0xfc, + 0x9d, 0xd0, 0xec, 0x7e, 0x79, 0x61, 0x8c, 0xae, 0x07, 0xb9, 0x01, 0x4e, 0x0a, 0x52, 0x66, 0x4d, + 0xbc, 0x19, 0xa7, 0x47, 0xb2, 0x6d, 0x3d, 0x84, 0xc0, 0x0f, 0xa2, 0x5e, 0x90, 0x9d, 0xd0, 0x54, + 0x6a, 0x34, 0xcf, 0xc0, 0x57, 0x05, 0x29, 0x8f, 0x9b, 0x5f, 0x62, 0x17, 0x34, 0x97, 0x1e, 0x8d, + 0xee, 0x21, 0xdc, 0xda, 0x71, 0x40, 0xbe, 0x2e, 0x48, 0x99, 0x37, 0xff, 0x25, 0x3b, 0xa3, 0x99, + 0xf6, 0x20, 0x11, 0xda, 0x6b, 0xe4, 0x87, 0x05, 0x29, 0x57, 0xcd, 0x5e, 0xfc, 0xb4, 0x7a, 0x08, + 0x0e, 0x34, 0xf2, 0x34, 0x66, 0x0b, 0xde, 0xdc, 0x7d, 0x4c, 0x82, 0xec, 0x26, 0x41, 0xbe, 0x26, + 0x41, 0xde, 0x66, 0x91, 0xec, 0x66, 0x91, 0x7c, 0xce, 0x22, 0x79, 0xa8, 0x1e, 0x0d, 0x76, 0xa3, + 0xaa, 0xb4, 0xdd, 0xd4, 0x6a, 0x0b, 0x97, 0xb2, 0x77, 0x9d, 0x44, 0x90, 0x91, 0xea, 0x97, 0x7a, + 0x3f, 0x0a, 0xbe, 0x3a, 0x08, 0x2a, 0x8d, 0x8b, 0x5c, 0x7d, 0x07, 0x00, 0x00, 0xff, 0xff, 0x3b, + 0x7c, 0x16, 0x76, 0x2e, 0x01, 0x00, 0x00, } func (m *Publisher) Marshal() (dAtA []byte, err error) { @@ -143,6 +152,11 @@ func (m *Publisher) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Respect != 0 { + i = encodeVarintPublisher(dAtA, i, uint64(m.Respect)) + i-- + dAtA[i] = 0x30 + } if m.CreatedAt != 0 { i = encodeVarintPublisher(dAtA, i, uint64(m.CreatedAt)) i-- @@ -214,6 +228,9 @@ func (m *Publisher) Size() (n int) { if m.CreatedAt != 0 { n += 1 + sovPublisher(uint64(m.CreatedAt)) } + if m.Respect != 0 { + n += 1 + sovPublisher(uint64(m.Respect)) + } return n } @@ -374,6 +391,25 @@ func (m *Publisher) Unmarshal(dAtA []byte) error { break } } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Respect", wireType) + } + m.Respect = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPublisher + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Respect |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipPublisher(dAtA[iNdEx:]) From 20dbcedaf9d89c9ff5b9e9ccde92a5dc62421d40 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Sat, 24 Dec 2022 02:54:12 +0200 Subject: [PATCH 43/54] added publisher respect --- app/app.go | 3 +- docs/static/openapi.yml | 25 + go.mod | 3 - go.sum | 5 - proto/cointrunk/tx.proto | 13 + .../bze-alphateam/bze/bze.cointrunk/index.ts | 28 + .../bze/bze.cointrunk/module/index.ts | 3 + .../bze/bze.cointrunk/module/rest.ts | 10 + .../module/types/cointrunk/publisher.ts | 19 + .../module/types/cointrunk/tx.ts | 276 +++++++- .../bze-alphateam/bze/bze.scavenge/index.ts | 40 +- .../bze/bze.scavenge/module/index.ts | 6 +- x/cointrunk/client/cli/tx.go | 1 + .../client/cli/tx_pay_publisher_respect.go | 44 ++ x/cointrunk/handler.go | 3 + x/cointrunk/keeper/keeper.go | 23 +- .../msg_server_pay_publisher_respect.go | 74 +++ x/cointrunk/module.go | 3 + x/cointrunk/module_simulation.go | 15 + .../simulation/pay_publisher_respect.go | 29 + x/cointrunk/types/codec.go | 4 + x/cointrunk/types/expected_keepers.go | 5 + .../types/message_pay_publisher_respect.go | 62 ++ .../message_pay_publisher_respect_test.go | 40 ++ x/cointrunk/types/tx.pb.go | 606 +++++++++++++++++- 25 files changed, 1279 insertions(+), 61 deletions(-) create mode 100644 x/cointrunk/client/cli/tx_pay_publisher_respect.go create mode 100644 x/cointrunk/keeper/msg_server_pay_publisher_respect.go create mode 100644 x/cointrunk/simulation/pay_publisher_respect.go create mode 100644 x/cointrunk/types/message_pay_publisher_respect.go create mode 100644 x/cointrunk/types/message_pay_publisher_respect_test.go diff --git a/app/app.go b/app/app.go index d39dac30..d2b80feb 100644 --- a/app/app.go +++ b/app/app.go @@ -398,6 +398,7 @@ func New( app.BankKeeper, app.GovKeeper, app.AccountKeeper, + app.DistrKeeper, ) app.BurnerKeeper = *burnermodulekeeper.NewKeeper( @@ -410,7 +411,7 @@ func New( ) scavengeModule := scavengemodule.NewAppModule(appCodec, app.ScavengeKeeper) - cointrunkModule := cointrunkmodule.NewAppModule(appCodec, app.CointrunkKeeper, app.AccountKeeper, app.BankKeeper) + cointrunkModule := cointrunkmodule.NewAppModule(appCodec, app.CointrunkKeeper, app.AccountKeeper, app.BankKeeper, app.DistrKeeper) burnerModule := burnermodule.NewAppModule(appCodec, app.BurnerKeeper, app.AccountKeeper, app.BankKeeper) // this line is used by starport scaffolding # stargate/app/keeperDefinition diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 01f4630a..918a671c 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -624,6 +624,9 @@ paths: createdAt: type: string format: int64 + respect: + type: string + format: int64 default: description: An unexpected error response. schema: @@ -676,6 +679,9 @@ paths: createdAt: type: string format: int64 + respect: + type: string + format: int64 pagination: type: object properties: @@ -32698,6 +32704,16 @@ definitions: format: int64 bze.cointrunk.MsgAddArticleResponse: type: object + bze.cointrunk.MsgPayPublisherRespectResponse: + type: object + properties: + respectPaid: + type: string + format: uint64 + publisherReward: + type: string + communityPoolFunds: + type: string bze.cointrunk.Params: type: object properties: @@ -32732,6 +32748,9 @@ definitions: createdAt: type: string format: int64 + respect: + type: string + format: int64 bze.cointrunk.QueryAcceptedDomainResponse: type: object properties: @@ -32900,6 +32919,9 @@ definitions: createdAt: type: string format: int64 + respect: + type: string + format: int64 bze.cointrunk.QueryPublisherResponse: type: object properties: @@ -32920,6 +32942,9 @@ definitions: createdAt: type: string format: int64 + respect: + type: string + format: int64 pagination: type: object properties: diff --git a/go.mod b/go.mod index 95260012..f108c1ed 100644 --- a/go.mod +++ b/go.mod @@ -54,13 +54,11 @@ require ( github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.4 // 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.5.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect - github.com/golang/glog v1.0.0 // indirect github.com/golang/snappy v0.0.3 // indirect github.com/google/btree v1.0.0 // indirect github.com/google/go-cmp v0.5.9 // indirect @@ -69,7 +67,6 @@ require ( github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect diff --git a/go.sum b/go.sum index 81fcb86a..f174aa5f 100644 --- a/go.sum +++ b/go.sum @@ -528,7 +528,6 @@ github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASx github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -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= @@ -634,8 +633,6 @@ github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/ github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -793,8 +790,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= 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.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= diff --git a/proto/cointrunk/tx.proto b/proto/cointrunk/tx.proto index 5d28f4e1..688623e1 100644 --- a/proto/cointrunk/tx.proto +++ b/proto/cointrunk/tx.proto @@ -8,6 +8,7 @@ option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; // Msg defines the Msg service. service Msg { rpc AddArticle(MsgAddArticle) returns (MsgAddArticleResponse); + rpc PayPublisherRespect(MsgPayPublisherRespect) returns (MsgPayPublisherRespectResponse); // this line is used by starport scaffolding # proto/tx/rpc } @@ -21,4 +22,16 @@ message MsgAddArticle { message MsgAddArticleResponse { } +message MsgPayPublisherRespect { + string creator = 1; + string address = 2; + string amount = 3; +} + +message MsgPayPublisherRespectResponse { + uint64 respectPaid = 1; + string publisherReward = 2; + string communityPoolFunds = 3; +} + // this line is used by starport scaffolding # proto/tx/message \ No newline at end of file diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts index 1bc55672..85c93b1f 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/index.ts @@ -308,6 +308,21 @@ export default { }, + async sendMsgPayPublisherRespect({ rootGetters }, { value, fee = [], memo = '' }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgPayPublisherRespect(value) + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') + }else{ + throw new Error('TxClient:MsgPayPublisherRespect:Send Could not broadcast Tx: '+ e.message) + } + } + }, async sendMsgAddArticle({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -324,6 +339,19 @@ export default { } }, + async MsgPayPublisherRespect({ rootGetters }, { value }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgPayPublisherRespect(value) + return msg + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') + } else{ + throw new Error('TxClient:MsgPayPublisherRespect:Create Could not create message: ' + e.message) + } + } + }, async MsgAddArticle({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/index.ts index f954a42c..4f13f152 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/index.ts @@ -4,10 +4,12 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; +import { MsgPayPublisherRespect } from "./types/cointrunk/tx"; import { MsgAddArticle } from "./types/cointrunk/tx"; const types = [ + ["/bze.cointrunk.MsgPayPublisherRespect", MsgPayPublisherRespect], ["/bze.cointrunk.MsgAddArticle", MsgAddArticle], ]; @@ -41,6 +43,7 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + msgPayPublisherRespect: (data: MsgPayPublisherRespect): EncodeObject => ({ typeUrl: "/bze.cointrunk.MsgPayPublisherRespect", value: MsgPayPublisherRespect.fromPartial( data ) }), msgAddArticle: (data: MsgAddArticle): EncodeObject => ({ typeUrl: "/bze.cointrunk.MsgAddArticle", value: MsgAddArticle.fromPartial( data ) }), }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts index fd610052..6c55e8b2 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/rest.ts @@ -36,6 +36,13 @@ export interface CointrunkArticle { export type CointrunkMsgAddArticleResponse = object; +export interface CointrunkMsgPayPublisherRespectResponse { + /** @format uint64 */ + respectPaid?: string; + publisherReward?: string; + communityPoolFunds?: string; +} + /** * Params defines the parameters for the module. */ @@ -62,6 +69,9 @@ export interface CointrunkPublisher { /** @format int64 */ createdAt?: string; + + /** @format int64 */ + respect?: string; } export interface CointrunkQueryAcceptedDomainResponse { diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher.ts index bbbbdec5..ac59a8e8 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/publisher.ts @@ -10,6 +10,7 @@ export interface Publisher { active: boolean; articlesCount: number; createdAt: number; + respect: number; } const basePublisher: object = { @@ -18,6 +19,7 @@ const basePublisher: object = { active: false, articlesCount: 0, createdAt: 0, + respect: 0, }; export const Publisher = { @@ -37,6 +39,9 @@ export const Publisher = { if (message.createdAt !== 0) { writer.uint32(40).int64(message.createdAt); } + if (message.respect !== 0) { + writer.uint32(48).int64(message.respect); + } return writer; }, @@ -62,6 +67,9 @@ export const Publisher = { case 5: message.createdAt = longToNumber(reader.int64() as Long); break; + case 6: + message.respect = longToNumber(reader.int64() as Long); + break; default: reader.skipType(tag & 7); break; @@ -97,6 +105,11 @@ export const Publisher = { } else { message.createdAt = 0; } + if (object.respect !== undefined && object.respect !== null) { + message.respect = Number(object.respect); + } else { + message.respect = 0; + } return message; }, @@ -108,6 +121,7 @@ export const Publisher = { message.articlesCount !== undefined && (obj.articlesCount = message.articlesCount); message.createdAt !== undefined && (obj.createdAt = message.createdAt); + message.respect !== undefined && (obj.respect = message.respect); return obj; }, @@ -138,6 +152,11 @@ export const Publisher = { } else { message.createdAt = 0; } + if (object.respect !== undefined && object.respect !== null) { + message.respect = object.respect; + } else { + message.respect = 0; + } return message; }, }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/tx.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/tx.ts index a0fab7da..a0f918e4 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/tx.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk/module/types/cointrunk/tx.ts @@ -1,5 +1,6 @@ /* eslint-disable */ -import { Reader, Writer } from "protobufjs/minimal"; +import { Reader, util, configure, Writer } from "protobufjs/minimal"; +import * as Long from "long"; export const protobufPackage = "bze.cointrunk"; @@ -12,6 +13,18 @@ export interface MsgAddArticle { export interface MsgAddArticleResponse {} +export interface MsgPayPublisherRespect { + creator: string; + address: string; + amount: string; +} + +export interface MsgPayPublisherRespectResponse { + respectPaid: number; + publisherReward: string; + communityPoolFunds: string; +} + const baseMsgAddArticle: object = { publisher: "", title: "", @@ -161,10 +174,233 @@ export const MsgAddArticleResponse = { }, }; +const baseMsgPayPublisherRespect: object = { + creator: "", + address: "", + amount: "", +}; + +export const MsgPayPublisherRespect = { + encode( + message: MsgPayPublisherRespect, + writer: Writer = Writer.create() + ): Writer { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.amount !== "") { + writer.uint32(26).string(message.amount); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MsgPayPublisherRespect { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgPayPublisherRespect } as MsgPayPublisherRespect; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgPayPublisherRespect { + const message = { ...baseMsgPayPublisherRespect } as MsgPayPublisherRespect; + if (object.creator !== undefined && object.creator !== null) { + message.creator = String(object.creator); + } else { + message.creator = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + return message; + }, + + toJSON(message: MsgPayPublisherRespect): unknown { + const obj: any = {}; + message.creator !== undefined && (obj.creator = message.creator); + message.address !== undefined && (obj.address = message.address); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, + + fromPartial( + object: DeepPartial + ): MsgPayPublisherRespect { + const message = { ...baseMsgPayPublisherRespect } as MsgPayPublisherRespect; + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } else { + message.creator = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + return message; + }, +}; + +const baseMsgPayPublisherRespectResponse: object = { + respectPaid: 0, + publisherReward: "", + communityPoolFunds: "", +}; + +export const MsgPayPublisherRespectResponse = { + encode( + message: MsgPayPublisherRespectResponse, + writer: Writer = Writer.create() + ): Writer { + if (message.respectPaid !== 0) { + writer.uint32(8).uint64(message.respectPaid); + } + if (message.publisherReward !== "") { + writer.uint32(18).string(message.publisherReward); + } + if (message.communityPoolFunds !== "") { + writer.uint32(26).string(message.communityPoolFunds); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): MsgPayPublisherRespectResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMsgPayPublisherRespectResponse, + } as MsgPayPublisherRespectResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.respectPaid = longToNumber(reader.uint64() as Long); + break; + case 2: + message.publisherReward = reader.string(); + break; + case 3: + message.communityPoolFunds = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgPayPublisherRespectResponse { + const message = { + ...baseMsgPayPublisherRespectResponse, + } as MsgPayPublisherRespectResponse; + if (object.respectPaid !== undefined && object.respectPaid !== null) { + message.respectPaid = Number(object.respectPaid); + } else { + message.respectPaid = 0; + } + if ( + object.publisherReward !== undefined && + object.publisherReward !== null + ) { + message.publisherReward = String(object.publisherReward); + } else { + message.publisherReward = ""; + } + if ( + object.communityPoolFunds !== undefined && + object.communityPoolFunds !== null + ) { + message.communityPoolFunds = String(object.communityPoolFunds); + } else { + message.communityPoolFunds = ""; + } + return message; + }, + + toJSON(message: MsgPayPublisherRespectResponse): unknown { + const obj: any = {}; + message.respectPaid !== undefined && + (obj.respectPaid = message.respectPaid); + message.publisherReward !== undefined && + (obj.publisherReward = message.publisherReward); + message.communityPoolFunds !== undefined && + (obj.communityPoolFunds = message.communityPoolFunds); + return obj; + }, + + fromPartial( + object: DeepPartial + ): MsgPayPublisherRespectResponse { + const message = { + ...baseMsgPayPublisherRespectResponse, + } as MsgPayPublisherRespectResponse; + if (object.respectPaid !== undefined && object.respectPaid !== null) { + message.respectPaid = object.respectPaid; + } else { + message.respectPaid = 0; + } + if ( + object.publisherReward !== undefined && + object.publisherReward !== null + ) { + message.publisherReward = object.publisherReward; + } else { + message.publisherReward = ""; + } + if ( + object.communityPoolFunds !== undefined && + object.communityPoolFunds !== null + ) { + message.communityPoolFunds = object.communityPoolFunds; + } else { + message.communityPoolFunds = ""; + } + return message; + }, +}; + /** Msg defines the Msg service. */ export interface Msg { - /** this line is used by starport scaffolding # proto/tx/rpc */ AddArticle(request: MsgAddArticle): Promise; + /** this line is used by starport scaffolding # proto/tx/rpc */ + PayPublisherRespect( + request: MsgPayPublisherRespect + ): Promise; } export class MsgClientImpl implements Msg { @@ -179,6 +415,20 @@ export class MsgClientImpl implements Msg { MsgAddArticleResponse.decode(new Reader(data)) ); } + + PayPublisherRespect( + request: MsgPayPublisherRespect + ): Promise { + const data = MsgPayPublisherRespect.encode(request).finish(); + const promise = this.rpc.request( + "bze.cointrunk.Msg", + "PayPublisherRespect", + data + ); + return promise.then((data) => + MsgPayPublisherRespectResponse.decode(new Reader(data)) + ); + } } interface Rpc { @@ -189,6 +439,16 @@ interface Rpc { ): Promise; } +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + type Builtin = Date | Function | Uint8Array | string | number | undefined; export type DeepPartial = T extends Builtin ? T @@ -199,3 +459,15 @@ export type DeepPartial = T extends Builtin : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 40cc1ba4..155d50b2 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,6 +232,21 @@ export default { }, + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgRevealSolution(value) + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + }else{ + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + } + } + }, async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -262,22 +277,20 @@ export default { } } }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) const msg = await txClient.msgRevealSolution(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result + return msg } catch (e) { if (e == MissingWalletError) { throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + } else{ + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, - async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) @@ -304,19 +317,6 @@ export default { } } }, - async MsgRevealSolution({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) - } - } - }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index c023b54d..9a3de64c 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; +import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; -import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/client/cli/tx.go b/x/cointrunk/client/cli/tx.go index d6b486c4..7dd07232 100644 --- a/x/cointrunk/client/cli/tx.go +++ b/x/cointrunk/client/cli/tx.go @@ -31,6 +31,7 @@ func GetTxCmd() *cobra.Command { } cmd.AddCommand(CmdAddArticle()) + cmd.AddCommand(CmdPayPublisherRespect()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/cointrunk/client/cli/tx_pay_publisher_respect.go b/x/cointrunk/client/cli/tx_pay_publisher_respect.go new file mode 100644 index 00000000..d9b17b02 --- /dev/null +++ b/x/cointrunk/client/cli/tx_pay_publisher_respect.go @@ -0,0 +1,44 @@ +package cli + +import ( + "strconv" + + "github.com/bze-alphateam/bze/x/cointrunk/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 CmdPayPublisherRespect() *cobra.Command { + cmd := &cobra.Command{ + Use: "pay-publisher-respect [address] [amount]", + Short: "Broadcast message pay-publisher-respect", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAddress := args[0] + argAmount := args[1] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgPayPublisherRespect( + clientCtx.GetFromAddress().String(), + argAddress, + argAmount, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/cointrunk/handler.go b/x/cointrunk/handler.go index 34d2cc38..3219654a 100644 --- a/x/cointrunk/handler.go +++ b/x/cointrunk/handler.go @@ -20,6 +20,9 @@ func NewHandler(k keeper.Keeper) sdk.Handler { case *types.MsgAddArticle: res, err := msgServer.AddArticle(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgPayPublisherRespect: + res, err := msgServer.PayPublisherRespect(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) // this line is used by starport scaffolding # 1 default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) diff --git a/x/cointrunk/keeper/keeper.go b/x/cointrunk/keeper/keeper.go index fc766a55..e903d2eb 100644 --- a/x/cointrunk/keeper/keeper.go +++ b/x/cointrunk/keeper/keeper.go @@ -18,9 +18,10 @@ type ( memKey sdk.StoreKey paramstore paramtypes.Subspace - bankKeeper types.BankKeeper - govKeeper types.GovKeeper - accKeeper types.AccountKeeper + bankKeeper types.BankKeeper + govKeeper types.GovKeeper + accKeeper types.AccountKeeper + distrKeeper types.DistrKeeper } ) @@ -33,6 +34,7 @@ func NewKeeper( bankKeeper types.BankKeeper, govKeeper types.GovKeeper, accKeeper types.AccountKeeper, + distrKeeper types.DistrKeeper, ) *Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -41,13 +43,14 @@ func NewKeeper( return &Keeper{ - cdc: cdc, - storeKey: storeKey, - memKey: memKey, - paramstore: ps, - bankKeeper: bankKeeper, - govKeeper: govKeeper, - accKeeper: accKeeper, + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + paramstore: ps, + bankKeeper: bankKeeper, + govKeeper: govKeeper, + accKeeper: accKeeper, + distrKeeper: distrKeeper, } } diff --git a/x/cointrunk/keeper/msg_server_pay_publisher_respect.go b/x/cointrunk/keeper/msg_server_pay_publisher_respect.go new file mode 100644 index 00000000..b198b2e7 --- /dev/null +++ b/x/cointrunk/keeper/msg_server_pay_publisher_respect.go @@ -0,0 +1,74 @@ +package keeper + +import ( + "context" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/bze-alphateam/bze/x/cointrunk/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k msgServer) PayPublisherRespect(goCtx context.Context, msg *types.MsgPayPublisherRespect) (*types.MsgPayPublisherRespectResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + coin, err := sdk.ParseCoinNormalized(msg.Amount) + if err != nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid amount (%s)", err) + } + //TODO: param to decide the denom we accept to be paid as respect + if !coin.IsPositive() { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid coin amount (amount should be positive)") + } + + publisher, found := k.GetPublisher(ctx, msg.Address) + if !found { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "publisher (%s) could not be found", msg.Address) + } + + publisherAcc, err := sdk.AccAddressFromBech32(publisher.Address) + if err != nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "could not get publisher account (%s)", err) + } + + creatorAcc, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid creator account (%s)", err) + } + + totalAmountInt := sdk.NewInt(coin.Amount.Int64()) + //TODO: param to decide the tax % we take + taxPercent := sdk.NewDecWithPrec(20, 2) //20% + taxAmountDec := taxPercent.MulInt(totalAmountInt) + taxAmountInt := taxAmountDec.TruncateInt() + if taxAmountInt.IsNegative() { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid tax amount (is negative)") + } + + publisherAmountInt := totalAmountInt.Sub(taxAmountInt) + if !publisherAmountInt.IsPositive() { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid publisher amount (is not positive)") + } + + publisherRewardCoin := sdk.NewCoin(coin.Denom, publisherAmountInt) + sdkErr := k.bankKeeper.SendCoins(ctx, creatorAcc, publisherAcc, sdk.NewCoins(publisherRewardCoin)) + if sdkErr != nil { + return nil, sdkErr + } + + //TODO: check the tax is > 0 + taxPaidCoin := sdk.NewCoin(coin.Denom, taxAmountInt) + err = k.distrKeeper.FundCommunityPool(ctx, sdk.NewCoins(taxPaidCoin), creatorAcc) + if err != nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "Could not fund community pool (%s)", err) + } + + publisher.Respect += coin.Amount.Int64() + k.SetPublisher(ctx, publisher) + _ = ctx + + return &types.MsgPayPublisherRespectResponse{ + RespectPaid: coin.Amount.Uint64(), + PublisherReward: publisherRewardCoin.String(), + CommunityPoolFunds: taxPaidCoin.String(), + }, nil +} diff --git a/x/cointrunk/module.go b/x/cointrunk/module.go index 1b21392e..17aea26a 100644 --- a/x/cointrunk/module.go +++ b/x/cointrunk/module.go @@ -102,6 +102,7 @@ type AppModule struct { keeper keeper.Keeper accountKeeper types.AccountKeeper bankKeeper types.BankKeeper + distrKeeper types.DistrKeeper } func NewAppModule( @@ -109,12 +110,14 @@ func NewAppModule( keeper keeper.Keeper, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, + distrKeeper types.DistrKeeper, ) AppModule { return AppModule{ AppModuleBasic: NewAppModuleBasic(cdc), keeper: keeper, accountKeeper: accountKeeper, bankKeeper: bankKeeper, + distrKeeper: distrKeeper, } } diff --git a/x/cointrunk/module_simulation.go b/x/cointrunk/module_simulation.go index 4d93d969..9421a360 100644 --- a/x/cointrunk/module_simulation.go +++ b/x/cointrunk/module_simulation.go @@ -28,6 +28,10 @@ const ( // TODO: Determine the simulation weight value defaultWeightMsgAddArticle int = 100 + opWeightMsgPayPublisherRespect = "op_weight_msg_pay_publisher_respect" + // TODO: Determine the simulation weight value + defaultWeightMsgPayPublisherRespect int = 100 + // this line is used by starport scaffolding # simapp/module/const ) @@ -80,6 +84,17 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp cointrunksimulation.SimulateMsgAddArticle(am.accountKeeper, am.bankKeeper, am.keeper), )) + var weightMsgPayPublisherRespect int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgPayPublisherRespect, &weightMsgPayPublisherRespect, nil, + func(_ *rand.Rand) { + weightMsgPayPublisherRespect = defaultWeightMsgPayPublisherRespect + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgPayPublisherRespect, + cointrunksimulation.SimulateMsgPayPublisherRespect(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations diff --git a/x/cointrunk/simulation/pay_publisher_respect.go b/x/cointrunk/simulation/pay_publisher_respect.go new file mode 100644 index 00000000..dd53d87d --- /dev/null +++ b/x/cointrunk/simulation/pay_publisher_respect.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/bze-alphateam/bze/x/cointrunk/keeper" + "github.com/bze-alphateam/bze/x/cointrunk/types" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +func SimulateMsgPayPublisherRespect( + 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.MsgPayPublisherRespect{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the PayPublisherRespect simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "PayPublisherRespect simulation not implemented"), nil, nil + } +} diff --git a/x/cointrunk/types/codec.go b/x/cointrunk/types/codec.go index b8fdd9e4..d0658346 100644 --- a/x/cointrunk/types/codec.go +++ b/x/cointrunk/types/codec.go @@ -13,6 +13,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&AcceptedDomainProposal{}, "cointrunk/AcceptedDomainProposal", nil) cdc.RegisterConcrete(&PublisherProposal{}, "cointrunk/PublisherProposal", nil) cdc.RegisterConcrete(&MsgAddArticle{}, "cointrunk/AddArticle", nil) + cdc.RegisterConcrete(&MsgPayPublisherRespect{}, "cointrunk/PayPublisherRespect", nil) // this line is used by starport scaffolding # 2 } @@ -20,6 +21,9 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgAddArticle{}, ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgPayPublisherRespect{}, + ) // this line is used by starport scaffolding # 3 registry.RegisterImplementations( (*govtypes.Content)(nil), diff --git a/x/cointrunk/types/expected_keepers.go b/x/cointrunk/types/expected_keepers.go index 360b6139..50c1bade 100644 --- a/x/cointrunk/types/expected_keepers.go +++ b/x/cointrunk/types/expected_keepers.go @@ -16,5 +16,10 @@ type AccountKeeper interface { // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error // Methods imported from bank should be defined here } + +type DistrKeeper interface { + FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error +} diff --git a/x/cointrunk/types/message_pay_publisher_respect.go b/x/cointrunk/types/message_pay_publisher_respect.go new file mode 100644 index 00000000..6ac70826 --- /dev/null +++ b/x/cointrunk/types/message_pay_publisher_respect.go @@ -0,0 +1,62 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgPayPublisherRespect = "pay_publisher_respect" + +var _ sdk.Msg = &MsgPayPublisherRespect{} + +func NewMsgPayPublisherRespect(creator string, address string, amount string) *MsgPayPublisherRespect { + return &MsgPayPublisherRespect{ + Creator: creator, + Address: address, + Amount: amount, + } +} + +func (msg *MsgPayPublisherRespect) Route() string { + return RouterKey +} + +func (msg *MsgPayPublisherRespect) Type() string { + return TypeMsgPayPublisherRespect +} + +func (msg *MsgPayPublisherRespect) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgPayPublisherRespect) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgPayPublisherRespect) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + + _, err = sdk.AccAddressFromBech32(msg.Address) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid publisher address (%s)", err) + } + + amount, err := sdk.ParseCoinNormalized(msg.Amount) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidCoins, "invalid amount (%s)", err) + } + + if !amount.IsPositive() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "invalid amount: amount should be positive") + } + + return nil +} diff --git a/x/cointrunk/types/message_pay_publisher_respect_test.go b/x/cointrunk/types/message_pay_publisher_respect_test.go new file mode 100644 index 00000000..310162ae --- /dev/null +++ b/x/cointrunk/types/message_pay_publisher_respect_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + "github.com/bze-alphateam/bze/testutil/sample" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestMsgPayPublisherRespect_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgPayPublisherRespect + err error + }{ + { + name: "invalid address", + msg: MsgPayPublisherRespect{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgPayPublisherRespect{ + 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/cointrunk/types/tx.pb.go b/x/cointrunk/types/tx.pb.go index 4e3d72e2..8c61e7d5 100644 --- a/x/cointrunk/types/tx.pb.go +++ b/x/cointrunk/types/tx.pb.go @@ -131,31 +131,161 @@ func (m *MsgAddArticleResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAddArticleResponse proto.InternalMessageInfo +type MsgPayPublisherRespect struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + Amount string `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *MsgPayPublisherRespect) Reset() { *m = MsgPayPublisherRespect{} } +func (m *MsgPayPublisherRespect) String() string { return proto.CompactTextString(m) } +func (*MsgPayPublisherRespect) ProtoMessage() {} +func (*MsgPayPublisherRespect) Descriptor() ([]byte, []int) { + return fileDescriptor_776bb1586e9b1fcd, []int{2} +} +func (m *MsgPayPublisherRespect) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPayPublisherRespect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPayPublisherRespect.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 *MsgPayPublisherRespect) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPayPublisherRespect.Merge(m, src) +} +func (m *MsgPayPublisherRespect) XXX_Size() int { + return m.Size() +} +func (m *MsgPayPublisherRespect) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPayPublisherRespect.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPayPublisherRespect proto.InternalMessageInfo + +func (m *MsgPayPublisherRespect) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgPayPublisherRespect) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *MsgPayPublisherRespect) GetAmount() string { + if m != nil { + return m.Amount + } + return "" +} + +type MsgPayPublisherRespectResponse struct { + RespectPaid uint64 `protobuf:"varint,1,opt,name=respectPaid,proto3" json:"respectPaid,omitempty"` + PublisherReward string `protobuf:"bytes,2,opt,name=publisherReward,proto3" json:"publisherReward,omitempty"` + CommunityPoolFunds string `protobuf:"bytes,3,opt,name=communityPoolFunds,proto3" json:"communityPoolFunds,omitempty"` +} + +func (m *MsgPayPublisherRespectResponse) Reset() { *m = MsgPayPublisherRespectResponse{} } +func (m *MsgPayPublisherRespectResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPayPublisherRespectResponse) ProtoMessage() {} +func (*MsgPayPublisherRespectResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_776bb1586e9b1fcd, []int{3} +} +func (m *MsgPayPublisherRespectResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPayPublisherRespectResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPayPublisherRespectResponse.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 *MsgPayPublisherRespectResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPayPublisherRespectResponse.Merge(m, src) +} +func (m *MsgPayPublisherRespectResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPayPublisherRespectResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPayPublisherRespectResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPayPublisherRespectResponse proto.InternalMessageInfo + +func (m *MsgPayPublisherRespectResponse) GetRespectPaid() uint64 { + if m != nil { + return m.RespectPaid + } + return 0 +} + +func (m *MsgPayPublisherRespectResponse) GetPublisherReward() string { + if m != nil { + return m.PublisherReward + } + return "" +} + +func (m *MsgPayPublisherRespectResponse) GetCommunityPoolFunds() string { + if m != nil { + return m.CommunityPoolFunds + } + return "" +} + func init() { proto.RegisterType((*MsgAddArticle)(nil), "bze.cointrunk.MsgAddArticle") proto.RegisterType((*MsgAddArticleResponse)(nil), "bze.cointrunk.MsgAddArticleResponse") + proto.RegisterType((*MsgPayPublisherRespect)(nil), "bze.cointrunk.MsgPayPublisherRespect") + proto.RegisterType((*MsgPayPublisherRespectResponse)(nil), "bze.cointrunk.MsgPayPublisherRespectResponse") } func init() { proto.RegisterFile("cointrunk/tx.proto", fileDescriptor_776bb1586e9b1fcd) } var fileDescriptor_776bb1586e9b1fcd = []byte{ - // 244 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4a, 0xce, 0xcf, 0xcc, - 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, - 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x8b, 0x2b, 0xe5, 0x73, 0xf1, 0xfa, 0x16, 0xa7, 0x3b, 0xa6, 0xa4, - 0x38, 0x16, 0x95, 0x64, 0x26, 0xe7, 0xa4, 0x0a, 0xc9, 0x70, 0x71, 0x16, 0x94, 0x26, 0xe5, 0x64, - 0x16, 0x67, 0xa4, 0x16, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x21, 0x04, 0x84, 0x44, 0xb8, - 0x58, 0x4b, 0x32, 0x4b, 0x72, 0x52, 0x25, 0x98, 0xc0, 0x32, 0x10, 0x8e, 0x90, 0x00, 0x17, 0x73, - 0x69, 0x51, 0x8e, 0x04, 0x33, 0x58, 0x0c, 0xc4, 0x14, 0x92, 0xe0, 0x62, 0x2f, 0xc8, 0x4c, 0x2e, - 0x29, 0x2d, 0x4a, 0x95, 0x60, 0x01, 0x8b, 0xc2, 0xb8, 0x4a, 0xe2, 0x5c, 0xa2, 0x28, 0x16, 0x06, - 0xa5, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x1a, 0x85, 0x73, 0x31, 0xfb, 0x16, 0xa7, 0x0b, 0x05, - 0x70, 0x71, 0x21, 0xbb, 0x46, 0x0f, 0xc5, 0xb9, 0x7a, 0x28, 0x5a, 0xa5, 0x54, 0xf0, 0xc9, 0xc2, - 0x0c, 0x76, 0xf2, 0x38, 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, 0xbd, 0xf4, - 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xa4, 0xaa, 0x54, 0xdd, 0xc4, 0x9c, - 0x82, 0x8c, 0xc4, 0x92, 0xd4, 0x44, 0x30, 0x4f, 0xbf, 0x42, 0x1f, 0x29, 0xf8, 0x2a, 0x0b, 0x52, - 0x8b, 0x93, 0xd8, 0xc0, 0x41, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x64, 0xd1, 0x3c, - 0x58, 0x01, 0x00, 0x00, + // 372 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcd, 0x4a, 0xf3, 0x40, + 0x14, 0x6d, 0xbe, 0xf6, 0xab, 0xf4, 0x4a, 0x51, 0x46, 0xad, 0xa1, 0x48, 0x28, 0x41, 0xa1, 0x9b, + 0x26, 0xa0, 0x4f, 0x50, 0x17, 0xe2, 0xa6, 0x10, 0xba, 0x74, 0x37, 0xc9, 0x0c, 0xe9, 0xd0, 0x24, + 0x13, 0xe6, 0x07, 0xdb, 0x3e, 0x85, 0x0f, 0xe0, 0xe3, 0xb8, 0x70, 0xd9, 0xa5, 0x4b, 0x69, 0x5f, + 0x44, 0x92, 0x26, 0xfd, 0xd1, 0x20, 0xee, 0x72, 0xce, 0xb9, 0x37, 0xe7, 0xcc, 0xbd, 0x17, 0x50, + 0xc0, 0x59, 0xa2, 0x84, 0x4e, 0xa6, 0xae, 0x9a, 0x39, 0xa9, 0xe0, 0x8a, 0xa3, 0xb6, 0xbf, 0xa0, + 0xce, 0x96, 0xb7, 0x39, 0xb4, 0x47, 0x32, 0x1c, 0x12, 0x32, 0x14, 0x8a, 0x05, 0x11, 0x45, 0x57, + 0xd0, 0x4a, 0xb5, 0x1f, 0x31, 0x39, 0xa1, 0xc2, 0x34, 0x7a, 0x46, 0xbf, 0x35, 0xde, 0x11, 0xe8, + 0x1c, 0xfe, 0x2b, 0xa6, 0x22, 0x6a, 0xfe, 0xcb, 0x95, 0x0d, 0x40, 0xa7, 0x50, 0xd7, 0x22, 0x32, + 0xeb, 0x39, 0x97, 0x7d, 0x22, 0x13, 0x8e, 0x52, 0x16, 0x28, 0x2d, 0xa8, 0xd9, 0xc8, 0xd9, 0x12, + 0xda, 0x97, 0x70, 0x71, 0x60, 0x38, 0xa6, 0x32, 0xe5, 0x89, 0xa4, 0x36, 0x81, 0xce, 0x48, 0x86, + 0x1e, 0x9e, 0x7b, 0xa5, 0x5b, 0x26, 0xd1, 0x40, 0x65, 0x3f, 0x0b, 0x04, 0xc5, 0x8a, 0x97, 0x81, + 0x4a, 0x98, 0x29, 0x98, 0x10, 0x41, 0xa5, 0x2c, 0x02, 0x95, 0x10, 0x75, 0xa0, 0x89, 0x63, 0xae, + 0x13, 0x55, 0xa4, 0x2a, 0x90, 0xfd, 0x6a, 0x80, 0x55, 0x6d, 0x53, 0x06, 0x41, 0x3d, 0x38, 0x16, + 0x1b, 0xca, 0xc3, 0x8c, 0xe4, 0x96, 0x8d, 0xf1, 0x3e, 0x85, 0xfa, 0x70, 0x92, 0xee, 0xba, 0x9f, + 0xb1, 0x20, 0x85, 0xfd, 0x77, 0x1a, 0x39, 0xd9, 0x0e, 0xe2, 0x58, 0x27, 0x4c, 0xcd, 0x3d, 0xce, + 0xa3, 0x07, 0x9d, 0x10, 0x59, 0x44, 0xaa, 0x50, 0x6e, 0xdf, 0x0c, 0xa8, 0x8f, 0x64, 0x88, 0x3c, + 0x80, 0xfd, 0x9d, 0x38, 0x07, 0x4b, 0x73, 0x0e, 0x06, 0xd8, 0xbd, 0xfe, 0x4d, 0xdd, 0xbe, 0x6a, + 0x0a, 0x67, 0x55, 0xb3, 0xbd, 0xf9, 0xd9, 0x5c, 0x51, 0xd6, 0x1d, 0xfc, 0xa9, 0xac, 0x34, 0xbb, + 0x7f, 0x7c, 0x5f, 0x59, 0xc6, 0x72, 0x65, 0x19, 0x9f, 0x2b, 0xcb, 0x78, 0x59, 0x5b, 0xb5, 0xe5, + 0xda, 0xaa, 0x7d, 0xac, 0xad, 0xda, 0x93, 0x13, 0x32, 0x35, 0xd1, 0xbe, 0x13, 0xf0, 0xd8, 0xf5, + 0x17, 0x74, 0x80, 0xa3, 0x74, 0x82, 0x15, 0xc5, 0x39, 0x72, 0x67, 0xee, 0xde, 0xc5, 0xce, 0x53, + 0x2a, 0xfd, 0x66, 0x7e, 0xb5, 0x77, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc0, 0xf8, 0x48, 0x2c, + 0xcb, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -171,6 +301,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 { AddArticle(ctx context.Context, in *MsgAddArticle, opts ...grpc.CallOption) (*MsgAddArticleResponse, error) + PayPublisherRespect(ctx context.Context, in *MsgPayPublisherRespect, opts ...grpc.CallOption) (*MsgPayPublisherRespectResponse, error) } type msgClient struct { @@ -190,9 +321,19 @@ func (c *msgClient) AddArticle(ctx context.Context, in *MsgAddArticle, opts ...g return out, nil } +func (c *msgClient) PayPublisherRespect(ctx context.Context, in *MsgPayPublisherRespect, opts ...grpc.CallOption) (*MsgPayPublisherRespectResponse, error) { + out := new(MsgPayPublisherRespectResponse) + err := c.cc.Invoke(ctx, "/bze.cointrunk.Msg/PayPublisherRespect", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { AddArticle(context.Context, *MsgAddArticle) (*MsgAddArticleResponse, error) + PayPublisherRespect(context.Context, *MsgPayPublisherRespect) (*MsgPayPublisherRespectResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -202,6 +343,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) AddArticle(ctx context.Context, req *MsgAddArticle) (*MsgAddArticleResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddArticle not implemented") } +func (*UnimplementedMsgServer) PayPublisherRespect(ctx context.Context, req *MsgPayPublisherRespect) (*MsgPayPublisherRespectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PayPublisherRespect not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -225,6 +369,24 @@ func _Msg_AddArticle_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +func _Msg_PayPublisherRespect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPayPublisherRespect) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).PayPublisherRespect(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bze.cointrunk.Msg/PayPublisherRespect", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).PayPublisherRespect(ctx, req.(*MsgPayPublisherRespect)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "bze.cointrunk.Msg", HandlerType: (*MsgServer)(nil), @@ -233,6 +395,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "AddArticle", Handler: _Msg_AddArticle_Handler, }, + { + MethodName: "PayPublisherRespect", + Handler: _Msg_PayPublisherRespect_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cointrunk/tx.proto", @@ -312,6 +478,92 @@ func (m *MsgAddArticleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgPayPublisherRespect) 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 *MsgPayPublisherRespect) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPayPublisherRespect) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + i -= len(m.Amount) + copy(dAtA[i:], m.Amount) + i = encodeVarintTx(dAtA, i, uint64(len(m.Amount))) + i-- + dAtA[i] = 0x1a + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + 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 *MsgPayPublisherRespectResponse) 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 *MsgPayPublisherRespectResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPayPublisherRespectResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CommunityPoolFunds) > 0 { + i -= len(m.CommunityPoolFunds) + copy(dAtA[i:], m.CommunityPoolFunds) + i = encodeVarintTx(dAtA, i, uint64(len(m.CommunityPoolFunds))) + i-- + dAtA[i] = 0x1a + } + if len(m.PublisherReward) > 0 { + i -= len(m.PublisherReward) + copy(dAtA[i:], m.PublisherReward) + i = encodeVarintTx(dAtA, i, uint64(len(m.PublisherReward))) + i-- + dAtA[i] = 0x12 + } + if m.RespectPaid != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.RespectPaid)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -357,6 +609,47 @@ func (m *MsgAddArticleResponse) Size() (n int) { return n } +func (m *MsgPayPublisherRespect) 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)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Amount) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgPayPublisherRespectResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RespectPaid != 0 { + n += 1 + sovTx(uint64(m.RespectPaid)) + } + l = len(m.PublisherReward) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.CommunityPoolFunds) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -591,6 +884,285 @@ func (m *MsgAddArticleResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgPayPublisherRespect) 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: MsgPayPublisherRespect: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPayPublisherRespect: 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 != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount = 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 *MsgPayPublisherRespectResponse) 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: MsgPayPublisherRespectResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPayPublisherRespectResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RespectPaid", wireType) + } + m.RespectPaid = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RespectPaid |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublisherReward", 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.PublisherReward = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommunityPoolFunds", 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.CommunityPoolFunds = 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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From a99208c01ceca1deac66233f43d306aa47af7f34 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Tue, 27 Dec 2022 17:04:20 +0200 Subject: [PATCH 44/54] modified cointrunk paypublisherrespect response --- go.mod | 3 + go.sum | 5 + proto/cointrunk/tx.proto | 4 +- .../msg_server_pay_publisher_respect.go | 4 +- x/cointrunk/types/tx.pb.go | 126 +++++++----------- 5 files changed, 59 insertions(+), 83 deletions(-) diff --git a/go.mod b/go.mod index f108c1ed..95260012 100644 --- a/go.mod +++ b/go.mod @@ -54,11 +54,13 @@ require ( github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.4 // 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.5.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect + github.com/golang/glog v1.0.0 // indirect github.com/golang/snappy v0.0.3 // indirect github.com/google/btree v1.0.0 // indirect github.com/google/go-cmp v0.5.9 // indirect @@ -67,6 +69,7 @@ require ( github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect diff --git a/go.sum b/go.sum index f174aa5f..81fcb86a 100644 --- a/go.sum +++ b/go.sum @@ -528,6 +528,7 @@ github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASx github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +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= @@ -633,6 +634,8 @@ github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/ github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -790,6 +793,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= 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.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= diff --git a/proto/cointrunk/tx.proto b/proto/cointrunk/tx.proto index 688623e1..c2dc601d 100644 --- a/proto/cointrunk/tx.proto +++ b/proto/cointrunk/tx.proto @@ -30,8 +30,8 @@ message MsgPayPublisherRespect { message MsgPayPublisherRespectResponse { uint64 respectPaid = 1; - string publisherReward = 2; - string communityPoolFunds = 3; + uint64 publisherReward = 2; + uint64 communityPoolFunds = 3; } // this line is used by starport scaffolding # proto/tx/message \ No newline at end of file diff --git a/x/cointrunk/keeper/msg_server_pay_publisher_respect.go b/x/cointrunk/keeper/msg_server_pay_publisher_respect.go index b198b2e7..b25b753b 100644 --- a/x/cointrunk/keeper/msg_server_pay_publisher_respect.go +++ b/x/cointrunk/keeper/msg_server_pay_publisher_respect.go @@ -68,7 +68,7 @@ func (k msgServer) PayPublisherRespect(goCtx context.Context, msg *types.MsgPayP return &types.MsgPayPublisherRespectResponse{ RespectPaid: coin.Amount.Uint64(), - PublisherReward: publisherRewardCoin.String(), - CommunityPoolFunds: taxPaidCoin.String(), + PublisherReward: publisherRewardCoin.Amount.Uint64(), + CommunityPoolFunds: taxPaidCoin.Amount.Uint64(), }, nil } diff --git a/x/cointrunk/types/tx.pb.go b/x/cointrunk/types/tx.pb.go index 8c61e7d5..d43c0e6c 100644 --- a/x/cointrunk/types/tx.pb.go +++ b/x/cointrunk/types/tx.pb.go @@ -193,8 +193,8 @@ func (m *MsgPayPublisherRespect) GetAmount() string { type MsgPayPublisherRespectResponse struct { RespectPaid uint64 `protobuf:"varint,1,opt,name=respectPaid,proto3" json:"respectPaid,omitempty"` - PublisherReward string `protobuf:"bytes,2,opt,name=publisherReward,proto3" json:"publisherReward,omitempty"` - CommunityPoolFunds string `protobuf:"bytes,3,opt,name=communityPoolFunds,proto3" json:"communityPoolFunds,omitempty"` + PublisherReward uint64 `protobuf:"varint,2,opt,name=publisherReward,proto3" json:"publisherReward,omitempty"` + CommunityPoolFunds uint64 `protobuf:"varint,3,opt,name=communityPoolFunds,proto3" json:"communityPoolFunds,omitempty"` } func (m *MsgPayPublisherRespectResponse) Reset() { *m = MsgPayPublisherRespectResponse{} } @@ -237,18 +237,18 @@ func (m *MsgPayPublisherRespectResponse) GetRespectPaid() uint64 { return 0 } -func (m *MsgPayPublisherRespectResponse) GetPublisherReward() string { +func (m *MsgPayPublisherRespectResponse) GetPublisherReward() uint64 { if m != nil { return m.PublisherReward } - return "" + return 0 } -func (m *MsgPayPublisherRespectResponse) GetCommunityPoolFunds() string { +func (m *MsgPayPublisherRespectResponse) GetCommunityPoolFunds() uint64 { if m != nil { return m.CommunityPoolFunds } - return "" + return 0 } func init() { @@ -261,31 +261,31 @@ func init() { func init() { proto.RegisterFile("cointrunk/tx.proto", fileDescriptor_776bb1586e9b1fcd) } var fileDescriptor_776bb1586e9b1fcd = []byte{ - // 372 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcd, 0x4a, 0xf3, 0x40, - 0x14, 0x6d, 0xbe, 0xf6, 0xab, 0xf4, 0x4a, 0x51, 0x46, 0xad, 0xa1, 0x48, 0x28, 0x41, 0xa1, 0x9b, - 0x26, 0xa0, 0x4f, 0x50, 0x17, 0xe2, 0xa6, 0x10, 0xba, 0x74, 0x37, 0xc9, 0x0c, 0xe9, 0xd0, 0x24, - 0x13, 0xe6, 0x07, 0xdb, 0x3e, 0x85, 0x0f, 0xe0, 0xe3, 0xb8, 0x70, 0xd9, 0xa5, 0x4b, 0x69, 0x5f, - 0x44, 0x92, 0x26, 0xfd, 0xd1, 0x20, 0xee, 0x72, 0xce, 0xb9, 0x37, 0xe7, 0xcc, 0xbd, 0x17, 0x50, - 0xc0, 0x59, 0xa2, 0x84, 0x4e, 0xa6, 0xae, 0x9a, 0x39, 0xa9, 0xe0, 0x8a, 0xa3, 0xb6, 0xbf, 0xa0, - 0xce, 0x96, 0xb7, 0x39, 0xb4, 0x47, 0x32, 0x1c, 0x12, 0x32, 0x14, 0x8a, 0x05, 0x11, 0x45, 0x57, - 0xd0, 0x4a, 0xb5, 0x1f, 0x31, 0x39, 0xa1, 0xc2, 0x34, 0x7a, 0x46, 0xbf, 0x35, 0xde, 0x11, 0xe8, - 0x1c, 0xfe, 0x2b, 0xa6, 0x22, 0x6a, 0xfe, 0xcb, 0x95, 0x0d, 0x40, 0xa7, 0x50, 0xd7, 0x22, 0x32, - 0xeb, 0x39, 0x97, 0x7d, 0x22, 0x13, 0x8e, 0x52, 0x16, 0x28, 0x2d, 0xa8, 0xd9, 0xc8, 0xd9, 0x12, - 0xda, 0x97, 0x70, 0x71, 0x60, 0x38, 0xa6, 0x32, 0xe5, 0x89, 0xa4, 0x36, 0x81, 0xce, 0x48, 0x86, - 0x1e, 0x9e, 0x7b, 0xa5, 0x5b, 0x26, 0xd1, 0x40, 0x65, 0x3f, 0x0b, 0x04, 0xc5, 0x8a, 0x97, 0x81, - 0x4a, 0x98, 0x29, 0x98, 0x10, 0x41, 0xa5, 0x2c, 0x02, 0x95, 0x10, 0x75, 0xa0, 0x89, 0x63, 0xae, - 0x13, 0x55, 0xa4, 0x2a, 0x90, 0xfd, 0x6a, 0x80, 0x55, 0x6d, 0x53, 0x06, 0x41, 0x3d, 0x38, 0x16, - 0x1b, 0xca, 0xc3, 0x8c, 0xe4, 0x96, 0x8d, 0xf1, 0x3e, 0x85, 0xfa, 0x70, 0x92, 0xee, 0xba, 0x9f, - 0xb1, 0x20, 0x85, 0xfd, 0x77, 0x1a, 0x39, 0xd9, 0x0e, 0xe2, 0x58, 0x27, 0x4c, 0xcd, 0x3d, 0xce, - 0xa3, 0x07, 0x9d, 0x10, 0x59, 0x44, 0xaa, 0x50, 0x6e, 0xdf, 0x0c, 0xa8, 0x8f, 0x64, 0x88, 0x3c, - 0x80, 0xfd, 0x9d, 0x38, 0x07, 0x4b, 0x73, 0x0e, 0x06, 0xd8, 0xbd, 0xfe, 0x4d, 0xdd, 0xbe, 0x6a, - 0x0a, 0x67, 0x55, 0xb3, 0xbd, 0xf9, 0xd9, 0x5c, 0x51, 0xd6, 0x1d, 0xfc, 0xa9, 0xac, 0x34, 0xbb, - 0x7f, 0x7c, 0x5f, 0x59, 0xc6, 0x72, 0x65, 0x19, 0x9f, 0x2b, 0xcb, 0x78, 0x59, 0x5b, 0xb5, 0xe5, - 0xda, 0xaa, 0x7d, 0xac, 0xad, 0xda, 0x93, 0x13, 0x32, 0x35, 0xd1, 0xbe, 0x13, 0xf0, 0xd8, 0xf5, - 0x17, 0x74, 0x80, 0xa3, 0x74, 0x82, 0x15, 0xc5, 0x39, 0x72, 0x67, 0xee, 0xde, 0xc5, 0xce, 0x53, - 0x2a, 0xfd, 0x66, 0x7e, 0xb5, 0x77, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc0, 0xf8, 0x48, 0x2c, - 0xcb, 0x02, 0x00, 0x00, + // 378 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcb, 0x6a, 0xdb, 0x40, + 0x14, 0xb5, 0x6a, 0xd5, 0xc5, 0xb7, 0x98, 0x96, 0x69, 0xeb, 0x0a, 0x53, 0x84, 0x11, 0x2d, 0x78, + 0x63, 0x09, 0x9a, 0x2f, 0x70, 0x16, 0x21, 0x1b, 0x83, 0xd0, 0x32, 0xbb, 0x91, 0x66, 0x90, 0x07, + 0x4b, 0x1a, 0x31, 0x0f, 0x62, 0xfb, 0x2b, 0xf2, 0x01, 0xf9, 0x9c, 0x2c, 0xb2, 0xf4, 0x32, 0xcb, + 0x60, 0xff, 0x48, 0xd0, 0xd8, 0xf2, 0x23, 0x11, 0x21, 0x3b, 0x9d, 0x73, 0xee, 0xd5, 0x39, 0x73, + 0xef, 0x05, 0x94, 0x70, 0x56, 0x28, 0xa1, 0x8b, 0x79, 0xa0, 0x16, 0x7e, 0x29, 0xb8, 0xe2, 0xa8, + 0x17, 0xaf, 0xa8, 0x7f, 0xe0, 0x3d, 0x0e, 0xbd, 0xa9, 0x4c, 0x27, 0x84, 0x4c, 0x84, 0x62, 0x49, + 0x46, 0xd1, 0x1f, 0xe8, 0x96, 0x3a, 0xce, 0x98, 0x9c, 0x51, 0xe1, 0x58, 0x43, 0x6b, 0xd4, 0x8d, + 0x8e, 0x04, 0xfa, 0x09, 0x9f, 0x15, 0x53, 0x19, 0x75, 0x3e, 0x19, 0x65, 0x07, 0xd0, 0x77, 0x68, + 0x6b, 0x91, 0x39, 0x6d, 0xc3, 0x55, 0x9f, 0xc8, 0x81, 0x2f, 0x25, 0x4b, 0x94, 0x16, 0xd4, 0xb1, + 0x0d, 0x5b, 0x43, 0xef, 0x37, 0xfc, 0x3a, 0x33, 0x8c, 0xa8, 0x2c, 0x79, 0x21, 0xa9, 0x47, 0xa0, + 0x3f, 0x95, 0x69, 0x88, 0x97, 0x61, 0xed, 0x56, 0x49, 0x34, 0x51, 0xd5, 0xcf, 0x12, 0x41, 0xb1, + 0xe2, 0x75, 0xa0, 0x1a, 0x56, 0x0a, 0x26, 0x44, 0x50, 0x29, 0xf7, 0x81, 0x6a, 0x88, 0xfa, 0xd0, + 0xc1, 0x39, 0xd7, 0x85, 0xda, 0xa7, 0xda, 0x23, 0xef, 0xde, 0x02, 0xb7, 0xd9, 0xa6, 0x0e, 0x82, + 0x86, 0xf0, 0x55, 0xec, 0xa8, 0x10, 0x33, 0x62, 0x2c, 0xed, 0xe8, 0x94, 0x42, 0x23, 0xf8, 0x56, + 0x1e, 0xbb, 0x6f, 0xb1, 0x20, 0xc6, 0xde, 0x8e, 0x5e, 0xd3, 0xc8, 0xaf, 0x76, 0x90, 0xe7, 0xba, + 0x60, 0x6a, 0x19, 0x72, 0x9e, 0x5d, 0xe9, 0x82, 0x48, 0x13, 0xc9, 0x8e, 0x1a, 0x94, 0xff, 0x0f, + 0x16, 0xb4, 0xa7, 0x32, 0x45, 0x21, 0xc0, 0xe9, 0x4e, 0xfc, 0xb3, 0xa5, 0xf9, 0x67, 0x03, 0x1c, + 0xfc, 0x7d, 0x4f, 0x3d, 0xbc, 0x6a, 0x0e, 0x3f, 0x9a, 0x66, 0xfb, 0xef, 0x6d, 0x73, 0x43, 0xd9, + 0x60, 0xfc, 0xa1, 0xb2, 0xda, 0xec, 0xf2, 0xfa, 0x71, 0xe3, 0x5a, 0xeb, 0x8d, 0x6b, 0x3d, 0x6f, + 0x5c, 0xeb, 0x6e, 0xeb, 0xb6, 0xd6, 0x5b, 0xb7, 0xf5, 0xb4, 0x75, 0x5b, 0x37, 0x7e, 0xca, 0xd4, + 0x4c, 0xc7, 0x7e, 0xc2, 0xf3, 0x20, 0x5e, 0xd1, 0x31, 0xce, 0xca, 0x19, 0x56, 0x14, 0x1b, 0x14, + 0x2c, 0x82, 0x93, 0x8b, 0x5d, 0x96, 0x54, 0xc6, 0x1d, 0x73, 0xb5, 0x17, 0x2f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xac, 0x86, 0xd0, 0x4d, 0xcb, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -542,19 +542,15 @@ func (m *MsgPayPublisherRespectResponse) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l - if len(m.CommunityPoolFunds) > 0 { - i -= len(m.CommunityPoolFunds) - copy(dAtA[i:], m.CommunityPoolFunds) - i = encodeVarintTx(dAtA, i, uint64(len(m.CommunityPoolFunds))) + if m.CommunityPoolFunds != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CommunityPoolFunds)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x18 } - if len(m.PublisherReward) > 0 { - i -= len(m.PublisherReward) - copy(dAtA[i:], m.PublisherReward) - i = encodeVarintTx(dAtA, i, uint64(len(m.PublisherReward))) + if m.PublisherReward != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.PublisherReward)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } if m.RespectPaid != 0 { i = encodeVarintTx(dAtA, i, uint64(m.RespectPaid)) @@ -639,13 +635,11 @@ func (m *MsgPayPublisherRespectResponse) Size() (n int) { if m.RespectPaid != 0 { n += 1 + sovTx(uint64(m.RespectPaid)) } - l = len(m.PublisherReward) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.PublisherReward != 0 { + n += 1 + sovTx(uint64(m.PublisherReward)) } - l = len(m.CommunityPoolFunds) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.CommunityPoolFunds != 0 { + n += 1 + sovTx(uint64(m.CommunityPoolFunds)) } return n } @@ -1079,10 +1073,10 @@ func (m *MsgPayPublisherRespectResponse) Unmarshal(dAtA []byte) error { } } case 2: - if wireType != 2 { + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PublisherReward", wireType) } - var stringLen uint64 + m.PublisherReward = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1092,29 +1086,16 @@ func (m *MsgPayPublisherRespectResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.PublisherReward |= 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.PublisherReward = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 3: - if wireType != 2 { + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CommunityPoolFunds", wireType) } - var stringLen uint64 + m.CommunityPoolFunds = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1124,24 +1105,11 @@ func (m *MsgPayPublisherRespectResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.CommunityPoolFunds |= 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.CommunityPoolFunds = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From c7cc582ef689069a7cb386732bd4aa774f952a4c Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Wed, 28 Dec 2022 16:58:07 +0200 Subject: [PATCH 45/54] added params for pay publisher respect --- docs/static/openapi.yml | 73 +- go.mod | 3 - go.sum | 5 - proto/burner/genesis.proto | 5 +- proto/cointrunk/accepted_domain.proto | 2 +- .../cointrunk/accepted_domain_proposal.proto | 2 +- proto/cointrunk/anon_articles_counter.proto | 2 +- proto/cointrunk/article.proto | 2 +- proto/cointrunk/genesis.proto | 25 +- proto/cointrunk/params.proto | 17 +- proto/cointrunk/publisher.proto | 2 +- proto/cointrunk/publisher_proposal.proto | 2 +- proto/cointrunk/query.proto | 2 +- proto/cointrunk/tx.proto | 2 +- testutil/keeper/cointrunk.go | 1 + .../bze/bze.cointrunk.v1/index.ts | 372 ++ .../bze/bze.cointrunk.v1/module/index.ts | 63 + .../bze/bze.cointrunk.v1/module/rest.ts | 577 ++ .../module/types/cointrunk/accepted_domain.ts | 92 + .../cointrunk/accepted_domain_proposal.ts | 139 + .../types/cointrunk/anon_articles_counter.ts | 118 + .../module/types/cointrunk/article.ts | 213 + .../module/types/cointrunk/genesis.ts | 218 + .../module/types/cointrunk/params.ts | 252 + .../module/types/cointrunk/publisher.ts | 195 + .../types/cointrunk/publisher_proposal.ts | 153 + .../module/types/cointrunk/query.ts | 1108 ++++ .../module/types/cointrunk/tx.ts | 477 ++ .../cosmos/base/query/v1beta1/pagination.ts | 328 + .../module/types/cosmos/base/v1beta1/coin.ts | 301 + .../module/types/gogoproto/gogo.ts | 2 + .../module/types/google/api/annotations.ts | 2 + .../module/types/google/api/http.ts | 706 +++ .../types/google/protobuf/descriptor.ts | 5314 +++++++++++++++++ .../bze/bze.cointrunk.v1/package.json | 18 + .../bze/bze.cointrunk.v1/vuex-root | 1 + .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +- .../bze/bze.scavenge/module/index.ts | 6 +- vue/src/store/generated/index.ts | 2 + x/burner/types/genesis.pb.go | 26 +- x/cointrunk/keeper/params.go | 7 + x/cointrunk/types/accepted_domain.pb.go | 23 +- .../types/accepted_domain_proposal.pb.go | 28 +- x/cointrunk/types/anon_articles_counter.pb.go | 22 +- x/cointrunk/types/article.pb.go | 34 +- x/cointrunk/types/genesis.pb.go | 62 +- x/cointrunk/types/params.go | 39 +- x/cointrunk/types/params.pb.go | 329 +- x/cointrunk/types/publisher.pb.go | 36 +- x/cointrunk/types/publisher_proposal.pb.go | 34 +- x/cointrunk/types/query.pb.go | 150 +- x/cointrunk/types/tx.pb.go | 68 +- 52 files changed, 11364 insertions(+), 328 deletions(-) create mode 100755 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts create mode 100755 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/accepted_domain.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/accepted_domain_proposal.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/anon_articles_counter.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/article.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/genesis.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/params.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/publisher.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/publisher_proposal.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/query.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/tx.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cosmos/base/query/v1beta1/pagination.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cosmos/base/v1beta1/coin.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/gogoproto/gogo.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/google/api/annotations.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/google/api/http.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/google/protobuf/descriptor.ts create mode 100755 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/package.json create mode 100755 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/vuex-root diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 918a671c..0cc70b84 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -165,7 +165,7 @@ paths: /bze/cointrunk/v1/accepted_domain: get: summary: Queries a list of AcceptedDomain items. - operationId: BzeCointrunkAcceptedDomain + operationId: BzeCointrunkV1AcceptedDomain responses: '200': description: A successful response. @@ -288,7 +288,7 @@ paths: /bze/cointrunk/v1/all_anon_articles_counters: get: summary: Queries a list of AllAnonArticlesCounters items. - operationId: BzeCointrunkAllAnonArticlesCounters + operationId: BzeCointrunkV1AllAnonArticlesCounters responses: '200': description: A successful response. @@ -412,7 +412,7 @@ paths: /bze/cointrunk/v1/articles: get: summary: Queries a list of ArticlesByPrefix items. - operationId: BzeCointrunkAllArticles + operationId: BzeCointrunkV1AllArticles responses: '200': description: A successful response. @@ -547,7 +547,7 @@ paths: /bze/cointrunk/v1/params: get: summary: Parameters queries the parameters of the module. - operationId: BzeCointrunkParams + operationId: BzeCointrunkV1Params responses: '200': description: A successful response. @@ -576,6 +576,14 @@ paths: custom method signatures required by gogoproto. + publisherRespectParams: + type: object + properties: + tax: + type: string + denom: + type: string + description: Params defines the parameters for the module. description: >- QueryParamsResponse is response type for the Query/Params RPC method. @@ -602,7 +610,7 @@ paths: '/bze/cointrunk/v1/publisher/{index}': get: summary: Queries publisher by index/address. - operationId: BzeCointrunkPublisherByIndex + operationId: BzeCointrunkV1PublisherByIndex responses: '200': description: A successful response. @@ -655,7 +663,7 @@ paths: /bze/cointrunk/v1/publishers: get: summary: Queries a list of Publisher items. - operationId: BzeCointrunkPublisher + operationId: BzeCointrunkV1Publisher responses: '200': description: A successful response. @@ -32668,14 +32676,14 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - bze.cointrunk.AcceptedDomain: + bze.cointrunk.v1.AcceptedDomain: type: object properties: domain: type: string active: type: boolean - bze.cointrunk.AnonArticlesCounter: + bze.cointrunk.v1.AnonArticlesCounter: type: object properties: key: @@ -32683,7 +32691,7 @@ definitions: counter: type: string format: uint64 - bze.cointrunk.Article: + bze.cointrunk.v1.Article: type: object properties: id: @@ -32702,9 +32710,9 @@ definitions: createdAt: type: string format: int64 - bze.cointrunk.MsgAddArticleResponse: + bze.cointrunk.v1.MsgAddArticleResponse: type: object - bze.cointrunk.MsgPayPublisherRespectResponse: + bze.cointrunk.v1.MsgPayPublisherRespectResponse: type: object properties: respectPaid: @@ -32712,9 +32720,11 @@ definitions: format: uint64 publisherReward: type: string + format: uint64 communityPoolFunds: type: string - bze.cointrunk.Params: + format: uint64 + bze.cointrunk.v1.Params: type: object properties: anonArticleLimit: @@ -32732,8 +32742,15 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. - description: Params defines the parameters for the module. - bze.cointrunk.Publisher: + publisherRespectParams: + type: object + properties: + tax: + type: string + denom: + type: string + description: Params defines the parameters for the module. + bze.cointrunk.v1.Publisher: type: object properties: name: @@ -32751,7 +32768,15 @@ definitions: respect: type: string format: int64 - bze.cointrunk.QueryAcceptedDomainResponse: + bze.cointrunk.v1.PublisherRespectParams: + type: object + properties: + tax: + type: string + denom: + type: string + description: Params defines the parameters for the module. + bze.cointrunk.v1.QueryAcceptedDomainResponse: type: object properties: acceptedDomain: @@ -32788,7 +32813,7 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - bze.cointrunk.QueryAllAnonArticlesCountersResponse: + bze.cointrunk.v1.QueryAllAnonArticlesCountersResponse: type: object properties: AnonArticlesCounters: @@ -32826,7 +32851,7 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - bze.cointrunk.QueryAllArticlesResponse: + bze.cointrunk.v1.QueryAllArticlesResponse: type: object properties: article: @@ -32875,7 +32900,7 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - bze.cointrunk.QueryParamsResponse: + bze.cointrunk.v1.QueryParamsResponse: type: object properties: params: @@ -32900,8 +32925,16 @@ definitions: method signatures required by gogoproto. + publisherRespectParams: + type: object + properties: + tax: + type: string + denom: + type: string + description: Params defines the parameters for the module. description: QueryParamsResponse is response type for the Query/Params RPC method. - bze.cointrunk.QueryPublisherByIndexResponse: + bze.cointrunk.v1.QueryPublisherByIndexResponse: type: object properties: publisher: @@ -32922,7 +32955,7 @@ definitions: respect: type: string format: int64 - bze.cointrunk.QueryPublisherResponse: + bze.cointrunk.v1.QueryPublisherResponse: type: object properties: publisher: diff --git a/go.mod b/go.mod index 95260012..f108c1ed 100644 --- a/go.mod +++ b/go.mod @@ -54,13 +54,11 @@ require ( github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.4 // 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.5.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect - github.com/golang/glog v1.0.0 // indirect github.com/golang/snappy v0.0.3 // indirect github.com/google/btree v1.0.0 // indirect github.com/google/go-cmp v0.5.9 // indirect @@ -69,7 +67,6 @@ require ( github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect diff --git a/go.sum b/go.sum index 81fcb86a..f174aa5f 100644 --- a/go.sum +++ b/go.sum @@ -528,7 +528,6 @@ github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASx github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -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= @@ -634,8 +633,6 @@ github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/ github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -793,8 +790,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= 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.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= diff --git a/proto/burner/genesis.proto b/proto/burner/genesis.proto index 931b7bc4..563ddbcb 100644 --- a/proto/burner/genesis.proto +++ b/proto/burner/genesis.proto @@ -11,6 +11,9 @@ option go_package = "github.com/bze-alphateam/bze/x/burner/types"; // GenesisState defines the burner module's genesis state. message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; - repeated BurnedCoins BurnedCoinsList = 2 [(gogoproto.nullable) = false]; + repeated BurnedCoins BurnedCoinsList = 2 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "burned_coins_list,omitempty" + ]; // this line is used by starport scaffolding # genesis/proto/state } diff --git a/proto/cointrunk/accepted_domain.proto b/proto/cointrunk/accepted_domain.proto index 013f39d8..df8e29be 100644 --- a/proto/cointrunk/accepted_domain.proto +++ b/proto/cointrunk/accepted_domain.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package bze.cointrunk; +package bze.cointrunk.v1; option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; diff --git a/proto/cointrunk/accepted_domain_proposal.proto b/proto/cointrunk/accepted_domain_proposal.proto index 2d9b3080..16b1cafe 100644 --- a/proto/cointrunk/accepted_domain_proposal.proto +++ b/proto/cointrunk/accepted_domain_proposal.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package bze.cointrunk; +package bze.cointrunk.v1; option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; diff --git a/proto/cointrunk/anon_articles_counter.proto b/proto/cointrunk/anon_articles_counter.proto index b74b7410..cb630793 100644 --- a/proto/cointrunk/anon_articles_counter.proto +++ b/proto/cointrunk/anon_articles_counter.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package bze.cointrunk; +package bze.cointrunk.v1; option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; diff --git a/proto/cointrunk/article.proto b/proto/cointrunk/article.proto index cdd7e1ac..9b958953 100644 --- a/proto/cointrunk/article.proto +++ b/proto/cointrunk/article.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package bze.cointrunk; +package bze.cointrunk.v1; option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; diff --git a/proto/cointrunk/genesis.proto b/proto/cointrunk/genesis.proto index 83809cf6..b3519c1b 100644 --- a/proto/cointrunk/genesis.proto +++ b/proto/cointrunk/genesis.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package bze.cointrunk; +package bze.cointrunk.v1; import "gogoproto/gogo.proto"; import "cointrunk/params.proto"; @@ -12,10 +12,23 @@ option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; // GenesisState defines the cointrunk module's genesis state. message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; - repeated Publisher PublisherList = 2 [(gogoproto.nullable) = false]; - repeated AcceptedDomain AcceptedDomainList = 3 [(gogoproto.nullable) = false]; - repeated Article ArticleList = 4 [(gogoproto.nullable) = false]; - uint64 articlesCounter = 6; + Params params = 1 [ + (gogoproto.nullable) = false + ]; + repeated Publisher PublisherList = 2 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "publisher_list,omitempty" + ]; + repeated AcceptedDomain AcceptedDomainList = 3 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "accepted_domain_list,omitempty" + ]; + repeated Article ArticleList = 4 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "article_list,omitempty" + ]; + uint64 articlesCounter = 5 [ + (gogoproto.jsontag) = "articles_counter,omitempty" + ]; // this line is used by starport scaffolding # genesis/proto/state } diff --git a/proto/cointrunk/params.proto b/proto/cointrunk/params.proto index 7755f315..abbb2b65 100644 --- a/proto/cointrunk/params.proto +++ b/proto/cointrunk/params.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package bze.cointrunk; +package bze.cointrunk.v1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; @@ -7,6 +7,15 @@ import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; // Params defines the parameters for the module. +message PublisherRespectParams { + string tax = 1 [ + (gogoproto.moretags) = "yaml:\"tax\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string denom = 5 [(gogoproto.moretags) = "yaml:\"denom\""]; +} + message Params { option (gogoproto.goproto_stringer) = false; @@ -16,4 +25,10 @@ message Params { (gogoproto.moretags) = "yaml:\"anon_article_cost\"", (gogoproto.jsontag) = "anon_article_cost,omitempty" ]; + + PublisherRespectParams publisherRespectParams = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"publisher_respect\"", + (gogoproto.jsontag) = "publisher_respect,omitempty" + ]; } \ No newline at end of file diff --git a/proto/cointrunk/publisher.proto b/proto/cointrunk/publisher.proto index 0f966dc7..ca4f3a43 100644 --- a/proto/cointrunk/publisher.proto +++ b/proto/cointrunk/publisher.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package bze.cointrunk; +package bze.cointrunk.v1; option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; diff --git a/proto/cointrunk/publisher_proposal.proto b/proto/cointrunk/publisher_proposal.proto index db513cf2..6a52f396 100644 --- a/proto/cointrunk/publisher_proposal.proto +++ b/proto/cointrunk/publisher_proposal.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package bze.cointrunk; +package bze.cointrunk.v1; option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; diff --git a/proto/cointrunk/query.proto b/proto/cointrunk/query.proto index 8d38cc86..e49dc67e 100644 --- a/proto/cointrunk/query.proto +++ b/proto/cointrunk/query.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package bze.cointrunk; +package bze.cointrunk.v1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; diff --git a/proto/cointrunk/tx.proto b/proto/cointrunk/tx.proto index c2dc601d..1638cc6b 100644 --- a/proto/cointrunk/tx.proto +++ b/proto/cointrunk/tx.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package bze.cointrunk; +package bze.cointrunk.v1; // this line is used by starport scaffolding # proto/tx/import diff --git a/testutil/keeper/cointrunk.go b/testutil/keeper/cointrunk.go index 1f8986de..516ae984 100644 --- a/testutil/keeper/cointrunk.go +++ b/testutil/keeper/cointrunk.go @@ -44,6 +44,7 @@ func CointrunkKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { nil, nil, nil, + nil, ) ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts new file mode 100755 index 00000000..0c724b02 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts @@ -0,0 +1,372 @@ +import { txClient, queryClient, MissingWalletError , registry} from './module' + +import { AcceptedDomain } from "./module/types/cointrunk/accepted_domain" +import { AcceptedDomainProposal } from "./module/types/cointrunk/accepted_domain_proposal" +import { AnonArticlesCounter } from "./module/types/cointrunk/anon_articles_counter" +import { Article } from "./module/types/cointrunk/article" +import { PublisherRespectParams } from "./module/types/cointrunk/params" +import { Params } from "./module/types/cointrunk/params" +import { Publisher } from "./module/types/cointrunk/publisher" +import { PublisherProposal } from "./module/types/cointrunk/publisher_proposal" + + +export { AcceptedDomain, AcceptedDomainProposal, AnonArticlesCounter, Article, PublisherRespectParams, Params, Publisher, PublisherProposal }; + +async function initTxClient(vuexGetters) { + return await txClient(vuexGetters['common/wallet/signer'], { + addr: vuexGetters['common/env/apiTendermint'] + }) +} + +async function initQueryClient(vuexGetters) { + return await queryClient({ + addr: vuexGetters['common/env/apiCosmos'] + }) +} + +function mergeResults(value, next_values) { + for (let prop of Object.keys(next_values)) { + if (Array.isArray(next_values[prop])) { + value[prop]=[...value[prop], ...next_values[prop]] + }else{ + value[prop]=next_values[prop] + } + } + return value +} + +function getStructure(template) { + let structure = { fields: [] } + for (const [key, value] of Object.entries(template)) { + let field: any = {} + field.name = key + field.type = typeof value + structure.fields.push(field) + } + return structure +} + +const getDefaultState = () => { + return { + Params: {}, + AcceptedDomain: {}, + Publisher: {}, + PublisherByIndex: {}, + AllArticles: {}, + AllAnonArticlesCounters: {}, + + _Structure: { + AcceptedDomain: getStructure(AcceptedDomain.fromPartial({})), + AcceptedDomainProposal: getStructure(AcceptedDomainProposal.fromPartial({})), + AnonArticlesCounter: getStructure(AnonArticlesCounter.fromPartial({})), + Article: getStructure(Article.fromPartial({})), + PublisherRespectParams: getStructure(PublisherRespectParams.fromPartial({})), + Params: getStructure(Params.fromPartial({})), + Publisher: getStructure(Publisher.fromPartial({})), + PublisherProposal: getStructure(PublisherProposal.fromPartial({})), + + }, + _Registry: registry, + _Subscriptions: new Set(), + } +} + +// initial state +const state = getDefaultState() + +export default { + namespaced: true, + state, + mutations: { + RESET_STATE(state) { + Object.assign(state, getDefaultState()) + }, + QUERY(state, { query, key, value }) { + state[query][JSON.stringify(key)] = value + }, + SUBSCRIBE(state, subscription) { + state._Subscriptions.add(JSON.stringify(subscription)) + }, + UNSUBSCRIBE(state, subscription) { + state._Subscriptions.delete(JSON.stringify(subscription)) + } + }, + getters: { + getParams: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.Params[JSON.stringify(params)] ?? {} + }, + getAcceptedDomain: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.AcceptedDomain[JSON.stringify(params)] ?? {} + }, + getPublisher: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.Publisher[JSON.stringify(params)] ?? {} + }, + getPublisherByIndex: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.PublisherByIndex[JSON.stringify(params)] ?? {} + }, + getAllArticles: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.AllArticles[JSON.stringify(params)] ?? {} + }, + getAllAnonArticlesCounters: (state) => (params = { params: {}}) => { + if (!( params).query) { + ( params).query=null + } + return state.AllAnonArticlesCounters[JSON.stringify(params)] ?? {} + }, + + getTypeStructure: (state) => (type) => { + return state._Structure[type].fields + }, + getRegistry: (state) => { + return state._Registry + } + }, + actions: { + init({ dispatch, rootGetters }) { + console.log('Vuex module: bze.cointrunk.v1 initialized!') + if (rootGetters['common/env/client']) { + rootGetters['common/env/client'].on('newblock', () => { + dispatch('StoreUpdate') + }) + } + }, + resetState({ commit }) { + commit('RESET_STATE') + }, + unsubscribe({ commit }, subscription) { + commit('UNSUBSCRIBE', subscription) + }, + async StoreUpdate({ state, dispatch }) { + state._Subscriptions.forEach(async (subscription) => { + try { + const sub=JSON.parse(subscription) + await dispatch(sub.action, sub.payload) + }catch(e) { + throw new Error('Subscriptions: ' + e.message) + } + }) + }, + + + + + + + async QueryParams({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryParams()).data + + + commit('QUERY', { query: 'Params', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryParams', payload: { options: { all }, params: {...key},query }}) + return getters['getParams']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryParams API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + + + + + + + async QueryAcceptedDomain({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryAcceptedDomain(query)).data + + + while (all && ( value).pagination && ( value).pagination.next_key!=null) { + let next_values=(await queryClient.queryAcceptedDomain({...query, 'pagination.key':( value).pagination.next_key})).data + value = mergeResults(value, next_values); + } + commit('QUERY', { query: 'AcceptedDomain', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryAcceptedDomain', payload: { options: { all }, params: {...key},query }}) + return getters['getAcceptedDomain']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryAcceptedDomain API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + + + + + + + async QueryPublisher({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryPublisher(query)).data + + + while (all && ( value).pagination && ( value).pagination.next_key!=null) { + let next_values=(await queryClient.queryPublisher({...query, 'pagination.key':( value).pagination.next_key})).data + value = mergeResults(value, next_values); + } + commit('QUERY', { query: 'Publisher', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryPublisher', payload: { options: { all }, params: {...key},query }}) + return getters['getPublisher']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryPublisher API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + + + + + + + async QueryPublisherByIndex({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryPublisherByIndex( key.index)).data + + + commit('QUERY', { query: 'PublisherByIndex', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryPublisherByIndex', payload: { options: { all }, params: {...key},query }}) + return getters['getPublisherByIndex']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryPublisherByIndex API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + + + + + + + async QueryAllArticles({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryAllArticles(query)).data + + + while (all && ( value).pagination && ( value).pagination.next_key!=null) { + let next_values=(await queryClient.queryAllArticles({...query, 'pagination.key':( value).pagination.next_key})).data + value = mergeResults(value, next_values); + } + commit('QUERY', { query: 'AllArticles', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllArticles', payload: { options: { all }, params: {...key},query }}) + return getters['getAllArticles']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryAllArticles API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + + + + + + + async QueryAllAnonArticlesCounters({ commit, rootGetters, getters }, { options: { subscribe, all} = { subscribe:false, all:false}, params, query=null }) { + try { + const key = params ?? {}; + const queryClient=await initQueryClient(rootGetters) + let value= (await queryClient.queryAllAnonArticlesCounters(query)).data + + + while (all && ( value).pagination && ( value).pagination.next_key!=null) { + let next_values=(await queryClient.queryAllAnonArticlesCounters({...query, 'pagination.key':( value).pagination.next_key})).data + value = mergeResults(value, next_values); + } + commit('QUERY', { query: 'AllAnonArticlesCounters', key: { params: {...key}, query}, value }) + if (subscribe) commit('SUBSCRIBE', { action: 'QueryAllAnonArticlesCounters', payload: { options: { all }, params: {...key},query }}) + return getters['getAllAnonArticlesCounters']( { params: {...key}, query}) ?? {} + } catch (e) { + throw new Error('QueryClient:QueryAllAnonArticlesCounters API Node Unavailable. Could not perform query: ' + e.message) + + } + }, + + + async sendMsgPayPublisherRespect({ rootGetters }, { value, fee = [], memo = '' }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgPayPublisherRespect(value) + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') + }else{ + throw new Error('TxClient:MsgPayPublisherRespect:Send Could not broadcast Tx: '+ e.message) + } + } + }, + async sendMsgAddArticle({ rootGetters }, { value, fee = [], memo = '' }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgAddArticle(value) + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') + }else{ + throw new Error('TxClient:MsgAddArticle:Send Could not broadcast Tx: '+ e.message) + } + } + }, + + async MsgPayPublisherRespect({ rootGetters }, { value }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgPayPublisherRespect(value) + return msg + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') + } else{ + throw new Error('TxClient:MsgPayPublisherRespect:Create Could not create message: ' + e.message) + } + } + }, + async MsgAddArticle({ rootGetters }, { value }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgAddArticle(value) + return msg + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') + } else{ + throw new Error('TxClient:MsgAddArticle:Create Could not create message: ' + e.message) + } + } + }, + + } +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts new file mode 100755 index 00000000..9119ba33 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts @@ -0,0 +1,63 @@ +// THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. + +import { StdFee } from "@cosmjs/launchpad"; +import { SigningStargateClient } from "@cosmjs/stargate"; +import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; +import { Api } from "./rest"; +import { MsgPayPublisherRespect } from "./types/cointrunk/tx"; +import { MsgAddArticle } from "./types/cointrunk/tx"; + + +const types = [ + ["/bze.cointrunk.v1.MsgPayPublisherRespect", MsgPayPublisherRespect], + ["/bze.cointrunk.v1.MsgAddArticle", MsgAddArticle], + +]; +export const MissingWalletError = new Error("wallet is required"); + +export const registry = new Registry(types); + +const defaultFee = { + amount: [], + gas: "200000", +}; + +interface TxClientOptions { + addr: string +} + +interface SignAndBroadcastOptions { + fee: StdFee, + memo?: string +} + +const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = { addr: "http://localhost:26657" }) => { + if (!wallet) throw MissingWalletError; + let client; + if (addr) { + client = await SigningStargateClient.connectWithSigner(addr, wallet, { registry }); + }else{ + client = await SigningStargateClient.offline( wallet, { registry }); + } + const { address } = (await wallet.getAccounts())[0]; + + return { + signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + msgPayPublisherRespect: (data: MsgPayPublisherRespect): EncodeObject => ({ typeUrl: "/bze.cointrunk.v1.MsgPayPublisherRespect", value: MsgPayPublisherRespect.fromPartial( data ) }), + msgAddArticle: (data: MsgAddArticle): EncodeObject => ({ typeUrl: "/bze.cointrunk.v1.MsgAddArticle", value: MsgAddArticle.fromPartial( data ) }), + + }; +}; + +interface QueryClientOptions { + addr: string +} + +const queryClient = async ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => { + return new Api({ baseUrl: addr }); +}; + +export { + txClient, + queryClient, +}; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts new file mode 100644 index 00000000..f099e945 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts @@ -0,0 +1,577 @@ +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: acacode ## + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +export interface ProtobufAny { + "@type"?: string; +} + +export interface RpcStatus { + /** @format int32 */ + code?: number; + message?: string; + details?: ProtobufAny[]; +} + +export interface V1AcceptedDomain { + domain?: string; + active?: boolean; +} + +export interface V1AnonArticlesCounter { + key?: string; + + /** @format uint64 */ + counter?: string; +} + +export interface V1Article { + /** @format uint64 */ + id?: string; + title?: string; + url?: string; + picture?: string; + publisher?: string; + paid?: boolean; + + /** @format int64 */ + createdAt?: string; +} + +export type V1MsgAddArticleResponse = object; + +export interface V1MsgPayPublisherRespectResponse { + /** @format uint64 */ + respectPaid?: string; + + /** @format uint64 */ + publisherReward?: string; + + /** @format uint64 */ + communityPoolFunds?: string; +} + +export interface V1Params { + /** @format uint64 */ + anonArticleLimit?: string; + + /** + * 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. + */ + anonArticleCost?: V1Beta1Coin; + + /** Params defines the parameters for the module. */ + publisherRespectParams?: V1PublisherRespectParams; +} + +export interface V1Publisher { + name?: string; + address?: string; + active?: boolean; + + /** @format int64 */ + articlesCount?: number; + + /** @format int64 */ + createdAt?: string; + + /** @format int64 */ + respect?: string; +} + +/** + * Params defines the parameters for the module. + */ +export interface V1PublisherRespectParams { + tax?: string; + denom?: string; +} + +export interface V1QueryAcceptedDomainResponse { + acceptedDomain?: V1AcceptedDomain[]; + + /** + * 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; + * } + */ + pagination?: V1Beta1PageResponse; +} + +export interface V1QueryAllAnonArticlesCountersResponse { + AnonArticlesCounters?: V1AnonArticlesCounter[]; + + /** + * 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; + * } + */ + pagination?: V1Beta1PageResponse; +} + +export interface V1QueryAllArticlesResponse { + article?: V1Article[]; + + /** + * 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; + * } + */ + pagination?: V1Beta1PageResponse; +} + +/** + * QueryParamsResponse is response type for the Query/Params RPC method. + */ +export interface V1QueryParamsResponse { + /** params holds all the parameters of this module. */ + params?: V1Params; +} + +export interface V1QueryPublisherByIndexResponse { + publisher?: V1Publisher; +} + +export interface V1QueryPublisherResponse { + publisher?: V1Publisher[]; + + /** + * 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; + * } + */ + pagination?: V1Beta1PageResponse; +} + +/** +* 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. +*/ +export interface V1Beta1Coin { + denom?: string; + amount?: string; +} + +/** +* message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } +*/ +export interface V1Beta1PageRequest { + /** + * 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. + * @format byte + */ + key?: string; + + /** + * 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. + * @format uint64 + */ + offset?: string; + + /** + * 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. + * @format uint64 + */ + limit?: string; + + /** + * 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. + */ + count_total?: boolean; + + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse?: boolean; +} + +/** +* 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; + } +*/ +export interface V1Beta1PageResponse { + /** @format byte */ + next_key?: string; + + /** @format uint64 */ + total?: string; +} + +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: keyof Omit; + /** request body */ + body?: unknown; + /** base url */ + baseUrl?: string; + /** request cancellation token */ + cancelToken?: CancelToken; +} + +export type RequestParams = Omit; + +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: (securityData: SecurityDataType) => RequestParams | void; +} + +export interface HttpResponse extends Response { + data: D; + error: E; +} + +type CancelToken = Symbol | string | number; + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", +} + +export class HttpClient { + public baseUrl: string = ""; + private securityData: SecurityDataType = null as any; + private securityWorker: null | ApiConfig["securityWorker"] = null; + private abortControllers = new Map(); + + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; + + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } + + public setSecurityData = (data: SecurityDataType) => { + this.securityData = data; + }; + + private addQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + + return ( + encodeURIComponent(key) + + "=" + + encodeURIComponent(Array.isArray(value) ? value.join(",") : typeof value === "number" ? value : `${value}`) + ); + } + + protected toQueryString(rawQuery?: QueryParamsType): string { + const query = rawQuery || {}; + const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + return keys + .map((key) => + typeof query[key] === "object" && !Array.isArray(query[key]) + ? this.toQueryString(query[key] as QueryParamsType) + : this.addQueryParam(query, key), + ) + .join("&"); + } + + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? `?${queryString}` : ""; + } + + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, + [ContentType.FormData]: (input: any) => + Object.keys(input || {}).reduce((data, key) => { + data.append(key, input[key]); + return data; + }, new FormData()), + [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), + }; + + private mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + private createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + if (this.abortControllers.has(cancelToken)) { + const abortController = this.abortControllers.get(cancelToken); + if (abortController) { + return abortController.signal; + } + return void 0; + } + + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; + + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); + + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; + + public request = ({ + body, + secure, + path, + type, + query, + format = "json", + baseUrl, + cancelToken, + ...params + }: FullRequestParams): Promise> => { + const secureParams = (secure && this.securityWorker && this.securityWorker(this.securityData)) || {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const queryString = query && this.toQueryString(query); + const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + + return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + ...requestParams, + headers: { + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + ...(requestParams.headers || {}), + }, + signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, + body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), + }).then(async (response) => { + const r = response as HttpResponse; + r.data = (null as unknown) as T; + r.error = (null as unknown) as E; + + const data = await response[format]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); + + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } + + if (!response.ok) throw data; + return data; + }); + }; +} + +/** + * @title cointrunk/accepted_domain.proto + * @version version not set + */ +export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryAcceptedDomain + * @summary Queries a list of AcceptedDomain items. + * @request GET:/bze/cointrunk/v1/accepted_domain + */ + queryAcceptedDomain = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/bze/cointrunk/v1/accepted_domain`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryAllAnonArticlesCounters + * @summary Queries a list of AllAnonArticlesCounters items. + * @request GET:/bze/cointrunk/v1/all_anon_articles_counters + */ + queryAllAnonArticlesCounters = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/bze/cointrunk/v1/all_anon_articles_counters`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryAllArticles + * @summary Queries a list of ArticlesByPrefix items. + * @request GET:/bze/cointrunk/v1/articles + */ + queryAllArticles = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/bze/cointrunk/v1/articles`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryParams + * @summary Parameters queries the parameters of the module. + * @request GET:/bze/cointrunk/v1/params + */ + queryParams = (params: RequestParams = {}) => + this.request({ + path: `/bze/cointrunk/v1/params`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryPublisherByIndex + * @summary Queries publisher by index/address. + * @request GET:/bze/cointrunk/v1/publisher/{index} + */ + queryPublisherByIndex = (index: string, params: RequestParams = {}) => + this.request({ + path: `/bze/cointrunk/v1/publisher/${index}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryPublisher + * @summary Queries a list of Publisher items. + * @request GET:/bze/cointrunk/v1/publishers + */ + queryPublisher = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/bze/cointrunk/v1/publishers`, + method: "GET", + query: query, + format: "json", + ...params, + }); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/accepted_domain.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/accepted_domain.ts new file mode 100644 index 00000000..9c2aa6e9 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/accepted_domain.ts @@ -0,0 +1,92 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk.v1"; + +export interface AcceptedDomain { + domain: string; + active: boolean; +} + +const baseAcceptedDomain: object = { domain: "", active: false }; + +export const AcceptedDomain = { + encode(message: AcceptedDomain, writer: Writer = Writer.create()): Writer { + if (message.domain !== "") { + writer.uint32(10).string(message.domain); + } + if (message.active === true) { + writer.uint32(16).bool(message.active); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): AcceptedDomain { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAcceptedDomain } as AcceptedDomain; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.domain = reader.string(); + break; + case 2: + message.active = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AcceptedDomain { + const message = { ...baseAcceptedDomain } as AcceptedDomain; + if (object.domain !== undefined && object.domain !== null) { + message.domain = String(object.domain); + } else { + message.domain = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = Boolean(object.active); + } else { + message.active = false; + } + return message; + }, + + toJSON(message: AcceptedDomain): unknown { + const obj: any = {}; + message.domain !== undefined && (obj.domain = message.domain); + message.active !== undefined && (obj.active = message.active); + return obj; + }, + + fromPartial(object: DeepPartial): AcceptedDomain { + const message = { ...baseAcceptedDomain } as AcceptedDomain; + if (object.domain !== undefined && object.domain !== null) { + message.domain = object.domain; + } else { + message.domain = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } else { + message.active = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/accepted_domain_proposal.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/accepted_domain_proposal.ts new file mode 100644 index 00000000..67d69889 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/accepted_domain_proposal.ts @@ -0,0 +1,139 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk.v1"; + +export interface AcceptedDomainProposal { + title: string; + description: string; + domain: string; + active: boolean; +} + +const baseAcceptedDomainProposal: object = { + title: "", + description: "", + domain: "", + active: false, +}; + +export const AcceptedDomainProposal = { + encode( + message: AcceptedDomainProposal, + writer: Writer = Writer.create() + ): Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.domain !== "") { + writer.uint32(26).string(message.domain); + } + if (message.active === true) { + writer.uint32(32).bool(message.active); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): AcceptedDomainProposal { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAcceptedDomainProposal } as AcceptedDomainProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.domain = reader.string(); + break; + case 4: + message.active = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AcceptedDomainProposal { + const message = { ...baseAcceptedDomainProposal } as AcceptedDomainProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.domain !== undefined && object.domain !== null) { + message.domain = String(object.domain); + } else { + message.domain = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = Boolean(object.active); + } else { + message.active = false; + } + return message; + }, + + toJSON(message: AcceptedDomainProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.domain !== undefined && (obj.domain = message.domain); + message.active !== undefined && (obj.active = message.active); + return obj; + }, + + fromPartial( + object: DeepPartial + ): AcceptedDomainProposal { + const message = { ...baseAcceptedDomainProposal } as AcceptedDomainProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.domain !== undefined && object.domain !== null) { + message.domain = object.domain; + } else { + message.domain = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } else { + message.active = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/anon_articles_counter.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/anon_articles_counter.ts new file mode 100644 index 00000000..3c6da0c8 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/anon_articles_counter.ts @@ -0,0 +1,118 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk.v1"; + +export interface AnonArticlesCounter { + key: string; + counter: number; +} + +const baseAnonArticlesCounter: object = { key: "", counter: 0 }; + +export const AnonArticlesCounter = { + encode( + message: AnonArticlesCounter, + writer: Writer = Writer.create() + ): Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.counter !== 0) { + writer.uint32(16).uint64(message.counter); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): AnonArticlesCounter { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAnonArticlesCounter } as AnonArticlesCounter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.counter = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AnonArticlesCounter { + const message = { ...baseAnonArticlesCounter } as AnonArticlesCounter; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.counter !== undefined && object.counter !== null) { + message.counter = Number(object.counter); + } else { + message.counter = 0; + } + return message; + }, + + toJSON(message: AnonArticlesCounter): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.counter !== undefined && (obj.counter = message.counter); + return obj; + }, + + fromPartial(object: DeepPartial): AnonArticlesCounter { + const message = { ...baseAnonArticlesCounter } as AnonArticlesCounter; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.counter !== undefined && object.counter !== null) { + message.counter = object.counter; + } else { + message.counter = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/article.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/article.ts new file mode 100644 index 00000000..b89854cc --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/article.ts @@ -0,0 +1,213 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk.v1"; + +export interface Article { + id: number; + title: string; + url: string; + picture: string; + publisher: string; + paid: boolean; + createdAt: number; +} + +const baseArticle: object = { + id: 0, + title: "", + url: "", + picture: "", + publisher: "", + paid: false, + createdAt: 0, +}; + +export const Article = { + encode(message: Article, writer: Writer = Writer.create()): Writer { + if (message.id !== 0) { + writer.uint32(8).uint64(message.id); + } + if (message.title !== "") { + writer.uint32(18).string(message.title); + } + if (message.url !== "") { + writer.uint32(26).string(message.url); + } + if (message.picture !== "") { + writer.uint32(34).string(message.picture); + } + if (message.publisher !== "") { + writer.uint32(42).string(message.publisher); + } + if (message.paid === true) { + writer.uint32(48).bool(message.paid); + } + if (message.createdAt !== 0) { + writer.uint32(56).int64(message.createdAt); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Article { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseArticle } as Article; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = longToNumber(reader.uint64() as Long); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.url = reader.string(); + break; + case 4: + message.picture = reader.string(); + break; + case 5: + message.publisher = reader.string(); + break; + case 6: + message.paid = reader.bool(); + break; + case 7: + message.createdAt = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Article { + const message = { ...baseArticle } as Article; + if (object.id !== undefined && object.id !== null) { + message.id = Number(object.id); + } else { + message.id = 0; + } + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = String(object.url); + } else { + message.url = ""; + } + if (object.picture !== undefined && object.picture !== null) { + message.picture = String(object.picture); + } else { + message.picture = ""; + } + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = String(object.publisher); + } else { + message.publisher = ""; + } + if (object.paid !== undefined && object.paid !== null) { + message.paid = Boolean(object.paid); + } else { + message.paid = false; + } + if (object.createdAt !== undefined && object.createdAt !== null) { + message.createdAt = Number(object.createdAt); + } else { + message.createdAt = 0; + } + return message; + }, + + toJSON(message: Article): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.title !== undefined && (obj.title = message.title); + message.url !== undefined && (obj.url = message.url); + message.picture !== undefined && (obj.picture = message.picture); + message.publisher !== undefined && (obj.publisher = message.publisher); + message.paid !== undefined && (obj.paid = message.paid); + message.createdAt !== undefined && (obj.createdAt = message.createdAt); + return obj; + }, + + fromPartial(object: DeepPartial
): Article { + const message = { ...baseArticle } as Article; + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } else { + message.id = 0; + } + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = object.url; + } else { + message.url = ""; + } + if (object.picture !== undefined && object.picture !== null) { + message.picture = object.picture; + } else { + message.picture = ""; + } + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = object.publisher; + } else { + message.publisher = ""; + } + if (object.paid !== undefined && object.paid !== null) { + message.paid = object.paid; + } else { + message.paid = false; + } + if (object.createdAt !== undefined && object.createdAt !== null) { + message.createdAt = object.createdAt; + } else { + message.createdAt = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/genesis.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/genesis.ts new file mode 100644 index 00000000..283c83b6 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/genesis.ts @@ -0,0 +1,218 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import { Params } from "../cointrunk/params"; +import { Publisher } from "../cointrunk/publisher"; +import { AcceptedDomain } from "../cointrunk/accepted_domain"; +import { Article } from "../cointrunk/article"; + +export const protobufPackage = "bze.cointrunk.v1"; + +/** GenesisState defines the cointrunk module's genesis state. */ +export interface GenesisState { + params: Params | undefined; + PublisherList: Publisher[]; + AcceptedDomainList: AcceptedDomain[]; + ArticleList: Article[]; + /** this line is used by starport scaffolding # genesis/proto/state */ + articlesCounter: number; +} + +const baseGenesisState: object = { articlesCounter: 0 }; + +export const GenesisState = { + encode(message: GenesisState, writer: Writer = Writer.create()): Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.PublisherList) { + Publisher.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.AcceptedDomainList) { + AcceptedDomain.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.ArticleList) { + Article.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.articlesCounter !== 0) { + writer.uint32(40).uint64(message.articlesCounter); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.PublisherList = []; + message.AcceptedDomainList = []; + message.ArticleList = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.PublisherList.push(Publisher.decode(reader, reader.uint32())); + break; + case 3: + message.AcceptedDomainList.push( + AcceptedDomain.decode(reader, reader.uint32()) + ); + break; + case 4: + message.ArticleList.push(Article.decode(reader, reader.uint32())); + break; + case 5: + message.articlesCounter = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.PublisherList = []; + message.AcceptedDomainList = []; + message.ArticleList = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + if (object.PublisherList !== undefined && object.PublisherList !== null) { + for (const e of object.PublisherList) { + message.PublisherList.push(Publisher.fromJSON(e)); + } + } + if ( + object.AcceptedDomainList !== undefined && + object.AcceptedDomainList !== null + ) { + for (const e of object.AcceptedDomainList) { + message.AcceptedDomainList.push(AcceptedDomain.fromJSON(e)); + } + } + if (object.ArticleList !== undefined && object.ArticleList !== null) { + for (const e of object.ArticleList) { + message.ArticleList.push(Article.fromJSON(e)); + } + } + if ( + object.articlesCounter !== undefined && + object.articlesCounter !== null + ) { + message.articlesCounter = Number(object.articlesCounter); + } else { + message.articlesCounter = 0; + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.PublisherList) { + obj.PublisherList = message.PublisherList.map((e) => + e ? Publisher.toJSON(e) : undefined + ); + } else { + obj.PublisherList = []; + } + if (message.AcceptedDomainList) { + obj.AcceptedDomainList = message.AcceptedDomainList.map((e) => + e ? AcceptedDomain.toJSON(e) : undefined + ); + } else { + obj.AcceptedDomainList = []; + } + if (message.ArticleList) { + obj.ArticleList = message.ArticleList.map((e) => + e ? Article.toJSON(e) : undefined + ); + } else { + obj.ArticleList = []; + } + message.articlesCounter !== undefined && + (obj.articlesCounter = message.articlesCounter); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.PublisherList = []; + message.AcceptedDomainList = []; + message.ArticleList = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + if (object.PublisherList !== undefined && object.PublisherList !== null) { + for (const e of object.PublisherList) { + message.PublisherList.push(Publisher.fromPartial(e)); + } + } + if ( + object.AcceptedDomainList !== undefined && + object.AcceptedDomainList !== null + ) { + for (const e of object.AcceptedDomainList) { + message.AcceptedDomainList.push(AcceptedDomain.fromPartial(e)); + } + } + if (object.ArticleList !== undefined && object.ArticleList !== null) { + for (const e of object.ArticleList) { + message.ArticleList.push(Article.fromPartial(e)); + } + } + if ( + object.articlesCounter !== undefined && + object.articlesCounter !== null + ) { + message.articlesCounter = object.articlesCounter; + } else { + message.articlesCounter = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/params.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/params.ts new file mode 100644 index 00000000..b5a20b00 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/params.ts @@ -0,0 +1,252 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; +import { Coin } from "../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "bze.cointrunk.v1"; + +/** Params defines the parameters for the module. */ +export interface PublisherRespectParams { + tax: string; + denom: string; +} + +export interface Params { + anonArticleLimit: number; + anonArticleCost: Coin | undefined; + publisherRespectParams: PublisherRespectParams | undefined; +} + +const basePublisherRespectParams: object = { tax: "", denom: "" }; + +export const PublisherRespectParams = { + encode( + message: PublisherRespectParams, + writer: Writer = Writer.create() + ): Writer { + if (message.tax !== "") { + writer.uint32(10).string(message.tax); + } + if (message.denom !== "") { + writer.uint32(42).string(message.denom); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PublisherRespectParams { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublisherRespectParams } as PublisherRespectParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tax = reader.string(); + break; + case 5: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PublisherRespectParams { + const message = { ...basePublisherRespectParams } as PublisherRespectParams; + if (object.tax !== undefined && object.tax !== null) { + message.tax = String(object.tax); + } else { + message.tax = ""; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + return message; + }, + + toJSON(message: PublisherRespectParams): unknown { + const obj: any = {}; + message.tax !== undefined && (obj.tax = message.tax); + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, + + fromPartial( + object: DeepPartial + ): PublisherRespectParams { + const message = { ...basePublisherRespectParams } as PublisherRespectParams; + if (object.tax !== undefined && object.tax !== null) { + message.tax = object.tax; + } else { + message.tax = ""; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + return message; + }, +}; + +const baseParams: object = { anonArticleLimit: 0 }; + +export const Params = { + encode(message: Params, writer: Writer = Writer.create()): Writer { + if (message.anonArticleLimit !== 0) { + writer.uint32(8).uint64(message.anonArticleLimit); + } + if (message.anonArticleCost !== undefined) { + Coin.encode(message.anonArticleCost, writer.uint32(18).fork()).ldelim(); + } + if (message.publisherRespectParams !== undefined) { + PublisherRespectParams.encode( + message.publisherRespectParams, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Params { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.anonArticleLimit = longToNumber(reader.uint64() as Long); + break; + case 2: + message.anonArticleCost = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.publisherRespectParams = PublisherRespectParams.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + if ( + object.anonArticleLimit !== undefined && + object.anonArticleLimit !== null + ) { + message.anonArticleLimit = Number(object.anonArticleLimit); + } else { + message.anonArticleLimit = 0; + } + if ( + object.anonArticleCost !== undefined && + object.anonArticleCost !== null + ) { + message.anonArticleCost = Coin.fromJSON(object.anonArticleCost); + } else { + message.anonArticleCost = undefined; + } + if ( + object.publisherRespectParams !== undefined && + object.publisherRespectParams !== null + ) { + message.publisherRespectParams = PublisherRespectParams.fromJSON( + object.publisherRespectParams + ); + } else { + message.publisherRespectParams = undefined; + } + return message; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.anonArticleLimit !== undefined && + (obj.anonArticleLimit = message.anonArticleLimit); + message.anonArticleCost !== undefined && + (obj.anonArticleCost = message.anonArticleCost + ? Coin.toJSON(message.anonArticleCost) + : undefined); + message.publisherRespectParams !== undefined && + (obj.publisherRespectParams = message.publisherRespectParams + ? PublisherRespectParams.toJSON(message.publisherRespectParams) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + if ( + object.anonArticleLimit !== undefined && + object.anonArticleLimit !== null + ) { + message.anonArticleLimit = object.anonArticleLimit; + } else { + message.anonArticleLimit = 0; + } + if ( + object.anonArticleCost !== undefined && + object.anonArticleCost !== null + ) { + message.anonArticleCost = Coin.fromPartial(object.anonArticleCost); + } else { + message.anonArticleCost = undefined; + } + if ( + object.publisherRespectParams !== undefined && + object.publisherRespectParams !== null + ) { + message.publisherRespectParams = PublisherRespectParams.fromPartial( + object.publisherRespectParams + ); + } else { + message.publisherRespectParams = undefined; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/publisher.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/publisher.ts new file mode 100644 index 00000000..e3741382 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/publisher.ts @@ -0,0 +1,195 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk.v1"; + +export interface Publisher { + name: string; + address: string; + active: boolean; + articlesCount: number; + createdAt: number; + respect: number; +} + +const basePublisher: object = { + name: "", + address: "", + active: false, + articlesCount: 0, + createdAt: 0, + respect: 0, +}; + +export const Publisher = { + encode(message: Publisher, writer: Writer = Writer.create()): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.active === true) { + writer.uint32(24).bool(message.active); + } + if (message.articlesCount !== 0) { + writer.uint32(32).uint32(message.articlesCount); + } + if (message.createdAt !== 0) { + writer.uint32(40).int64(message.createdAt); + } + if (message.respect !== 0) { + writer.uint32(48).int64(message.respect); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Publisher { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublisher } as Publisher; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.active = reader.bool(); + break; + case 4: + message.articlesCount = reader.uint32(); + break; + case 5: + message.createdAt = longToNumber(reader.int64() as Long); + break; + case 6: + message.respect = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Publisher { + const message = { ...basePublisher } as Publisher; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = Boolean(object.active); + } else { + message.active = false; + } + if (object.articlesCount !== undefined && object.articlesCount !== null) { + message.articlesCount = Number(object.articlesCount); + } else { + message.articlesCount = 0; + } + if (object.createdAt !== undefined && object.createdAt !== null) { + message.createdAt = Number(object.createdAt); + } else { + message.createdAt = 0; + } + if (object.respect !== undefined && object.respect !== null) { + message.respect = Number(object.respect); + } else { + message.respect = 0; + } + return message; + }, + + toJSON(message: Publisher): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.address !== undefined && (obj.address = message.address); + message.active !== undefined && (obj.active = message.active); + message.articlesCount !== undefined && + (obj.articlesCount = message.articlesCount); + message.createdAt !== undefined && (obj.createdAt = message.createdAt); + message.respect !== undefined && (obj.respect = message.respect); + return obj; + }, + + fromPartial(object: DeepPartial): Publisher { + const message = { ...basePublisher } as Publisher; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } else { + message.active = false; + } + if (object.articlesCount !== undefined && object.articlesCount !== null) { + message.articlesCount = object.articlesCount; + } else { + message.articlesCount = 0; + } + if (object.createdAt !== undefined && object.createdAt !== null) { + message.createdAt = object.createdAt; + } else { + message.createdAt = 0; + } + if (object.respect !== undefined && object.respect !== null) { + message.respect = object.respect; + } else { + message.respect = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/publisher_proposal.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/publisher_proposal.ts new file mode 100644 index 00000000..5598a245 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/publisher_proposal.ts @@ -0,0 +1,153 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.cointrunk.v1"; + +export interface PublisherProposal { + title: string; + description: string; + name: string; + address: string; + active: boolean; +} + +const basePublisherProposal: object = { + title: "", + description: "", + name: "", + address: "", + active: false, +}; + +export const PublisherProposal = { + encode(message: PublisherProposal, writer: Writer = Writer.create()): Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.address !== "") { + writer.uint32(34).string(message.address); + } + if (message.active === true) { + writer.uint32(40).bool(message.active); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PublisherProposal { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublisherProposal } as PublisherProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.address = reader.string(); + break; + case 5: + message.active = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PublisherProposal { + const message = { ...basePublisherProposal } as PublisherProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = Boolean(object.active); + } else { + message.active = false; + } + return message; + }, + + toJSON(message: PublisherProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.name !== undefined && (obj.name = message.name); + message.address !== undefined && (obj.address = message.address); + message.active !== undefined && (obj.active = message.active); + return obj; + }, + + fromPartial(object: DeepPartial): PublisherProposal { + const message = { ...basePublisherProposal } as PublisherProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } else { + message.active = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/query.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/query.ts new file mode 100644 index 00000000..ec1886e9 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/query.ts @@ -0,0 +1,1108 @@ +/* eslint-disable */ +import { Reader, Writer } from "protobufjs/minimal"; +import { Params } from "../cointrunk/params"; +import { + PageRequest, + PageResponse, +} from "../cosmos/base/query/v1beta1/pagination"; +import { AcceptedDomain } from "../cointrunk/accepted_domain"; +import { Publisher } from "../cointrunk/publisher"; +import { Article } from "../cointrunk/article"; +import { AnonArticlesCounter } from "../cointrunk/anon_articles_counter"; + +export const protobufPackage = "bze.cointrunk.v1"; + +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} + +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params | undefined; +} + +export interface QueryAcceptedDomainRequest { + pagination: PageRequest | undefined; +} + +export interface QueryAcceptedDomainResponse { + acceptedDomain: AcceptedDomain[]; + pagination: PageResponse | undefined; +} + +export interface QueryPublisherRequest { + pagination: PageRequest | undefined; +} + +export interface QueryPublisherResponse { + publisher: Publisher[]; + pagination: PageResponse | undefined; +} + +export interface QueryPublisherByIndexRequest { + index: string; +} + +export interface QueryPublisherByIndexResponse { + publisher: Publisher | undefined; +} + +export interface QueryAllArticlesRequest { + pagination: PageRequest | undefined; +} + +export interface QueryAllArticlesResponse { + article: Article[]; + pagination: PageResponse | undefined; +} + +export interface QueryAllAnonArticlesCountersRequest { + pagination: PageRequest | undefined; +} + +export interface QueryAllAnonArticlesCountersResponse { + AnonArticlesCounters: AnonArticlesCounter[]; + pagination: PageResponse | undefined; +} + +const baseQueryParamsRequest: object = {}; + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer { + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, +}; + +const baseQueryParamsResponse: object = {}; + +export const QueryParamsResponse = { + encode( + message: QueryParamsResponse, + writer: Writer = Writer.create() + ): Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +const baseQueryAcceptedDomainRequest: object = {}; + +export const QueryAcceptedDomainRequest = { + encode( + message: QueryAcceptedDomainRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryAcceptedDomainRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAcceptedDomainRequest, + } as QueryAcceptedDomainRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAcceptedDomainRequest { + const message = { + ...baseQueryAcceptedDomainRequest, + } as QueryAcceptedDomainRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAcceptedDomainRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAcceptedDomainRequest { + const message = { + ...baseQueryAcceptedDomainRequest, + } as QueryAcceptedDomainRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAcceptedDomainResponse: object = {}; + +export const QueryAcceptedDomainResponse = { + encode( + message: QueryAcceptedDomainResponse, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.acceptedDomain) { + AcceptedDomain.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryAcceptedDomainResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAcceptedDomainResponse, + } as QueryAcceptedDomainResponse; + message.acceptedDomain = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acceptedDomain.push( + AcceptedDomain.decode(reader, reader.uint32()) + ); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAcceptedDomainResponse { + const message = { + ...baseQueryAcceptedDomainResponse, + } as QueryAcceptedDomainResponse; + message.acceptedDomain = []; + if (object.acceptedDomain !== undefined && object.acceptedDomain !== null) { + for (const e of object.acceptedDomain) { + message.acceptedDomain.push(AcceptedDomain.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAcceptedDomainResponse): unknown { + const obj: any = {}; + if (message.acceptedDomain) { + obj.acceptedDomain = message.acceptedDomain.map((e) => + e ? AcceptedDomain.toJSON(e) : undefined + ); + } else { + obj.acceptedDomain = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAcceptedDomainResponse { + const message = { + ...baseQueryAcceptedDomainResponse, + } as QueryAcceptedDomainResponse; + message.acceptedDomain = []; + if (object.acceptedDomain !== undefined && object.acceptedDomain !== null) { + for (const e of object.acceptedDomain) { + message.acceptedDomain.push(AcceptedDomain.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryPublisherRequest: object = {}; + +export const QueryPublisherRequest = { + encode( + message: QueryPublisherRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryPublisherRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPublisherRequest } as QueryPublisherRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPublisherRequest { + const message = { ...baseQueryPublisherRequest } as QueryPublisherRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryPublisherRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryPublisherRequest { + const message = { ...baseQueryPublisherRequest } as QueryPublisherRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryPublisherResponse: object = {}; + +export const QueryPublisherResponse = { + encode( + message: QueryPublisherResponse, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.publisher) { + Publisher.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryPublisherResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPublisherResponse } as QueryPublisherResponse; + message.publisher = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publisher.push(Publisher.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPublisherResponse { + const message = { ...baseQueryPublisherResponse } as QueryPublisherResponse; + message.publisher = []; + if (object.publisher !== undefined && object.publisher !== null) { + for (const e of object.publisher) { + message.publisher.push(Publisher.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryPublisherResponse): unknown { + const obj: any = {}; + if (message.publisher) { + obj.publisher = message.publisher.map((e) => + e ? Publisher.toJSON(e) : undefined + ); + } else { + obj.publisher = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryPublisherResponse { + const message = { ...baseQueryPublisherResponse } as QueryPublisherResponse; + message.publisher = []; + if (object.publisher !== undefined && object.publisher !== null) { + for (const e of object.publisher) { + message.publisher.push(Publisher.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryPublisherByIndexRequest: object = { index: "" }; + +export const QueryPublisherByIndexRequest = { + encode( + message: QueryPublisherByIndexRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.index !== "") { + writer.uint32(10).string(message.index); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryPublisherByIndexRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryPublisherByIndexRequest, + } as QueryPublisherByIndexRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPublisherByIndexRequest { + const message = { + ...baseQueryPublisherByIndexRequest, + } as QueryPublisherByIndexRequest; + if (object.index !== undefined && object.index !== null) { + message.index = String(object.index); + } else { + message.index = ""; + } + return message; + }, + + toJSON(message: QueryPublisherByIndexRequest): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = message.index); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryPublisherByIndexRequest { + const message = { + ...baseQueryPublisherByIndexRequest, + } as QueryPublisherByIndexRequest; + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } else { + message.index = ""; + } + return message; + }, +}; + +const baseQueryPublisherByIndexResponse: object = {}; + +export const QueryPublisherByIndexResponse = { + encode( + message: QueryPublisherByIndexResponse, + writer: Writer = Writer.create() + ): Writer { + if (message.publisher !== undefined) { + Publisher.encode(message.publisher, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryPublisherByIndexResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryPublisherByIndexResponse, + } as QueryPublisherByIndexResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publisher = Publisher.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPublisherByIndexResponse { + const message = { + ...baseQueryPublisherByIndexResponse, + } as QueryPublisherByIndexResponse; + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = Publisher.fromJSON(object.publisher); + } else { + message.publisher = undefined; + } + return message; + }, + + toJSON(message: QueryPublisherByIndexResponse): unknown { + const obj: any = {}; + message.publisher !== undefined && + (obj.publisher = message.publisher + ? Publisher.toJSON(message.publisher) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryPublisherByIndexResponse { + const message = { + ...baseQueryPublisherByIndexResponse, + } as QueryPublisherByIndexResponse; + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = Publisher.fromPartial(object.publisher); + } else { + message.publisher = undefined; + } + return message; + }, +}; + +const baseQueryAllArticlesRequest: object = {}; + +export const QueryAllArticlesRequest = { + encode( + message: QueryAllArticlesRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): QueryAllArticlesRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAllArticlesRequest, + } as QueryAllArticlesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllArticlesRequest { + const message = { + ...baseQueryAllArticlesRequest, + } as QueryAllArticlesRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllArticlesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAllArticlesRequest { + const message = { + ...baseQueryAllArticlesRequest, + } as QueryAllArticlesRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAllArticlesResponse: object = {}; + +export const QueryAllArticlesResponse = { + encode( + message: QueryAllArticlesResponse, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.article) { + Article.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryAllArticlesResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAllArticlesResponse, + } as QueryAllArticlesResponse; + message.article = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.article.push(Article.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllArticlesResponse { + const message = { + ...baseQueryAllArticlesResponse, + } as QueryAllArticlesResponse; + message.article = []; + if (object.article !== undefined && object.article !== null) { + for (const e of object.article) { + message.article.push(Article.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllArticlesResponse): unknown { + const obj: any = {}; + if (message.article) { + obj.article = message.article.map((e) => + e ? Article.toJSON(e) : undefined + ); + } else { + obj.article = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAllArticlesResponse { + const message = { + ...baseQueryAllArticlesResponse, + } as QueryAllArticlesResponse; + message.article = []; + if (object.article !== undefined && object.article !== null) { + for (const e of object.article) { + message.article.push(Article.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAllAnonArticlesCountersRequest: object = {}; + +export const QueryAllAnonArticlesCountersRequest = { + encode( + message: QueryAllAnonArticlesCountersRequest, + writer: Writer = Writer.create() + ): Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryAllAnonArticlesCountersRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAllAnonArticlesCountersRequest, + } as QueryAllAnonArticlesCountersRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllAnonArticlesCountersRequest { + const message = { + ...baseQueryAllAnonArticlesCountersRequest, + } as QueryAllAnonArticlesCountersRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllAnonArticlesCountersRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAllAnonArticlesCountersRequest { + const message = { + ...baseQueryAllAnonArticlesCountersRequest, + } as QueryAllAnonArticlesCountersRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAllAnonArticlesCountersResponse: object = {}; + +export const QueryAllAnonArticlesCountersResponse = { + encode( + message: QueryAllAnonArticlesCountersResponse, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.AnonArticlesCounters) { + AnonArticlesCounter.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): QueryAllAnonArticlesCountersResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryAllAnonArticlesCountersResponse, + } as QueryAllAnonArticlesCountersResponse; + message.AnonArticlesCounters = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.AnonArticlesCounters.push( + AnonArticlesCounter.decode(reader, reader.uint32()) + ); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllAnonArticlesCountersResponse { + const message = { + ...baseQueryAllAnonArticlesCountersResponse, + } as QueryAllAnonArticlesCountersResponse; + message.AnonArticlesCounters = []; + if ( + object.AnonArticlesCounters !== undefined && + object.AnonArticlesCounters !== null + ) { + for (const e of object.AnonArticlesCounters) { + message.AnonArticlesCounters.push(AnonArticlesCounter.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllAnonArticlesCountersResponse): unknown { + const obj: any = {}; + if (message.AnonArticlesCounters) { + obj.AnonArticlesCounters = message.AnonArticlesCounters.map((e) => + e ? AnonArticlesCounter.toJSON(e) : undefined + ); + } else { + obj.AnonArticlesCounters = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): QueryAllAnonArticlesCountersResponse { + const message = { + ...baseQueryAllAnonArticlesCountersResponse, + } as QueryAllAnonArticlesCountersResponse; + message.AnonArticlesCounters = []; + if ( + object.AnonArticlesCounters !== undefined && + object.AnonArticlesCounters !== null + ) { + for (const e of object.AnonArticlesCounters) { + message.AnonArticlesCounters.push(AnonArticlesCounter.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** Parameters queries the parameters of the module. */ + Params(request: QueryParamsRequest): Promise; + /** Queries a list of AcceptedDomain items. */ + AcceptedDomain( + request: QueryAcceptedDomainRequest + ): Promise; + /** Queries a list of Publisher items. */ + Publisher(request: QueryPublisherRequest): Promise; + /** Queries publisher by index/address. */ + PublisherByIndex( + request: QueryPublisherByIndexRequest + ): Promise; + /** Queries a list of ArticlesByPrefix items. */ + AllArticles( + request: QueryAllArticlesRequest + ): Promise; + /** Queries a list of AllAnonArticlesCounters items. */ + AllAnonArticlesCounters( + request: QueryAllAnonArticlesCountersRequest + ): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("bze.cointrunk.v1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new Reader(data))); + } + + AcceptedDomain( + request: QueryAcceptedDomainRequest + ): Promise { + const data = QueryAcceptedDomainRequest.encode(request).finish(); + const promise = this.rpc.request( + "bze.cointrunk.v1.Query", + "AcceptedDomain", + data + ); + return promise.then((data) => + QueryAcceptedDomainResponse.decode(new Reader(data)) + ); + } + + Publisher(request: QueryPublisherRequest): Promise { + const data = QueryPublisherRequest.encode(request).finish(); + const promise = this.rpc.request( + "bze.cointrunk.v1.Query", + "Publisher", + data + ); + return promise.then((data) => + QueryPublisherResponse.decode(new Reader(data)) + ); + } + + PublisherByIndex( + request: QueryPublisherByIndexRequest + ): Promise { + const data = QueryPublisherByIndexRequest.encode(request).finish(); + const promise = this.rpc.request( + "bze.cointrunk.v1.Query", + "PublisherByIndex", + data + ); + return promise.then((data) => + QueryPublisherByIndexResponse.decode(new Reader(data)) + ); + } + + AllArticles( + request: QueryAllArticlesRequest + ): Promise { + const data = QueryAllArticlesRequest.encode(request).finish(); + const promise = this.rpc.request( + "bze.cointrunk.v1.Query", + "AllArticles", + data + ); + return promise.then((data) => + QueryAllArticlesResponse.decode(new Reader(data)) + ); + } + + AllAnonArticlesCounters( + request: QueryAllAnonArticlesCountersRequest + ): Promise { + const data = QueryAllAnonArticlesCountersRequest.encode(request).finish(); + const promise = this.rpc.request( + "bze.cointrunk.v1.Query", + "AllAnonArticlesCounters", + data + ); + return promise.then((data) => + QueryAllAnonArticlesCountersResponse.decode(new Reader(data)) + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/tx.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/tx.ts new file mode 100644 index 00000000..474e7625 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/tx.ts @@ -0,0 +1,477 @@ +/* eslint-disable */ +import { Reader, util, configure, Writer } from "protobufjs/minimal"; +import * as Long from "long"; + +export const protobufPackage = "bze.cointrunk.v1"; + +export interface MsgAddArticle { + publisher: string; + title: string; + url: string; + picture: string; +} + +export interface MsgAddArticleResponse {} + +export interface MsgPayPublisherRespect { + creator: string; + address: string; + amount: string; +} + +export interface MsgPayPublisherRespectResponse { + respectPaid: number; + publisherReward: number; + communityPoolFunds: number; +} + +const baseMsgAddArticle: object = { + publisher: "", + title: "", + url: "", + picture: "", +}; + +export const MsgAddArticle = { + encode(message: MsgAddArticle, writer: Writer = Writer.create()): Writer { + if (message.publisher !== "") { + writer.uint32(10).string(message.publisher); + } + if (message.title !== "") { + writer.uint32(18).string(message.title); + } + if (message.url !== "") { + writer.uint32(26).string(message.url); + } + if (message.picture !== "") { + writer.uint32(34).string(message.picture); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MsgAddArticle { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgAddArticle } as MsgAddArticle; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publisher = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.url = reader.string(); + break; + case 4: + message.picture = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgAddArticle { + const message = { ...baseMsgAddArticle } as MsgAddArticle; + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = String(object.publisher); + } else { + message.publisher = ""; + } + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = String(object.url); + } else { + message.url = ""; + } + if (object.picture !== undefined && object.picture !== null) { + message.picture = String(object.picture); + } else { + message.picture = ""; + } + return message; + }, + + toJSON(message: MsgAddArticle): unknown { + const obj: any = {}; + message.publisher !== undefined && (obj.publisher = message.publisher); + message.title !== undefined && (obj.title = message.title); + message.url !== undefined && (obj.url = message.url); + message.picture !== undefined && (obj.picture = message.picture); + return obj; + }, + + fromPartial(object: DeepPartial): MsgAddArticle { + const message = { ...baseMsgAddArticle } as MsgAddArticle; + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = object.publisher; + } else { + message.publisher = ""; + } + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.url !== undefined && object.url !== null) { + message.url = object.url; + } else { + message.url = ""; + } + if (object.picture !== undefined && object.picture !== null) { + message.picture = object.picture; + } else { + message.picture = ""; + } + return message; + }, +}; + +const baseMsgAddArticleResponse: object = {}; + +export const MsgAddArticleResponse = { + encode(_: MsgAddArticleResponse, writer: Writer = Writer.create()): Writer { + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MsgAddArticleResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgAddArticleResponse } as MsgAddArticleResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgAddArticleResponse { + const message = { ...baseMsgAddArticleResponse } as MsgAddArticleResponse; + return message; + }, + + toJSON(_: MsgAddArticleResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgAddArticleResponse { + const message = { ...baseMsgAddArticleResponse } as MsgAddArticleResponse; + return message; + }, +}; + +const baseMsgPayPublisherRespect: object = { + creator: "", + address: "", + amount: "", +}; + +export const MsgPayPublisherRespect = { + encode( + message: MsgPayPublisherRespect, + writer: Writer = Writer.create() + ): Writer { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.amount !== "") { + writer.uint32(26).string(message.amount); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MsgPayPublisherRespect { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgPayPublisherRespect } as MsgPayPublisherRespect; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgPayPublisherRespect { + const message = { ...baseMsgPayPublisherRespect } as MsgPayPublisherRespect; + if (object.creator !== undefined && object.creator !== null) { + message.creator = String(object.creator); + } else { + message.creator = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + return message; + }, + + toJSON(message: MsgPayPublisherRespect): unknown { + const obj: any = {}; + message.creator !== undefined && (obj.creator = message.creator); + message.address !== undefined && (obj.address = message.address); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, + + fromPartial( + object: DeepPartial + ): MsgPayPublisherRespect { + const message = { ...baseMsgPayPublisherRespect } as MsgPayPublisherRespect; + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } else { + message.creator = ""; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + return message; + }, +}; + +const baseMsgPayPublisherRespectResponse: object = { + respectPaid: 0, + publisherReward: 0, + communityPoolFunds: 0, +}; + +export const MsgPayPublisherRespectResponse = { + encode( + message: MsgPayPublisherRespectResponse, + writer: Writer = Writer.create() + ): Writer { + if (message.respectPaid !== 0) { + writer.uint32(8).uint64(message.respectPaid); + } + if (message.publisherReward !== 0) { + writer.uint32(16).uint64(message.publisherReward); + } + if (message.communityPoolFunds !== 0) { + writer.uint32(24).uint64(message.communityPoolFunds); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): MsgPayPublisherRespectResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMsgPayPublisherRespectResponse, + } as MsgPayPublisherRespectResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.respectPaid = longToNumber(reader.uint64() as Long); + break; + case 2: + message.publisherReward = longToNumber(reader.uint64() as Long); + break; + case 3: + message.communityPoolFunds = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgPayPublisherRespectResponse { + const message = { + ...baseMsgPayPublisherRespectResponse, + } as MsgPayPublisherRespectResponse; + if (object.respectPaid !== undefined && object.respectPaid !== null) { + message.respectPaid = Number(object.respectPaid); + } else { + message.respectPaid = 0; + } + if ( + object.publisherReward !== undefined && + object.publisherReward !== null + ) { + message.publisherReward = Number(object.publisherReward); + } else { + message.publisherReward = 0; + } + if ( + object.communityPoolFunds !== undefined && + object.communityPoolFunds !== null + ) { + message.communityPoolFunds = Number(object.communityPoolFunds); + } else { + message.communityPoolFunds = 0; + } + return message; + }, + + toJSON(message: MsgPayPublisherRespectResponse): unknown { + const obj: any = {}; + message.respectPaid !== undefined && + (obj.respectPaid = message.respectPaid); + message.publisherReward !== undefined && + (obj.publisherReward = message.publisherReward); + message.communityPoolFunds !== undefined && + (obj.communityPoolFunds = message.communityPoolFunds); + return obj; + }, + + fromPartial( + object: DeepPartial + ): MsgPayPublisherRespectResponse { + const message = { + ...baseMsgPayPublisherRespectResponse, + } as MsgPayPublisherRespectResponse; + if (object.respectPaid !== undefined && object.respectPaid !== null) { + message.respectPaid = object.respectPaid; + } else { + message.respectPaid = 0; + } + if ( + object.publisherReward !== undefined && + object.publisherReward !== null + ) { + message.publisherReward = object.publisherReward; + } else { + message.publisherReward = 0; + } + if ( + object.communityPoolFunds !== undefined && + object.communityPoolFunds !== null + ) { + message.communityPoolFunds = object.communityPoolFunds; + } else { + message.communityPoolFunds = 0; + } + return message; + }, +}; + +/** Msg defines the Msg service. */ +export interface Msg { + AddArticle(request: MsgAddArticle): Promise; + /** this line is used by starport scaffolding # proto/tx/rpc */ + PayPublisherRespect( + request: MsgPayPublisherRespect + ): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + } + AddArticle(request: MsgAddArticle): Promise { + const data = MsgAddArticle.encode(request).finish(); + const promise = this.rpc.request( + "bze.cointrunk.v1.Msg", + "AddArticle", + data + ); + return promise.then((data) => + MsgAddArticleResponse.decode(new Reader(data)) + ); + } + + PayPublisherRespect( + request: MsgPayPublisherRespect + ): Promise { + const data = MsgPayPublisherRespect.encode(request).finish(); + const promise = this.rpc.request( + "bze.cointrunk.v1.Msg", + "PayPublisherRespect", + data + ); + return promise.then((data) => + MsgPayPublisherRespectResponse.decode(new Reader(data)) + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 00000000..9c87ac0c --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,328 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.query.v1beta1"; + +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequest { + /** + * 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. + */ + key: Uint8Array; + /** + * 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. + */ + offset: number; + /** + * 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. + */ + limit: number; + /** + * 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. + */ + count_total: boolean; + /** + * reverse is set to true if results are to be returned in the descending order. + * + * Since: cosmos-sdk 0.43 + */ + reverse: boolean; +} + +/** + * 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; + * } + */ +export interface PageResponse { + /** + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently + */ + next_key: Uint8Array; + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + */ + total: number; +} + +const basePageRequest: object = { + offset: 0, + limit: 0, + count_total: false, + reverse: false, +}; + +export const PageRequest = { + encode(message: PageRequest, writer: Writer = Writer.create()): Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.offset !== 0) { + writer.uint32(16).uint64(message.offset); + } + if (message.limit !== 0) { + writer.uint32(24).uint64(message.limit); + } + if (message.count_total === true) { + writer.uint32(32).bool(message.count_total); + } + if (message.reverse === true) { + writer.uint32(40).bool(message.reverse); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PageRequest { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePageRequest } as PageRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.offset = longToNumber(reader.uint64() as Long); + break; + case 3: + message.limit = longToNumber(reader.uint64() as Long); + break; + case 4: + message.count_total = reader.bool(); + break; + case 5: + message.reverse = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PageRequest { + const message = { ...basePageRequest } as PageRequest; + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = Number(object.offset); + } else { + message.offset = 0; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = Number(object.limit); + } else { + message.limit = 0; + } + if (object.count_total !== undefined && object.count_total !== null) { + message.count_total = Boolean(object.count_total); + } else { + message.count_total = false; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = Boolean(object.reverse); + } else { + message.reverse = false; + } + return message; + }, + + toJSON(message: PageRequest): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes( + message.key !== undefined ? message.key : new Uint8Array() + )); + message.offset !== undefined && (obj.offset = message.offset); + message.limit !== undefined && (obj.limit = message.limit); + message.count_total !== undefined && + (obj.count_total = message.count_total); + message.reverse !== undefined && (obj.reverse = message.reverse); + return obj; + }, + + fromPartial(object: DeepPartial): PageRequest { + const message = { ...basePageRequest } as PageRequest; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = object.offset; + } else { + message.offset = 0; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = object.limit; + } else { + message.limit = 0; + } + if (object.count_total !== undefined && object.count_total !== null) { + message.count_total = object.count_total; + } else { + message.count_total = false; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = object.reverse; + } else { + message.reverse = false; + } + return message; + }, +}; + +const basePageResponse: object = { total: 0 }; + +export const PageResponse = { + encode(message: PageResponse, writer: Writer = Writer.create()): Writer { + if (message.next_key.length !== 0) { + writer.uint32(10).bytes(message.next_key); + } + if (message.total !== 0) { + writer.uint32(16).uint64(message.total); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PageResponse { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePageResponse } as PageResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.next_key = reader.bytes(); + break; + case 2: + message.total = longToNumber(reader.uint64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PageResponse { + const message = { ...basePageResponse } as PageResponse; + if (object.next_key !== undefined && object.next_key !== null) { + message.next_key = bytesFromBase64(object.next_key); + } + if (object.total !== undefined && object.total !== null) { + message.total = Number(object.total); + } else { + message.total = 0; + } + return message; + }, + + toJSON(message: PageResponse): unknown { + const obj: any = {}; + message.next_key !== undefined && + (obj.next_key = base64FromBytes( + message.next_key !== undefined ? message.next_key : new Uint8Array() + )); + message.total !== undefined && (obj.total = message.total); + return obj; + }, + + fromPartial(object: DeepPartial): PageResponse { + const message = { ...basePageResponse } as PageResponse; + if (object.next_key !== undefined && object.next_key !== null) { + message.next_key = object.next_key; + } else { + message.next_key = new Uint8Array(); + } + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } else { + message.total = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cosmos/base/v1beta1/coin.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cosmos/base/v1beta1/coin.ts new file mode 100644 index 00000000..ce2ac984 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,301 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.v1beta1"; + +/** + * 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. + */ +export interface Coin { + denom: string; + amount: string; +} + +/** + * 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. + */ +export interface DecCoin { + denom: string; + amount: string; +} + +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProto { + int: string; +} + +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProto { + dec: string; +} + +const baseCoin: object = { denom: "", amount: "" }; + +export const Coin = { + encode(message: Coin, writer: Writer = Writer.create()): Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Coin { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCoin } as Coin; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Coin { + const message = { ...baseCoin } as Coin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + return message; + }, + + toJSON(message: Coin): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, + + fromPartial(object: DeepPartial): Coin { + const message = { ...baseCoin } as Coin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + return message; + }, +}; + +const baseDecCoin: object = { denom: "", amount: "" }; + +export const DecCoin = { + encode(message: DecCoin, writer: Writer = Writer.create()): Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DecCoin { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDecCoin } as DecCoin; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DecCoin { + const message = { ...baseDecCoin } as DecCoin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + return message; + }, + + toJSON(message: DecCoin): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, + + fromPartial(object: DeepPartial): DecCoin { + const message = { ...baseDecCoin } as DecCoin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + return message; + }, +}; + +const baseIntProto: object = { int: "" }; + +export const IntProto = { + encode(message: IntProto, writer: Writer = Writer.create()): Writer { + if (message.int !== "") { + writer.uint32(10).string(message.int); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): IntProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseIntProto } as IntProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.int = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IntProto { + const message = { ...baseIntProto } as IntProto; + if (object.int !== undefined && object.int !== null) { + message.int = String(object.int); + } else { + message.int = ""; + } + return message; + }, + + toJSON(message: IntProto): unknown { + const obj: any = {}; + message.int !== undefined && (obj.int = message.int); + return obj; + }, + + fromPartial(object: DeepPartial): IntProto { + const message = { ...baseIntProto } as IntProto; + if (object.int !== undefined && object.int !== null) { + message.int = object.int; + } else { + message.int = ""; + } + return message; + }, +}; + +const baseDecProto: object = { dec: "" }; + +export const DecProto = { + encode(message: DecProto, writer: Writer = Writer.create()): Writer { + if (message.dec !== "") { + writer.uint32(10).string(message.dec); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DecProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDecProto } as DecProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dec = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DecProto { + const message = { ...baseDecProto } as DecProto; + if (object.dec !== undefined && object.dec !== null) { + message.dec = String(object.dec); + } else { + message.dec = ""; + } + return message; + }, + + toJSON(message: DecProto): unknown { + const obj: any = {}; + message.dec !== undefined && (obj.dec = message.dec); + return obj; + }, + + fromPartial(object: DeepPartial): DecProto { + const message = { ...baseDecProto } as DecProto; + if (object.dec !== undefined && object.dec !== null) { + message.dec = object.dec; + } else { + message.dec = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/gogoproto/gogo.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/gogoproto/gogo.ts new file mode 100644 index 00000000..3f41a047 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/gogoproto/gogo.ts @@ -0,0 +1,2 @@ +/* eslint-disable */ +export const protobufPackage = "gogoproto"; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/google/api/annotations.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/google/api/annotations.ts new file mode 100644 index 00000000..aace4787 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/google/api/annotations.ts @@ -0,0 +1,2 @@ +/* eslint-disable */ +export const protobufPackage = "google.api"; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/google/api/http.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/google/api/http.ts new file mode 100644 index 00000000..ccadff68 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/google/api/http.ts @@ -0,0 +1,706 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "google.api"; + +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path parmeters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fully_decode_reserved_expansion: boolean; +} + +/** + * `HttpRule` defines the mapping of an RPC method to one or more HTTP + * REST API methods. The mapping specifies how different portions of the RPC + * request message are mapped to URL path, URL query parameters, and + * HTTP request body. The mapping is typically specified as an + * `google.api.http` annotation on the RPC method, + * see "google/api/annotations.proto" for details. + * + * The mapping consists of a field specifying the path template and + * method kind. The path template can refer to fields in the request + * message, as in the example below which describes a REST GET + * operation on a resource collection of messages: + * + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * SubMessage sub = 2; // `sub.subfield` is url-mapped + * } + * message Message { + * string text = 1; // content of the resource + * } + * + * The same http annotation can alternatively be expressed inside the + * `GRPC API Configuration` YAML file. + * + * http: + * rules: + * - selector: .Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * This definition enables an automatic, bidrectional mapping of HTTP + * JSON to RPC. Example: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` + * + * In general, not only fields but also field paths can be referenced + * from a path pattern. Fields mapped to the path pattern cannot be + * repeated and must have a primitive (non-message) type. + * + * Any fields in the request message which are not bound by the path + * pattern automatically become (optional) HTTP query + * parameters. Assume the following definition of the request message: + * + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * int64 revision = 2; // becomes a parameter + * SubMessage sub = 3; // `sub.subfield` becomes a parameter + * } + * + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` + * + * Note that fields which are mapped to HTTP parameters must have a + * primitive type or a repeated primitive type. Message types are not + * allowed. In the case of a repeated type, the parameter can be + * repeated in the URL, as in `...?param=A¶m=B`. + * + * For HTTP method kinds which allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | RPC + * -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | RPC + * -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice of + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * + * This enables the following two alternative HTTP JSON to RPC + * mappings: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` + * + * # Rules for HTTP mapping + * + * The rules for mapping HTTP path, query parameters, and body fields + * to the request message are as follows: + * + * 1. The `body` field specifies either `*` or a field path, or is + * omitted. If omitted, it indicates there is no HTTP request body. + * 2. Leaf fields (recursive expansion of nested messages in the + * request) can be classified into three types: + * (a) Matched in the URL template. + * (b) Covered by body (if body is `*`, everything except (a) fields; + * else everything under the body field) + * (c) All other fields. + * 3. URL query parameters found in the HTTP request are mapped to (c) fields. + * 4. Any body sent with an HTTP request can contain only (b) fields. + * + * The syntax of the path template is as follows: + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single path segment. The syntax `**` matches zero + * or more path segments, which must be the last part of the path except the + * `Verb`. The syntax `LITERAL` matches literal text in the path. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path, all characters + * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the + * Discovery Document as `{var}`. + * + * If a variable contains one or more path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path, all + * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables + * show up in the Discovery Document as `{+var}`. + * + * NOTE: While the single segment variable matches the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 + * Simple String Expansion, the multi segment variable **does not** match + * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. + * + * NOTE: the field paths in variables and in the `body` must not refer to + * repeated fields or map fields. + */ +export interface HttpRule { + /** + * Selects methods to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + */ + selector: string; + /** Used for listing and getting information about resources. */ + get: string | undefined; + /** Used for updating a resource. */ + put: string | undefined; + /** Used for creating a resource. */ + post: string | undefined; + /** Used for deleting a resource. */ + delete: string | undefined; + /** Used for updating a resource. */ + patch: string | undefined; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom: CustomHttpPattern | undefined; + /** + * The name of the request field whose value is mapped to the HTTP body, or + * `*` for mapping all fields not captured by the path pattern to the HTTP + * body. NOTE: the referred field must not be a repeated field and must be + * present at the top-level of request message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * body of response. Other response fields are ignored. When + * not set, the response message will be used as HTTP body of response. + */ + response_body: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additional_bindings: HttpRule[]; +} + +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPattern { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} + +const baseHttp: object = { fully_decode_reserved_expansion: false }; + +export const Http = { + encode(message: Http, writer: Writer = Writer.create()): Writer { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fully_decode_reserved_expansion === true) { + writer.uint32(16).bool(message.fully_decode_reserved_expansion); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Http { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHttp } as Http; + message.rules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rules.push(HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fully_decode_reserved_expansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromJSON(e)); + } + } + if ( + object.fully_decode_reserved_expansion !== undefined && + object.fully_decode_reserved_expansion !== null + ) { + message.fully_decode_reserved_expansion = Boolean( + object.fully_decode_reserved_expansion + ); + } else { + message.fully_decode_reserved_expansion = false; + } + return message; + }, + + toJSON(message: Http): unknown { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map((e) => + e ? HttpRule.toJSON(e) : undefined + ); + } else { + obj.rules = []; + } + message.fully_decode_reserved_expansion !== undefined && + (obj.fully_decode_reserved_expansion = + message.fully_decode_reserved_expansion); + return obj; + }, + + fromPartial(object: DeepPartial): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromPartial(e)); + } + } + if ( + object.fully_decode_reserved_expansion !== undefined && + object.fully_decode_reserved_expansion !== null + ) { + message.fully_decode_reserved_expansion = + object.fully_decode_reserved_expansion; + } else { + message.fully_decode_reserved_expansion = false; + } + return message; + }, +}; + +const baseHttpRule: object = { selector: "", body: "", response_body: "" }; + +export const HttpRule = { + encode(message: HttpRule, writer: Writer = Writer.create()): Writer { + if (message.selector !== "") { + writer.uint32(10).string(message.selector); + } + if (message.get !== undefined) { + writer.uint32(18).string(message.get); + } + if (message.put !== undefined) { + writer.uint32(26).string(message.put); + } + if (message.post !== undefined) { + writer.uint32(34).string(message.post); + } + if (message.delete !== undefined) { + writer.uint32(42).string(message.delete); + } + if (message.patch !== undefined) { + writer.uint32(50).string(message.patch); + } + if (message.custom !== undefined) { + CustomHttpPattern.encode( + message.custom, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.body !== "") { + writer.uint32(58).string(message.body); + } + if (message.response_body !== "") { + writer.uint32(98).string(message.response_body); + } + for (const v of message.additional_bindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): HttpRule { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message.delete = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.response_body = reader.string(); + break; + case 11: + message.additional_bindings.push( + HttpRule.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = String(object.selector); + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = String(object.get); + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = String(object.put); + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = String(object.post); + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = String(object.delete); + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = String(object.patch); + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromJSON(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = String(object.body); + } else { + message.body = ""; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.response_body = String(object.response_body); + } else { + message.response_body = ""; + } + if ( + object.additional_bindings !== undefined && + object.additional_bindings !== null + ) { + for (const e of object.additional_bindings) { + message.additional_bindings.push(HttpRule.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: HttpRule): unknown { + const obj: any = {}; + message.selector !== undefined && (obj.selector = message.selector); + message.get !== undefined && (obj.get = message.get); + message.put !== undefined && (obj.put = message.put); + message.post !== undefined && (obj.post = message.post); + message.delete !== undefined && (obj.delete = message.delete); + message.patch !== undefined && (obj.patch = message.patch); + message.custom !== undefined && + (obj.custom = message.custom + ? CustomHttpPattern.toJSON(message.custom) + : undefined); + message.body !== undefined && (obj.body = message.body); + message.response_body !== undefined && + (obj.response_body = message.response_body); + if (message.additional_bindings) { + obj.additional_bindings = message.additional_bindings.map((e) => + e ? HttpRule.toJSON(e) : undefined + ); + } else { + obj.additional_bindings = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additional_bindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromPartial(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } else { + message.body = ""; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.response_body = object.response_body; + } else { + message.response_body = ""; + } + if ( + object.additional_bindings !== undefined && + object.additional_bindings !== null + ) { + for (const e of object.additional_bindings) { + message.additional_bindings.push(HttpRule.fromPartial(e)); + } + } + return message; + }, +}; + +const baseCustomHttpPattern: object = { kind: "", path: "" }; + +export const CustomHttpPattern = { + encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer { + if (message.kind !== "") { + writer.uint32(10).string(message.kind); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = String(object.kind); + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = String(object.path); + } else { + message.path = ""; + } + return message; + }, + + toJSON(message: CustomHttpPattern): unknown { + const obj: any = {}; + message.kind !== undefined && (obj.kind = message.kind); + message.path !== undefined && (obj.path = message.path); + return obj; + }, + + fromPartial(object: DeepPartial): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/google/protobuf/descriptor.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/google/protobuf/descriptor.ts new file mode 100644 index 00000000..a0167cb2 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/google/protobuf/descriptor.ts @@ -0,0 +1,5314 @@ +/* eslint-disable */ +import * as Long from "long"; +import { util, configure, Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} + +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name: string; + /** e.g. "foo", "foo.bar", etc. */ + package: string; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + public_dependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weak_dependency: number[]; + /** All top-level definitions in this file. */ + message_type: DescriptorProto[]; + enum_type: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options: FileOptions | undefined; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + source_code_info: SourceCodeInfo | undefined; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax: string; +} + +/** Describes a message type. */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nested_type: DescriptorProto[]; + enum_type: EnumDescriptorProto[]; + extension_range: DescriptorProto_ExtensionRange[]; + oneof_decl: OneofDescriptorProto[]; + options: MessageOptions | undefined; + reserved_range: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reserved_name: string[]; +} + +export interface DescriptorProto_ExtensionRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; + options: ExtensionRangeOptions | undefined; +} + +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; +} + +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + type_name: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * TODO(kenton): Base-64 encode? + */ + default_value: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneof_index: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + json_name: string; + options: FieldOptions | undefined; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + */ + proto3_optional: boolean; +} + +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_TypeFromJSON( + object: any +): FieldDescriptorProto_Type { + switch (object) { + case 1: + case "TYPE_DOUBLE": + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case "TYPE_FLOAT": + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case "TYPE_INT64": + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case "TYPE_UINT64": + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case "TYPE_INT32": + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case "TYPE_FIXED64": + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case "TYPE_FIXED32": + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case "TYPE_BOOL": + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case "TYPE_STRING": + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case "TYPE_GROUP": + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case "TYPE_MESSAGE": + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case "TYPE_BYTES": + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case "TYPE_UINT32": + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case "TYPE_ENUM": + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case "TYPE_SFIXED32": + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case "TYPE_SFIXED64": + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case "TYPE_SINT32": + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case "TYPE_SINT64": + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_TypeToJSON( + object: FieldDescriptorProto_Type +): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return "TYPE_DOUBLE"; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return "TYPE_FLOAT"; + case FieldDescriptorProto_Type.TYPE_INT64: + return "TYPE_INT64"; + case FieldDescriptorProto_Type.TYPE_UINT64: + return "TYPE_UINT64"; + case FieldDescriptorProto_Type.TYPE_INT32: + return "TYPE_INT32"; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return "TYPE_FIXED64"; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return "TYPE_FIXED32"; + case FieldDescriptorProto_Type.TYPE_BOOL: + return "TYPE_BOOL"; + case FieldDescriptorProto_Type.TYPE_STRING: + return "TYPE_STRING"; + case FieldDescriptorProto_Type.TYPE_GROUP: + return "TYPE_GROUP"; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return "TYPE_MESSAGE"; + case FieldDescriptorProto_Type.TYPE_BYTES: + return "TYPE_BYTES"; + case FieldDescriptorProto_Type.TYPE_UINT32: + return "TYPE_UINT32"; + case FieldDescriptorProto_Type.TYPE_ENUM: + return "TYPE_ENUM"; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return "TYPE_SFIXED32"; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return "TYPE_SFIXED64"; + case FieldDescriptorProto_Type.TYPE_SINT32: + return "TYPE_SINT32"; + case FieldDescriptorProto_Type.TYPE_SINT64: + return "TYPE_SINT64"; + default: + return "UNKNOWN"; + } +} + +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_LabelFromJSON( + object: any +): FieldDescriptorProto_Label { + switch (object) { + case 1: + case "LABEL_OPTIONAL": + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_LabelToJSON( + object: FieldDescriptorProto_Label +): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return "LABEL_OPTIONAL"; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + default: + return "UNKNOWN"; + } +} + +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name: string; + options: OneofOptions | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options: EnumOptions | undefined; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reserved_range: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reserved_name: string[]; +} + +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} + +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options: EnumValueOptions | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options: ServiceOptions | undefined; +} + +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + input_type: string; + output_type: string; + options: MethodOptions | undefined; + /** Identifies if client streams multiple client messages */ + client_streaming: boolean; + /** Identifies if server streams multiple server messages */ + server_streaming: boolean; +} + +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + java_package: string; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + */ + java_outer_classname: string; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + java_multiple_files: boolean; + /** + * This option does nothing. + * + * @deprecated + */ + java_generate_equals_and_hash: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + java_string_check_utf8: boolean; + optimize_for: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + go_package: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + cc_generic_services: boolean; + java_generic_services: boolean; + py_generic_services: boolean; + php_generic_services: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + cc_enable_arenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objc_class_prefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharp_namespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swift_prefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + php_class_prefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + php_namespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + php_metadata_namespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + ruby_package: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpreted_option: UninterpretedOption[]; +} + +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, */ + SPEED = 1, + /** CODE_SIZE - etc. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} + +export function fileOptions_OptimizeModeFromJSON( + object: any +): FileOptions_OptimizeMode { + switch (object) { + case 1: + case "SPEED": + return FileOptions_OptimizeMode.SPEED; + case 2: + case "CODE_SIZE": + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case "LITE_RUNTIME": + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} + +export function fileOptions_OptimizeModeToJSON( + object: FileOptions_OptimizeMode +): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return "SPEED"; + case FileOptions_OptimizeMode.CODE_SIZE: + return "CODE_SIZE"; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return "LITE_RUNTIME"; + default: + return "UNKNOWN"; + } +} + +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + message_set_wire_format: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + no_standard_descriptor_accessor: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + map_entry: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + */ + lazy: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated: boolean; + /** For Google-internal migration only. Do not use. */ + weak: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case "STRING": + return FieldOptions_CType.STRING; + case 1: + case "CORD": + return FieldOptions_CType.CORD; + case 2: + case "STRING_PIECE": + return FieldOptions_CType.STRING_PIECE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} + +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return "STRING"; + case FieldOptions_CType.CORD: + return "CORD"; + case FieldOptions_CType.STRING_PIECE: + return "STRING_PIECE"; + default: + return "UNKNOWN"; + } +} + +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case "JS_NORMAL": + return FieldOptions_JSType.JS_NORMAL; + case 1: + case "JS_STRING": + return FieldOptions_JSType.JS_STRING; + case 2: + case "JS_NUMBER": + return FieldOptions_JSType.JS_NUMBER; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} + +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return "JS_NORMAL"; + case FieldOptions_JSType.JS_STRING: + return "JS_STRING"; + case FieldOptions_JSType.JS_NUMBER: + return "JS_NUMBER"; + default: + return "UNKNOWN"; + } +} + +export interface OneofOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allow_alias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface ServiceOptions { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated: boolean; + idempotency_level: MethodOptions_IdempotencyLevel; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpreted_option: UninterpretedOption[]; +} + +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} + +export function methodOptions_IdempotencyLevelFromJSON( + object: any +): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case "IDEMPOTENCY_UNKNOWN": + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case "NO_SIDE_EFFECTS": + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case "IDEMPOTENT": + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case "UNRECOGNIZED": + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} + +export function methodOptions_IdempotencyLevelToJSON( + object: MethodOptions_IdempotencyLevel +): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return "IDEMPOTENCY_UNKNOWN"; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return "NO_SIDE_EFFECTS"; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return "IDEMPOTENT"; + default: + return "UNKNOWN"; + } +} + +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifier_value: string; + positive_int_value: number; + negative_int_value: number; + double_value: number; + string_value: Uint8Array; + aggregate_value: string; +} + +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePart { + name_part: string; + is_extension: boolean; +} + +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} + +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition. For + * example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. * / + * /* Block comment attached to + * * grault. * / + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leading_comments: string; + trailing_comments: string; + leading_detached_comments: string[]; +} + +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} + +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + source_file: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end: number; +} + +const baseFileDescriptorSet: object = {}; + +export const FileDescriptorSet = { + encode(message: FileDescriptorSet, writer: Writer = Writer.create()): Writer { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.file.push( + FileDescriptorProto.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FileDescriptorSet): unknown { + const obj: any = {}; + if (message.file) { + obj.file = message.file.map((e) => + e ? FileDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.file = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFileDescriptorProto: object = { + name: "", + package: "", + dependency: "", + public_dependency: 0, + weak_dependency: 0, + syntax: "", +}; + +export const FileDescriptorProto = { + encode( + message: FileDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.package !== "") { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.public_dependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weak_dependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.message_type) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enum_type) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.source_code_info !== undefined) { + SourceCodeInfo.encode( + message.source_code_info, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.syntax !== "") { + writer.uint32(98).string(message.syntax); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.package = reader.string(); + break; + case 3: + message.dependency.push(reader.string()); + break; + case 10: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.public_dependency.push(reader.int32()); + } + } else { + message.public_dependency.push(reader.int32()); + } + break; + case 11: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weak_dependency.push(reader.int32()); + } + } else { + message.weak_dependency.push(reader.int32()); + } + break; + case 4: + message.message_type.push( + DescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 5: + message.enum_type.push( + EnumDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 6: + message.service.push( + ServiceDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 7: + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 8: + message.options = FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.source_code_info = SourceCodeInfo.decode( + reader, + reader.uint32() + ); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = String(object.package); + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(String(e)); + } + } + if ( + object.public_dependency !== undefined && + object.public_dependency !== null + ) { + for (const e of object.public_dependency) { + message.public_dependency.push(Number(e)); + } + } + if ( + object.weak_dependency !== undefined && + object.weak_dependency !== null + ) { + for (const e of object.weak_dependency) { + message.weak_dependency.push(Number(e)); + } + } + if (object.message_type !== undefined && object.message_type !== null) { + for (const e of object.message_type) { + message.message_type.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromJSON(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.source_code_info !== undefined && + object.source_code_info !== null + ) { + message.source_code_info = SourceCodeInfo.fromJSON( + object.source_code_info + ); + } else { + message.source_code_info = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = String(object.syntax); + } else { + message.syntax = ""; + } + return message; + }, + + toJSON(message: FileDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.package !== undefined && (obj.package = message.package); + if (message.dependency) { + obj.dependency = message.dependency.map((e) => e); + } else { + obj.dependency = []; + } + if (message.public_dependency) { + obj.public_dependency = message.public_dependency.map((e) => e); + } else { + obj.public_dependency = []; + } + if (message.weak_dependency) { + obj.weak_dependency = message.weak_dependency.map((e) => e); + } else { + obj.weak_dependency = []; + } + if (message.message_type) { + obj.message_type = message.message_type.map((e) => + e ? DescriptorProto.toJSON(e) : undefined + ); + } else { + obj.message_type = []; + } + if (message.enum_type) { + obj.enum_type = message.enum_type.map((e) => + e ? EnumDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.enum_type = []; + } + if (message.service) { + obj.service = message.service.map((e) => + e ? ServiceDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.service = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.extension = []; + } + message.options !== undefined && + (obj.options = message.options + ? FileOptions.toJSON(message.options) + : undefined); + message.source_code_info !== undefined && + (obj.source_code_info = message.source_code_info + ? SourceCodeInfo.toJSON(message.source_code_info) + : undefined); + message.syntax !== undefined && (obj.syntax = message.syntax); + return obj; + }, + + fromPartial(object: DeepPartial): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.public_dependency = []; + message.weak_dependency = []; + message.message_type = []; + message.enum_type = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(e); + } + } + if ( + object.public_dependency !== undefined && + object.public_dependency !== null + ) { + for (const e of object.public_dependency) { + message.public_dependency.push(e); + } + } + if ( + object.weak_dependency !== undefined && + object.weak_dependency !== null + ) { + for (const e of object.weak_dependency) { + message.weak_dependency.push(e); + } + } + if (object.message_type !== undefined && object.message_type !== null) { + for (const e of object.message_type) { + message.message_type.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromPartial(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.source_code_info !== undefined && + object.source_code_info !== null + ) { + message.source_code_info = SourceCodeInfo.fromPartial( + object.source_code_info + ); + } else { + message.source_code_info = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } else { + message.syntax = ""; + } + return message; + }, +}; + +const baseDescriptorProto: object = { name: "", reserved_name: "" }; + +export const DescriptorProto = { + encode(message: DescriptorProto, writer: Writer = Writer.create()): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nested_type) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enum_type) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extension_range) { + DescriptorProto_ExtensionRange.encode( + v!, + writer.uint32(42).fork() + ).ldelim(); + } + for (const v of message.oneof_decl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reserved_range) { + DescriptorProto_ReservedRange.encode( + v!, + writer.uint32(74).fork() + ).ldelim(); + } + for (const v of message.reserved_name) { + writer.uint32(82).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.field.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 6: + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.nested_type.push( + DescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 4: + message.enum_type.push( + EnumDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 5: + message.extension_range.push( + DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) + ); + break; + case 8: + message.oneof_decl.push( + OneofDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 7: + message.options = MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + message.reserved_range.push( + DescriptorProto_ReservedRange.decode(reader, reader.uint32()) + ); + break; + case 10: + message.reserved_name.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.nested_type !== undefined && object.nested_type !== null) { + for (const e of object.nested_type) { + message.nested_type.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromJSON(e)); + } + } + if ( + object.extension_range !== undefined && + object.extension_range !== null + ) { + for (const e of object.extension_range) { + message.extension_range.push( + DescriptorProto_ExtensionRange.fromJSON(e) + ); + } + } + if (object.oneof_decl !== undefined && object.oneof_decl !== null) { + for (const e of object.oneof_decl) { + message.oneof_decl.push(OneofDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push(DescriptorProto_ReservedRange.fromJSON(e)); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(String(e)); + } + } + return message; + }, + + toJSON(message: DescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.field) { + obj.field = message.field.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.field = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.extension = []; + } + if (message.nested_type) { + obj.nested_type = message.nested_type.map((e) => + e ? DescriptorProto.toJSON(e) : undefined + ); + } else { + obj.nested_type = []; + } + if (message.enum_type) { + obj.enum_type = message.enum_type.map((e) => + e ? EnumDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.enum_type = []; + } + if (message.extension_range) { + obj.extension_range = message.extension_range.map((e) => + e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined + ); + } else { + obj.extension_range = []; + } + if (message.oneof_decl) { + obj.oneof_decl = message.oneof_decl.map((e) => + e ? OneofDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.oneof_decl = []; + } + message.options !== undefined && + (obj.options = message.options + ? MessageOptions.toJSON(message.options) + : undefined); + if (message.reserved_range) { + obj.reserved_range = message.reserved_range.map((e) => + e ? DescriptorProto_ReservedRange.toJSON(e) : undefined + ); + } else { + obj.reserved_range = []; + } + if (message.reserved_name) { + obj.reserved_name = message.reserved_name.map((e) => e); + } else { + obj.reserved_name = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nested_type = []; + message.enum_type = []; + message.extension_range = []; + message.oneof_decl = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.nested_type !== undefined && object.nested_type !== null) { + for (const e of object.nested_type) { + message.nested_type.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enum_type !== undefined && object.enum_type !== null) { + for (const e of object.enum_type) { + message.enum_type.push(EnumDescriptorProto.fromPartial(e)); + } + } + if ( + object.extension_range !== undefined && + object.extension_range !== null + ) { + for (const e of object.extension_range) { + message.extension_range.push( + DescriptorProto_ExtensionRange.fromPartial(e) + ); + } + } + if (object.oneof_decl !== undefined && object.oneof_decl !== null) { + for (const e of object.oneof_decl) { + message.oneof_decl.push(OneofDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + DescriptorProto_ReservedRange.fromPartial(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(e); + } + } + return message; + }, +}; + +const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; + +export const DescriptorProto_ExtensionRange = { + encode( + message: DescriptorProto_ExtensionRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode( + message.options, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): DescriptorProto_ExtensionRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = ExtensionRangeOptions.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ExtensionRange { + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: DescriptorProto_ExtensionRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + message.options !== undefined && + (obj.options = message.options + ? ExtensionRangeOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): DescriptorProto_ExtensionRange { + const message = { + ...baseDescriptorProto_ExtensionRange, + } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; + +export const DescriptorProto_ReservedRange = { + encode( + message: DescriptorProto_ReservedRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): DescriptorProto_ReservedRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ReservedRange { + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: DescriptorProto_ReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): DescriptorProto_ReservedRange { + const message = { + ...baseDescriptorProto_ReservedRange, + } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +const baseExtensionRangeOptions: object = {}; + +export const ExtensionRangeOptions = { + encode( + message: ExtensionRangeOptions, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ExtensionRangeOptions): unknown { + const obj: any = {}; + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial( + object: DeepPartial + ): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFieldDescriptorProto: object = { + name: "", + number: 0, + label: 1, + type: 1, + type_name: "", + extendee: "", + default_value: "", + oneof_index: 0, + json_name: "", + proto3_optional: false, +}; + +export const FieldDescriptorProto = { + encode( + message: FieldDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.type_name !== "") { + writer.uint32(50).string(message.type_name); + } + if (message.extendee !== "") { + writer.uint32(18).string(message.extendee); + } + if (message.default_value !== "") { + writer.uint32(58).string(message.default_value); + } + if (message.oneof_index !== 0) { + writer.uint32(72).int32(message.oneof_index); + } + if (message.json_name !== "") { + writer.uint32(82).string(message.json_name); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.proto3_optional === true) { + writer.uint32(136).bool(message.proto3_optional); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32() as any; + break; + case 5: + message.type = reader.int32() as any; + break; + case 6: + message.type_name = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.default_value = reader.string(); + break; + case 9: + message.oneof_index = reader.int32(); + break; + case 10: + message.json_name = reader.string(); + break; + case 8: + message.options = FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3_optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = fieldDescriptorProto_LabelFromJSON(object.label); + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = fieldDescriptorProto_TypeFromJSON(object.type); + } else { + message.type = 1; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.type_name = String(object.type_name); + } else { + message.type_name = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = String(object.extendee); + } else { + message.extendee = ""; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.default_value = String(object.default_value); + } else { + message.default_value = ""; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneof_index = Number(object.oneof_index); + } else { + message.oneof_index = 0; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.json_name = String(object.json_name); + } else { + message.json_name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.proto3_optional !== undefined && + object.proto3_optional !== null + ) { + message.proto3_optional = Boolean(object.proto3_optional); + } else { + message.proto3_optional = false; + } + return message; + }, + + toJSON(message: FieldDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.label !== undefined && + (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); + message.type !== undefined && + (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); + message.type_name !== undefined && (obj.type_name = message.type_name); + message.extendee !== undefined && (obj.extendee = message.extendee); + message.default_value !== undefined && + (obj.default_value = message.default_value); + message.oneof_index !== undefined && + (obj.oneof_index = message.oneof_index); + message.json_name !== undefined && (obj.json_name = message.json_name); + message.options !== undefined && + (obj.options = message.options + ? FieldOptions.toJSON(message.options) + : undefined); + message.proto3_optional !== undefined && + (obj.proto3_optional = message.proto3_optional); + return obj; + }, + + fromPartial(object: DeepPartial): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 1; + } + if (object.type_name !== undefined && object.type_name !== null) { + message.type_name = object.type_name; + } else { + message.type_name = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } else { + message.extendee = ""; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.default_value = object.default_value; + } else { + message.default_value = ""; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneof_index = object.oneof_index; + } else { + message.oneof_index = 0; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.json_name = object.json_name; + } else { + message.json_name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.proto3_optional !== undefined && + object.proto3_optional !== null + ) { + message.proto3_optional = object.proto3_optional; + } else { + message.proto3_optional = false; + } + return message; + }, +}; + +const baseOneofDescriptorProto: object = { name: "" }; + +export const OneofDescriptorProto = { + encode( + message: OneofDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: OneofDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.options !== undefined && + (obj.options = message.options + ? OneofOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseEnumDescriptorProto: object = { name: "", reserved_name: "" }; + +export const EnumDescriptorProto = { + encode( + message: EnumDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reserved_range) { + EnumDescriptorProto_EnumReservedRange.encode( + v!, + writer.uint32(34).fork() + ).ldelim(); + } + for (const v of message.reserved_name) { + writer.uint32(42).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value.push( + EnumValueDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.options = EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.decode( + reader, + reader.uint32() + ) + ); + break; + case 5: + message.reserved_name.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.fromJSON(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(String(e)); + } + } + return message; + }, + + toJSON(message: EnumDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.value) { + obj.value = message.value.map((e) => + e ? EnumValueDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.value = []; + } + message.options !== undefined && + (obj.options = message.options + ? EnumOptions.toJSON(message.options) + : undefined); + if (message.reserved_range) { + obj.reserved_range = message.reserved_range.map((e) => + e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined + ); + } else { + obj.reserved_range = []; + } + if (message.reserved_name) { + obj.reserved_name = message.reserved_name.map((e) => e); + } else { + obj.reserved_name = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reserved_range = []; + message.reserved_name = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reserved_range !== undefined && object.reserved_range !== null) { + for (const e of object.reserved_range) { + message.reserved_range.push( + EnumDescriptorProto_EnumReservedRange.fromPartial(e) + ); + } + } + if (object.reserved_name !== undefined && object.reserved_name !== null) { + for (const e of object.reserved_name) { + message.reserved_name.push(e); + } + } + return message; + }, +}; + +const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; + +export const EnumDescriptorProto_EnumReservedRange = { + encode( + message: EnumDescriptorProto_EnumReservedRange, + writer: Writer = Writer.create() + ): Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): EnumDescriptorProto_EnumReservedRange { + const message = { + ...baseEnumDescriptorProto_EnumReservedRange, + } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; + +export const EnumValueDescriptorProto = { + encode( + message: EnumValueDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode( + message.options, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): EnumValueDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumValueDescriptorProto { + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: EnumValueDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.options !== undefined && + (obj.options = message.options + ? EnumValueOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): EnumValueDescriptorProto { + const message = { + ...baseEnumValueDescriptorProto, + } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseServiceDescriptorProto: object = { name: "" }; + +export const ServiceDescriptorProto = { + encode( + message: ServiceDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.method.push( + MethodDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.options = ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: ServiceDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.method) { + obj.method = message.method.map((e) => + e ? MethodDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.method = []; + } + message.options !== undefined && + (obj.options = message.options + ? ServiceOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseMethodDescriptorProto: object = { + name: "", + input_type: "", + output_type: "", + client_streaming: false, + server_streaming: false, +}; + +export const MethodDescriptorProto = { + encode( + message: MethodDescriptorProto, + writer: Writer = Writer.create() + ): Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.input_type !== "") { + writer.uint32(18).string(message.input_type); + } + if (message.output_type !== "") { + writer.uint32(26).string(message.output_type); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + if (message.client_streaming === true) { + writer.uint32(40).bool(message.client_streaming); + } + if (message.server_streaming === true) { + writer.uint32(48).bool(message.server_streaming); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.input_type = reader.string(); + break; + case 3: + message.output_type = reader.string(); + break; + case 4: + message.options = MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.client_streaming = reader.bool(); + break; + case 6: + message.server_streaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.input_type = String(object.input_type); + } else { + message.input_type = ""; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.output_type = String(object.output_type); + } else { + message.output_type = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if ( + object.client_streaming !== undefined && + object.client_streaming !== null + ) { + message.client_streaming = Boolean(object.client_streaming); + } else { + message.client_streaming = false; + } + if ( + object.server_streaming !== undefined && + object.server_streaming !== null + ) { + message.server_streaming = Boolean(object.server_streaming); + } else { + message.server_streaming = false; + } + return message; + }, + + toJSON(message: MethodDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.input_type !== undefined && (obj.input_type = message.input_type); + message.output_type !== undefined && + (obj.output_type = message.output_type); + message.options !== undefined && + (obj.options = message.options + ? MethodOptions.toJSON(message.options) + : undefined); + message.client_streaming !== undefined && + (obj.client_streaming = message.client_streaming); + message.server_streaming !== undefined && + (obj.server_streaming = message.server_streaming); + return obj; + }, + + fromPartial( + object: DeepPartial + ): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.input_type = object.input_type; + } else { + message.input_type = ""; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.output_type = object.output_type; + } else { + message.output_type = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if ( + object.client_streaming !== undefined && + object.client_streaming !== null + ) { + message.client_streaming = object.client_streaming; + } else { + message.client_streaming = false; + } + if ( + object.server_streaming !== undefined && + object.server_streaming !== null + ) { + message.server_streaming = object.server_streaming; + } else { + message.server_streaming = false; + } + return message; + }, +}; + +const baseFileOptions: object = { + java_package: "", + java_outer_classname: "", + java_multiple_files: false, + java_generate_equals_and_hash: false, + java_string_check_utf8: false, + optimize_for: 1, + go_package: "", + cc_generic_services: false, + java_generic_services: false, + py_generic_services: false, + php_generic_services: false, + deprecated: false, + cc_enable_arenas: false, + objc_class_prefix: "", + csharp_namespace: "", + swift_prefix: "", + php_class_prefix: "", + php_namespace: "", + php_metadata_namespace: "", + ruby_package: "", +}; + +export const FileOptions = { + encode(message: FileOptions, writer: Writer = Writer.create()): Writer { + if (message.java_package !== "") { + writer.uint32(10).string(message.java_package); + } + if (message.java_outer_classname !== "") { + writer.uint32(66).string(message.java_outer_classname); + } + if (message.java_multiple_files === true) { + writer.uint32(80).bool(message.java_multiple_files); + } + if (message.java_generate_equals_and_hash === true) { + writer.uint32(160).bool(message.java_generate_equals_and_hash); + } + if (message.java_string_check_utf8 === true) { + writer.uint32(216).bool(message.java_string_check_utf8); + } + if (message.optimize_for !== 1) { + writer.uint32(72).int32(message.optimize_for); + } + if (message.go_package !== "") { + writer.uint32(90).string(message.go_package); + } + if (message.cc_generic_services === true) { + writer.uint32(128).bool(message.cc_generic_services); + } + if (message.java_generic_services === true) { + writer.uint32(136).bool(message.java_generic_services); + } + if (message.py_generic_services === true) { + writer.uint32(144).bool(message.py_generic_services); + } + if (message.php_generic_services === true) { + writer.uint32(336).bool(message.php_generic_services); + } + if (message.deprecated === true) { + writer.uint32(184).bool(message.deprecated); + } + if (message.cc_enable_arenas === true) { + writer.uint32(248).bool(message.cc_enable_arenas); + } + if (message.objc_class_prefix !== "") { + writer.uint32(290).string(message.objc_class_prefix); + } + if (message.csharp_namespace !== "") { + writer.uint32(298).string(message.csharp_namespace); + } + if (message.swift_prefix !== "") { + writer.uint32(314).string(message.swift_prefix); + } + if (message.php_class_prefix !== "") { + writer.uint32(322).string(message.php_class_prefix); + } + if (message.php_namespace !== "") { + writer.uint32(330).string(message.php_namespace); + } + if (message.php_metadata_namespace !== "") { + writer.uint32(354).string(message.php_metadata_namespace); + } + if (message.ruby_package !== "") { + writer.uint32(362).string(message.ruby_package); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.java_package = reader.string(); + break; + case 8: + message.java_outer_classname = reader.string(); + break; + case 10: + message.java_multiple_files = reader.bool(); + break; + case 20: + message.java_generate_equals_and_hash = reader.bool(); + break; + case 27: + message.java_string_check_utf8 = reader.bool(); + break; + case 9: + message.optimize_for = reader.int32() as any; + break; + case 11: + message.go_package = reader.string(); + break; + case 16: + message.cc_generic_services = reader.bool(); + break; + case 17: + message.java_generic_services = reader.bool(); + break; + case 18: + message.py_generic_services = reader.bool(); + break; + case 42: + message.php_generic_services = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.cc_enable_arenas = reader.bool(); + break; + case 36: + message.objc_class_prefix = reader.string(); + break; + case 37: + message.csharp_namespace = reader.string(); + break; + case 39: + message.swift_prefix = reader.string(); + break; + case 40: + message.php_class_prefix = reader.string(); + break; + case 41: + message.php_namespace = reader.string(); + break; + case 44: + message.php_metadata_namespace = reader.string(); + break; + case 45: + message.ruby_package = reader.string(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + if (object.java_package !== undefined && object.java_package !== null) { + message.java_package = String(object.java_package); + } else { + message.java_package = ""; + } + if ( + object.java_outer_classname !== undefined && + object.java_outer_classname !== null + ) { + message.java_outer_classname = String(object.java_outer_classname); + } else { + message.java_outer_classname = ""; + } + if ( + object.java_multiple_files !== undefined && + object.java_multiple_files !== null + ) { + message.java_multiple_files = Boolean(object.java_multiple_files); + } else { + message.java_multiple_files = false; + } + if ( + object.java_generate_equals_and_hash !== undefined && + object.java_generate_equals_and_hash !== null + ) { + message.java_generate_equals_and_hash = Boolean( + object.java_generate_equals_and_hash + ); + } else { + message.java_generate_equals_and_hash = false; + } + if ( + object.java_string_check_utf8 !== undefined && + object.java_string_check_utf8 !== null + ) { + message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); + } else { + message.java_string_check_utf8 = false; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimize_for = fileOptions_OptimizeModeFromJSON( + object.optimize_for + ); + } else { + message.optimize_for = 1; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.go_package = String(object.go_package); + } else { + message.go_package = ""; + } + if ( + object.cc_generic_services !== undefined && + object.cc_generic_services !== null + ) { + message.cc_generic_services = Boolean(object.cc_generic_services); + } else { + message.cc_generic_services = false; + } + if ( + object.java_generic_services !== undefined && + object.java_generic_services !== null + ) { + message.java_generic_services = Boolean(object.java_generic_services); + } else { + message.java_generic_services = false; + } + if ( + object.py_generic_services !== undefined && + object.py_generic_services !== null + ) { + message.py_generic_services = Boolean(object.py_generic_services); + } else { + message.py_generic_services = false; + } + if ( + object.php_generic_services !== undefined && + object.php_generic_services !== null + ) { + message.php_generic_services = Boolean(object.php_generic_services); + } else { + message.php_generic_services = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.cc_enable_arenas !== undefined && + object.cc_enable_arenas !== null + ) { + message.cc_enable_arenas = Boolean(object.cc_enable_arenas); + } else { + message.cc_enable_arenas = false; + } + if ( + object.objc_class_prefix !== undefined && + object.objc_class_prefix !== null + ) { + message.objc_class_prefix = String(object.objc_class_prefix); + } else { + message.objc_class_prefix = ""; + } + if ( + object.csharp_namespace !== undefined && + object.csharp_namespace !== null + ) { + message.csharp_namespace = String(object.csharp_namespace); + } else { + message.csharp_namespace = ""; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swift_prefix = String(object.swift_prefix); + } else { + message.swift_prefix = ""; + } + if ( + object.php_class_prefix !== undefined && + object.php_class_prefix !== null + ) { + message.php_class_prefix = String(object.php_class_prefix); + } else { + message.php_class_prefix = ""; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.php_namespace = String(object.php_namespace); + } else { + message.php_namespace = ""; + } + if ( + object.php_metadata_namespace !== undefined && + object.php_metadata_namespace !== null + ) { + message.php_metadata_namespace = String(object.php_metadata_namespace); + } else { + message.php_metadata_namespace = ""; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.ruby_package = String(object.ruby_package); + } else { + message.ruby_package = ""; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FileOptions): unknown { + const obj: any = {}; + message.java_package !== undefined && + (obj.java_package = message.java_package); + message.java_outer_classname !== undefined && + (obj.java_outer_classname = message.java_outer_classname); + message.java_multiple_files !== undefined && + (obj.java_multiple_files = message.java_multiple_files); + message.java_generate_equals_and_hash !== undefined && + (obj.java_generate_equals_and_hash = + message.java_generate_equals_and_hash); + message.java_string_check_utf8 !== undefined && + (obj.java_string_check_utf8 = message.java_string_check_utf8); + message.optimize_for !== undefined && + (obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimize_for)); + message.go_package !== undefined && (obj.go_package = message.go_package); + message.cc_generic_services !== undefined && + (obj.cc_generic_services = message.cc_generic_services); + message.java_generic_services !== undefined && + (obj.java_generic_services = message.java_generic_services); + message.py_generic_services !== undefined && + (obj.py_generic_services = message.py_generic_services); + message.php_generic_services !== undefined && + (obj.php_generic_services = message.php_generic_services); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.cc_enable_arenas !== undefined && + (obj.cc_enable_arenas = message.cc_enable_arenas); + message.objc_class_prefix !== undefined && + (obj.objc_class_prefix = message.objc_class_prefix); + message.csharp_namespace !== undefined && + (obj.csharp_namespace = message.csharp_namespace); + message.swift_prefix !== undefined && + (obj.swift_prefix = message.swift_prefix); + message.php_class_prefix !== undefined && + (obj.php_class_prefix = message.php_class_prefix); + message.php_namespace !== undefined && + (obj.php_namespace = message.php_namespace); + message.php_metadata_namespace !== undefined && + (obj.php_metadata_namespace = message.php_metadata_namespace); + message.ruby_package !== undefined && + (obj.ruby_package = message.ruby_package); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpreted_option = []; + if (object.java_package !== undefined && object.java_package !== null) { + message.java_package = object.java_package; + } else { + message.java_package = ""; + } + if ( + object.java_outer_classname !== undefined && + object.java_outer_classname !== null + ) { + message.java_outer_classname = object.java_outer_classname; + } else { + message.java_outer_classname = ""; + } + if ( + object.java_multiple_files !== undefined && + object.java_multiple_files !== null + ) { + message.java_multiple_files = object.java_multiple_files; + } else { + message.java_multiple_files = false; + } + if ( + object.java_generate_equals_and_hash !== undefined && + object.java_generate_equals_and_hash !== null + ) { + message.java_generate_equals_and_hash = + object.java_generate_equals_and_hash; + } else { + message.java_generate_equals_and_hash = false; + } + if ( + object.java_string_check_utf8 !== undefined && + object.java_string_check_utf8 !== null + ) { + message.java_string_check_utf8 = object.java_string_check_utf8; + } else { + message.java_string_check_utf8 = false; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimize_for = object.optimize_for; + } else { + message.optimize_for = 1; + } + if (object.go_package !== undefined && object.go_package !== null) { + message.go_package = object.go_package; + } else { + message.go_package = ""; + } + if ( + object.cc_generic_services !== undefined && + object.cc_generic_services !== null + ) { + message.cc_generic_services = object.cc_generic_services; + } else { + message.cc_generic_services = false; + } + if ( + object.java_generic_services !== undefined && + object.java_generic_services !== null + ) { + message.java_generic_services = object.java_generic_services; + } else { + message.java_generic_services = false; + } + if ( + object.py_generic_services !== undefined && + object.py_generic_services !== null + ) { + message.py_generic_services = object.py_generic_services; + } else { + message.py_generic_services = false; + } + if ( + object.php_generic_services !== undefined && + object.php_generic_services !== null + ) { + message.php_generic_services = object.php_generic_services; + } else { + message.php_generic_services = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.cc_enable_arenas !== undefined && + object.cc_enable_arenas !== null + ) { + message.cc_enable_arenas = object.cc_enable_arenas; + } else { + message.cc_enable_arenas = false; + } + if ( + object.objc_class_prefix !== undefined && + object.objc_class_prefix !== null + ) { + message.objc_class_prefix = object.objc_class_prefix; + } else { + message.objc_class_prefix = ""; + } + if ( + object.csharp_namespace !== undefined && + object.csharp_namespace !== null + ) { + message.csharp_namespace = object.csharp_namespace; + } else { + message.csharp_namespace = ""; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swift_prefix = object.swift_prefix; + } else { + message.swift_prefix = ""; + } + if ( + object.php_class_prefix !== undefined && + object.php_class_prefix !== null + ) { + message.php_class_prefix = object.php_class_prefix; + } else { + message.php_class_prefix = ""; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.php_namespace = object.php_namespace; + } else { + message.php_namespace = ""; + } + if ( + object.php_metadata_namespace !== undefined && + object.php_metadata_namespace !== null + ) { + message.php_metadata_namespace = object.php_metadata_namespace; + } else { + message.php_metadata_namespace = ""; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.ruby_package = object.ruby_package; + } else { + message.ruby_package = ""; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMessageOptions: object = { + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + deprecated: false, + map_entry: false, +}; + +export const MessageOptions = { + encode(message: MessageOptions, writer: Writer = Writer.create()): Writer { + if (message.message_set_wire_format === true) { + writer.uint32(8).bool(message.message_set_wire_format); + } + if (message.no_standard_descriptor_accessor === true) { + writer.uint32(16).bool(message.no_standard_descriptor_accessor); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.map_entry === true) { + writer.uint32(56).bool(message.map_entry); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message_set_wire_format = reader.bool(); + break; + case 2: + message.no_standard_descriptor_accessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.map_entry = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + if ( + object.message_set_wire_format !== undefined && + object.message_set_wire_format !== null + ) { + message.message_set_wire_format = Boolean(object.message_set_wire_format); + } else { + message.message_set_wire_format = false; + } + if ( + object.no_standard_descriptor_accessor !== undefined && + object.no_standard_descriptor_accessor !== null + ) { + message.no_standard_descriptor_accessor = Boolean( + object.no_standard_descriptor_accessor + ); + } else { + message.no_standard_descriptor_accessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.map_entry = Boolean(object.map_entry); + } else { + message.map_entry = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MessageOptions): unknown { + const obj: any = {}; + message.message_set_wire_format !== undefined && + (obj.message_set_wire_format = message.message_set_wire_format); + message.no_standard_descriptor_accessor !== undefined && + (obj.no_standard_descriptor_accessor = + message.no_standard_descriptor_accessor); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.map_entry !== undefined && (obj.map_entry = message.map_entry); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpreted_option = []; + if ( + object.message_set_wire_format !== undefined && + object.message_set_wire_format !== null + ) { + message.message_set_wire_format = object.message_set_wire_format; + } else { + message.message_set_wire_format = false; + } + if ( + object.no_standard_descriptor_accessor !== undefined && + object.no_standard_descriptor_accessor !== null + ) { + message.no_standard_descriptor_accessor = + object.no_standard_descriptor_accessor; + } else { + message.no_standard_descriptor_accessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.map_entry = object.map_entry; + } else { + message.map_entry = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFieldOptions: object = { + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + deprecated: false, + weak: false, +}; + +export const FieldOptions = { + encode(message: FieldOptions, writer: Writer = Writer.create()): Writer { + if (message.ctype !== 0) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed === true) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== 0) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy === true) { + writer.uint32(40).bool(message.lazy); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak === true) { + writer.uint32(80).bool(message.weak); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32() as any; + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32() as any; + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = fieldOptions_CTypeFromJSON(object.ctype); + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = Boolean(object.packed); + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = Boolean(object.lazy); + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = Boolean(object.weak); + } else { + message.weak = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FieldOptions): unknown { + const obj: any = {}; + message.ctype !== undefined && + (obj.ctype = fieldOptions_CTypeToJSON(message.ctype)); + message.packed !== undefined && (obj.packed = message.packed); + message.jstype !== undefined && + (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); + message.lazy !== undefined && (obj.lazy = message.lazy); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.weak !== undefined && (obj.weak = message.weak); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpreted_option = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = object.ctype; + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = object.jstype; + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } else { + message.weak = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseOneofOptions: object = {}; + +export const OneofOptions = { + encode(message: OneofOptions, writer: Writer = Writer.create()): Writer { + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: OneofOptions): unknown { + const obj: any = {}; + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpreted_option = []; + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseEnumOptions: object = { allow_alias: false, deprecated: false }; + +export const EnumOptions = { + encode(message: EnumOptions, writer: Writer = Writer.create()): Writer { + if (message.allow_alias === true) { + writer.uint32(16).bool(message.allow_alias); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allow_alias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allow_alias = Boolean(object.allow_alias); + } else { + message.allow_alias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: EnumOptions): unknown { + const obj: any = {}; + message.allow_alias !== undefined && + (obj.allow_alias = message.allow_alias); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpreted_option = []; + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allow_alias = object.allow_alias; + } else { + message.allow_alias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseEnumValueOptions: object = { deprecated: false }; + +export const EnumValueOptions = { + encode(message: EnumValueOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(8).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: EnumValueOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseServiceOptions: object = { deprecated: false }; + +export const ServiceOptions = { + encode(message: ServiceOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ServiceOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMethodOptions: object = { deprecated: false, idempotency_level: 0 }; + +export const MethodOptions = { + encode(message: MethodOptions, writer: Writer = Writer.create()): Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + if (message.idempotency_level !== 0) { + writer.uint32(272).int32(message.idempotency_level); + } + for (const v of message.uninterpreted_option) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotency_level = reader.int32() as any; + break; + case 999: + message.uninterpreted_option.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if ( + object.idempotency_level !== undefined && + object.idempotency_level !== null + ) { + message.idempotency_level = methodOptions_IdempotencyLevelFromJSON( + object.idempotency_level + ); + } else { + message.idempotency_level = 0; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MethodOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.idempotency_level !== undefined && + (obj.idempotency_level = methodOptions_IdempotencyLevelToJSON( + message.idempotency_level + )); + if (message.uninterpreted_option) { + obj.uninterpreted_option = message.uninterpreted_option.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpreted_option = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpreted_option = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if ( + object.idempotency_level !== undefined && + object.idempotency_level !== null + ) { + message.idempotency_level = object.idempotency_level; + } else { + message.idempotency_level = 0; + } + if ( + object.uninterpreted_option !== undefined && + object.uninterpreted_option !== null + ) { + for (const e of object.uninterpreted_option) { + message.uninterpreted_option.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseUninterpretedOption: object = { + identifier_value: "", + positive_int_value: 0, + negative_int_value: 0, + double_value: 0, + aggregate_value: "", +}; + +export const UninterpretedOption = { + encode( + message: UninterpretedOption, + writer: Writer = Writer.create() + ): Writer { + for (const v of message.name) { + UninterpretedOption_NamePart.encode( + v!, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.identifier_value !== "") { + writer.uint32(26).string(message.identifier_value); + } + if (message.positive_int_value !== 0) { + writer.uint32(32).uint64(message.positive_int_value); + } + if (message.negative_int_value !== 0) { + writer.uint32(40).int64(message.negative_int_value); + } + if (message.double_value !== 0) { + writer.uint32(49).double(message.double_value); + } + if (message.string_value.length !== 0) { + writer.uint32(58).bytes(message.string_value); + } + if (message.aggregate_value !== "") { + writer.uint32(66).string(message.aggregate_value); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.name.push( + UninterpretedOption_NamePart.decode(reader, reader.uint32()) + ); + break; + case 3: + message.identifier_value = reader.string(); + break; + case 4: + message.positive_int_value = longToNumber(reader.uint64() as Long); + break; + case 5: + message.negative_int_value = longToNumber(reader.int64() as Long); + break; + case 6: + message.double_value = reader.double(); + break; + case 7: + message.string_value = reader.bytes(); + break; + case 8: + message.aggregate_value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromJSON(e)); + } + } + if ( + object.identifier_value !== undefined && + object.identifier_value !== null + ) { + message.identifier_value = String(object.identifier_value); + } else { + message.identifier_value = ""; + } + if ( + object.positive_int_value !== undefined && + object.positive_int_value !== null + ) { + message.positive_int_value = Number(object.positive_int_value); + } else { + message.positive_int_value = 0; + } + if ( + object.negative_int_value !== undefined && + object.negative_int_value !== null + ) { + message.negative_int_value = Number(object.negative_int_value); + } else { + message.negative_int_value = 0; + } + if (object.double_value !== undefined && object.double_value !== null) { + message.double_value = Number(object.double_value); + } else { + message.double_value = 0; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.string_value = bytesFromBase64(object.string_value); + } + if ( + object.aggregate_value !== undefined && + object.aggregate_value !== null + ) { + message.aggregate_value = String(object.aggregate_value); + } else { + message.aggregate_value = ""; + } + return message; + }, + + toJSON(message: UninterpretedOption): unknown { + const obj: any = {}; + if (message.name) { + obj.name = message.name.map((e) => + e ? UninterpretedOption_NamePart.toJSON(e) : undefined + ); + } else { + obj.name = []; + } + message.identifier_value !== undefined && + (obj.identifier_value = message.identifier_value); + message.positive_int_value !== undefined && + (obj.positive_int_value = message.positive_int_value); + message.negative_int_value !== undefined && + (obj.negative_int_value = message.negative_int_value); + message.double_value !== undefined && + (obj.double_value = message.double_value); + message.string_value !== undefined && + (obj.string_value = base64FromBytes( + message.string_value !== undefined + ? message.string_value + : new Uint8Array() + )); + message.aggregate_value !== undefined && + (obj.aggregate_value = message.aggregate_value); + return obj; + }, + + fromPartial(object: DeepPartial): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromPartial(e)); + } + } + if ( + object.identifier_value !== undefined && + object.identifier_value !== null + ) { + message.identifier_value = object.identifier_value; + } else { + message.identifier_value = ""; + } + if ( + object.positive_int_value !== undefined && + object.positive_int_value !== null + ) { + message.positive_int_value = object.positive_int_value; + } else { + message.positive_int_value = 0; + } + if ( + object.negative_int_value !== undefined && + object.negative_int_value !== null + ) { + message.negative_int_value = object.negative_int_value; + } else { + message.negative_int_value = 0; + } + if (object.double_value !== undefined && object.double_value !== null) { + message.double_value = object.double_value; + } else { + message.double_value = 0; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.string_value = object.string_value; + } else { + message.string_value = new Uint8Array(); + } + if ( + object.aggregate_value !== undefined && + object.aggregate_value !== null + ) { + message.aggregate_value = object.aggregate_value; + } else { + message.aggregate_value = ""; + } + return message; + }, +}; + +const baseUninterpretedOption_NamePart: object = { + name_part: "", + is_extension: false, +}; + +export const UninterpretedOption_NamePart = { + encode( + message: UninterpretedOption_NamePart, + writer: Writer = Writer.create() + ): Writer { + if (message.name_part !== "") { + writer.uint32(10).string(message.name_part); + } + if (message.is_extension === true) { + writer.uint32(16).bool(message.is_extension); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): UninterpretedOption_NamePart { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name_part = reader.string(); + break; + case 2: + message.is_extension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninterpretedOption_NamePart { + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + if (object.name_part !== undefined && object.name_part !== null) { + message.name_part = String(object.name_part); + } else { + message.name_part = ""; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.is_extension = Boolean(object.is_extension); + } else { + message.is_extension = false; + } + return message; + }, + + toJSON(message: UninterpretedOption_NamePart): unknown { + const obj: any = {}; + message.name_part !== undefined && (obj.name_part = message.name_part); + message.is_extension !== undefined && + (obj.is_extension = message.is_extension); + return obj; + }, + + fromPartial( + object: DeepPartial + ): UninterpretedOption_NamePart { + const message = { + ...baseUninterpretedOption_NamePart, + } as UninterpretedOption_NamePart; + if (object.name_part !== undefined && object.name_part !== null) { + message.name_part = object.name_part; + } else { + message.name_part = ""; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.is_extension = object.is_extension; + } else { + message.is_extension = false; + } + return message; + }, +}; + +const baseSourceCodeInfo: object = {}; + +export const SourceCodeInfo = { + encode(message: SourceCodeInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location.push( + SourceCodeInfo_Location.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: SourceCodeInfo): unknown { + const obj: any = {}; + if (message.location) { + obj.location = message.location.map((e) => + e ? SourceCodeInfo_Location.toJSON(e) : undefined + ); + } else { + obj.location = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromPartial(e)); + } + } + return message; + }, +}; + +const baseSourceCodeInfo_Location: object = { + path: 0, + span: 0, + leading_comments: "", + trailing_comments: "", + leading_detached_comments: "", +}; + +export const SourceCodeInfo_Location = { + encode( + message: SourceCodeInfo_Location, + writer: Writer = Writer.create() + ): Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + if (message.leading_comments !== "") { + writer.uint32(26).string(message.leading_comments); + } + if (message.trailing_comments !== "") { + writer.uint32(34).string(message.trailing_comments); + } + for (const v of message.leading_detached_comments) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + } else { + message.span.push(reader.int32()); + } + break; + case 3: + message.leading_comments = reader.string(); + break; + case 4: + message.trailing_comments = reader.string(); + break; + case 6: + message.leading_detached_comments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo_Location { + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(Number(e)); + } + } + if ( + object.leading_comments !== undefined && + object.leading_comments !== null + ) { + message.leading_comments = String(object.leading_comments); + } else { + message.leading_comments = ""; + } + if ( + object.trailing_comments !== undefined && + object.trailing_comments !== null + ) { + message.trailing_comments = String(object.trailing_comments); + } else { + message.trailing_comments = ""; + } + if ( + object.leading_detached_comments !== undefined && + object.leading_detached_comments !== null + ) { + for (const e of object.leading_detached_comments) { + message.leading_detached_comments.push(String(e)); + } + } + return message; + }, + + toJSON(message: SourceCodeInfo_Location): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + if (message.span) { + obj.span = message.span.map((e) => e); + } else { + obj.span = []; + } + message.leading_comments !== undefined && + (obj.leading_comments = message.leading_comments); + message.trailing_comments !== undefined && + (obj.trailing_comments = message.trailing_comments); + if (message.leading_detached_comments) { + obj.leading_detached_comments = message.leading_detached_comments.map( + (e) => e + ); + } else { + obj.leading_detached_comments = []; + } + return obj; + }, + + fromPartial( + object: DeepPartial + ): SourceCodeInfo_Location { + const message = { + ...baseSourceCodeInfo_Location, + } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leading_detached_comments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(e); + } + } + if ( + object.leading_comments !== undefined && + object.leading_comments !== null + ) { + message.leading_comments = object.leading_comments; + } else { + message.leading_comments = ""; + } + if ( + object.trailing_comments !== undefined && + object.trailing_comments !== null + ) { + message.trailing_comments = object.trailing_comments; + } else { + message.trailing_comments = ""; + } + if ( + object.leading_detached_comments !== undefined && + object.leading_detached_comments !== null + ) { + for (const e of object.leading_detached_comments) { + message.leading_detached_comments.push(e); + } + } + return message; + }, +}; + +const baseGeneratedCodeInfo: object = {}; + +export const GeneratedCodeInfo = { + encode(message: GeneratedCodeInfo, writer: Writer = Writer.create()): Writer { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode( + v!, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annotation.push( + GeneratedCodeInfo_Annotation.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: GeneratedCodeInfo): unknown { + const obj: any = {}; + if (message.annotation) { + obj.annotation = message.annotation.map((e) => + e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined + ); + } else { + obj.annotation = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); + } + } + return message; + }, +}; + +const baseGeneratedCodeInfo_Annotation: object = { + path: 0, + source_file: "", + begin: 0, + end: 0, +}; + +export const GeneratedCodeInfo_Annotation = { + encode( + message: GeneratedCodeInfo_Annotation, + writer: Writer = Writer.create() + ): Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + if (message.source_file !== "") { + writer.uint32(18).string(message.source_file); + } + if (message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== 0) { + writer.uint32(32).int32(message.end); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): GeneratedCodeInfo_Annotation { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + message.source_file = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo_Annotation { + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.source_file !== undefined && object.source_file !== null) { + message.source_file = String(object.source_file); + } else { + message.source_file = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = Number(object.begin); + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: GeneratedCodeInfo_Annotation): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + message.source_file !== undefined && + (obj.source_file = message.source_file); + message.begin !== undefined && (obj.begin = message.begin); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial + ): GeneratedCodeInfo_Annotation { + const message = { + ...baseGeneratedCodeInfo_Annotation, + } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.source_file !== undefined && object.source_file !== null) { + message.source_file = object.source_file; + } else { + message.source_file = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/package.json b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/package.json new file mode 100755 index 00000000..5a0186e1 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/package.json @@ -0,0 +1,18 @@ +{ + "name": "bze-cointrunk-v1-js", + "version": "0.1.0", + "description": "Autogenerated vuex store for Cosmos module bze.cointrunk.v1", + "author": "Starport Codegen ", + "homepage": "http://github.com/bze-alphateam/bze/x/cointrunk/types", + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "main": "index.js", + "publishConfig": { + "access": "public" + } +} \ No newline at end of file diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/vuex-root b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/vuex-root new file mode 100755 index 00000000..0fcc121a --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/vuex-root @@ -0,0 +1 @@ +THIS FILE IS GENERATED AUTOMATICALLY. DO NOT DELETE. diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 155d50b2..474b327f 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -247,33 +247,33 @@ export default { } } }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgSubmitScavenge(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgCommitSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -291,29 +291,29 @@ export default { } } }, - async MsgCommitSolution({ rootGetters }, { value }) { + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) + const msg = await txClient.msgSubmitScavenge(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgCommitSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 9a3de64c..5f72a96b 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -5,14 +5,14 @@ import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; import { MsgRevealSolution } from "./types/scavenge/tx"; -import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; +import { MsgCommitSolution } from "./types/scavenge/tx"; const types = [ ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], - ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], + ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -46,8 +46,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), - msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), + msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), }; }; diff --git a/vue/src/store/generated/index.ts b/vue/src/store/generated/index.ts index 2dba3faf..5c6c40b7 100755 --- a/vue/src/store/generated/index.ts +++ b/vue/src/store/generated/index.ts @@ -1,6 +1,7 @@ // THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. import BzeAlphateamBzeBzeBurnerV1 from './bze-alphateam/bze/bze.burner.v1' +import BzeAlphateamBzeBzeCointrunkV1 from './bze-alphateam/bze/bze.cointrunk.v1' import BzeAlphateamBzeBzeCointrunk from './bze-alphateam/bze/bze.cointrunk' import BzeAlphateamBzeBzeScavenge from './bze-alphateam/bze/bze.scavenge' import BzeAlphateamBzeBzealphateamBzeBurner from './bze-alphateam/bze/bzealphateam.bze.burner' @@ -20,6 +21,7 @@ import CosmosIbcGoIbcApplicationsTransferV1 from './cosmos/ibc-go/ibc.applicatio export default { BzeAlphateamBzeBzeBurnerV1: load(BzeAlphateamBzeBzeBurnerV1, 'bze.burner.v1'), + BzeAlphateamBzeBzeCointrunkV1: load(BzeAlphateamBzeBzeCointrunkV1, 'bze.cointrunk.v1'), BzeAlphateamBzeBzeCointrunk: load(BzeAlphateamBzeBzeCointrunk, 'bze.cointrunk'), BzeAlphateamBzeBzeScavenge: load(BzeAlphateamBzeBzeScavenge, 'bze.scavenge'), BzeAlphateamBzeBzealphateamBzeBurner: load(BzeAlphateamBzeBzealphateamBzeBurner, 'bzealphateam.bze.burner'), diff --git a/x/burner/types/genesis.pb.go b/x/burner/types/genesis.pb.go index 6a2aed8a..4db816d5 100644 --- a/x/burner/types/genesis.pb.go +++ b/x/burner/types/genesis.pb.go @@ -26,7 +26,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the burner module's genesis state. type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - BurnedCoinsList []BurnedCoins `protobuf:"bytes,2,rep,name=BurnedCoinsList,proto3" json:"BurnedCoinsList"` + BurnedCoinsList []BurnedCoins `protobuf:"bytes,2,rep,name=BurnedCoinsList,proto3" json:"burned_coins_list,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -83,22 +83,24 @@ func init() { func init() { proto.RegisterFile("burner/genesis.proto", fileDescriptor_62cceffcaad9705b) } var fileDescriptor_62cceffcaad9705b = []byte{ - // 238 bytes of a gzipped FileDescriptorProto + // 263 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x49, 0x2a, 0x2d, 0xca, 0x4b, 0x2d, 0xd2, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0xc8, 0xe8, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x65, 0xf4, 0x41, 0x2c, 0x88, 0x22, 0x29, 0x61, 0xa8, 0xd6, 0x82, 0xc4, 0xa2, 0xc4, 0x5c, 0xa8, 0x4e, 0x29, 0x49, 0xa8, 0x20, 0x98, 0x4a, 0x89, 0x4f, 0xce, 0xcf, 0xcc, 0x83, 0x4a, - 0x29, 0xf5, 0x33, 0x72, 0xf1, 0xb8, 0x43, 0xac, 0x09, 0x2e, 0x49, 0x2c, 0x49, 0x15, 0x32, 0xe6, - 0x62, 0x83, 0xe8, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x12, 0xd5, 0x43, 0xb1, 0x56, 0x2f, - 0x00, 0x2c, 0xe9, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x54, 0xa9, 0x90, 0x17, 0x17, 0xbf, - 0x13, 0xd8, 0x6c, 0x67, 0x90, 0xd1, 0x3e, 0x99, 0xc5, 0x25, 0x12, 0x4c, 0x0a, 0xcc, 0x1a, 0xdc, - 0x46, 0x52, 0x68, 0xba, 0x91, 0x54, 0x41, 0x8d, 0x40, 0xd7, 0xe8, 0xe4, 0x7a, 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, 0xda, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, - 0xf9, 0xb9, 0xfa, 0x49, 0x55, 0xa9, 0xba, 0x89, 0x39, 0x05, 0x19, 0x89, 0x25, 0xa9, 0x89, 0x60, - 0x9e, 0x7e, 0x85, 0x3e, 0xd4, 0x97, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xff, 0x19, - 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x51, 0x09, 0xba, 0xec, 0x4c, 0x01, 0x00, 0x00, + 0x29, 0xad, 0x63, 0xe4, 0xe2, 0x71, 0x87, 0x58, 0x13, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xcc, + 0xc5, 0x06, 0xd1, 0x2b, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xaa, 0x87, 0x62, 0xad, 0x5e, + 0x00, 0x58, 0xd2, 0x89, 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0xa8, 0x52, 0xa1, 0x4c, 0x2e, 0x7e, + 0x27, 0xb0, 0xd9, 0xce, 0x20, 0xa3, 0x7d, 0x32, 0x8b, 0x4b, 0x24, 0x98, 0x14, 0x98, 0x35, 0xb8, + 0x8d, 0xa4, 0xd0, 0x74, 0x23, 0xa9, 0x72, 0x52, 0x06, 0x19, 0xf1, 0xea, 0x9e, 0xbc, 0x34, 0xb2, + 0xb3, 0xe2, 0x73, 0x32, 0x8b, 0x4b, 0x74, 0xf2, 0x73, 0x33, 0x4b, 0x52, 0x73, 0x0b, 0x4a, 0x2a, + 0x83, 0xd0, 0xcd, 0x75, 0x72, 0x3d, 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, + 0xed, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xa4, 0xaa, 0x54, 0xdd, + 0xc4, 0x9c, 0x82, 0x8c, 0xc4, 0x92, 0xd4, 0x44, 0x30, 0x4f, 0xbf, 0x42, 0x1f, 0x1a, 0x08, 0x25, + 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xef, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x66, + 0x2f, 0xbd, 0xe7, 0x6b, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/cointrunk/keeper/params.go b/x/cointrunk/keeper/params.go index 8d08a19a..bdcaf126 100644 --- a/x/cointrunk/keeper/params.go +++ b/x/cointrunk/keeper/params.go @@ -10,6 +10,7 @@ func (k Keeper) GetParams(ctx sdk.Context) types.Params { return types.NewParams( k.AnonArticleLimit(ctx), k.AnonArticleCost(ctx), + k.PublisherRespectParams(ctx), ) } @@ -29,3 +30,9 @@ func (k Keeper) AnonArticleCost(ctx sdk.Context) (res sdk.Coin) { k.paramstore.Get(ctx, types.KeyAnonArticleCost, &res) return } + +// PublisherRespectParams returns the PublisherRespectParams param +func (k Keeper) PublisherRespectParams(ctx sdk.Context) (res types.PublisherRespectParams) { + k.paramstore.Get(ctx, types.KeyPublisherRespectParams, &res) + return +} diff --git a/x/cointrunk/types/accepted_domain.pb.go b/x/cointrunk/types/accepted_domain.pb.go index ad8fb494..e0da4a37 100644 --- a/x/cointrunk/types/accepted_domain.pb.go +++ b/x/cointrunk/types/accepted_domain.pb.go @@ -75,24 +75,25 @@ func (m *AcceptedDomain) GetActive() bool { } func init() { - proto.RegisterType((*AcceptedDomain)(nil), "bze.cointrunk.AcceptedDomain") + proto.RegisterType((*AcceptedDomain)(nil), "bze.cointrunk.v1.AcceptedDomain") } func init() { proto.RegisterFile("cointrunk/accepted_domain.proto", fileDescriptor_7857a0181b52415e) } var fileDescriptor_7857a0181b52415e = []byte{ - // 176 bytes of a gzipped FileDescriptorProto + // 179 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xce, 0xcf, 0xcc, 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x4c, 0x4e, 0x4e, 0x2d, 0x28, 0x49, 0x4d, 0x89, 0x4f, - 0xc9, 0xcf, 0x4d, 0xcc, 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, - 0xd5, 0x83, 0x2b, 0x52, 0x72, 0xe0, 0xe2, 0x73, 0x84, 0xaa, 0x73, 0x01, 0x2b, 0x13, 0x12, 0xe3, - 0x62, 0x83, 0x68, 0x90, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0xf2, 0x40, 0xe2, 0x89, 0xc9, - 0x25, 0x99, 0x65, 0xa9, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x1c, 0x41, 0x50, 0x9e, 0x93, 0xc7, 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, 0xe9, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, - 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x27, 0x55, 0xa5, 0xea, 0x26, 0xe6, 0x14, 0x64, 0x24, 0x96, 0xa4, - 0x26, 0x82, 0x79, 0xfa, 0x15, 0xfa, 0x08, 0xa7, 0x96, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, - 0x5d, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xda, 0x95, 0x65, 0xbb, 0xc4, 0x00, 0x00, 0x00, + 0xc9, 0xcf, 0x4d, 0xcc, 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x48, 0xaa, 0x4a, + 0xd5, 0x83, 0x2b, 0xd2, 0x2b, 0x33, 0x54, 0x72, 0xe0, 0xe2, 0x73, 0x84, 0x2a, 0x75, 0x01, 0xab, + 0x14, 0x12, 0xe3, 0x62, 0x83, 0xe8, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0xf2, 0x40, + 0xe2, 0x89, 0xc9, 0x25, 0x99, 0x65, 0xa9, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x1c, 0x41, 0x50, 0x9e, + 0x93, 0xc7, 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, 0xe9, 0xa5, 0x67, 0x96, + 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x27, 0x55, 0xa5, 0xea, 0x26, 0xe6, 0x14, 0x64, + 0x24, 0x96, 0xa4, 0x26, 0x82, 0x79, 0xfa, 0x15, 0xfa, 0x08, 0xd7, 0x96, 0x54, 0x16, 0xa4, 0x16, + 0x27, 0xb1, 0x81, 0x1d, 0x69, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x2a, 0x45, 0x56, 0x6d, 0xc7, + 0x00, 0x00, 0x00, } func (m *AcceptedDomain) Marshal() (dAtA []byte, err error) { diff --git a/x/cointrunk/types/accepted_domain_proposal.pb.go b/x/cointrunk/types/accepted_domain_proposal.pb.go index a1c7ded8..9e9a7c15 100644 --- a/x/cointrunk/types/accepted_domain_proposal.pb.go +++ b/x/cointrunk/types/accepted_domain_proposal.pb.go @@ -91,7 +91,7 @@ func (m *AcceptedDomainProposal) GetActive() bool { } func init() { - proto.RegisterType((*AcceptedDomainProposal)(nil), "bze.cointrunk.AcceptedDomainProposal") + proto.RegisterType((*AcceptedDomainProposal)(nil), "bze.cointrunk.v1.AcceptedDomainProposal") } func init() { @@ -99,22 +99,22 @@ func init() { } var fileDescriptor_5b0b7ddc6f58933e = []byte{ - // 225 bytes of a gzipped FileDescriptorProto + // 228 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x48, 0xce, 0xcf, 0xcc, 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x4c, 0x4e, 0x4e, 0x2d, 0x28, 0x49, 0x4d, 0x89, 0x4f, 0xc9, 0xcf, 0x4d, 0xcc, 0xcc, 0x8b, 0x2f, 0x28, 0xca, 0x2f, 0xc8, 0x2f, 0x4e, 0xcc, 0xd1, 0x2b, - 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0xab, 0x56, 0x6a, 0x60, 0xe4, - 0x12, 0x73, 0x84, 0xea, 0x70, 0x01, 0x6b, 0x08, 0x80, 0xaa, 0x17, 0x12, 0xe1, 0x62, 0x2d, 0xc9, - 0x2c, 0xc9, 0x49, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0x70, 0x84, 0x14, 0xb8, 0xb8, - 0x53, 0x52, 0x8b, 0x93, 0x8b, 0x32, 0x0b, 0x4a, 0x32, 0xf3, 0xf3, 0x24, 0x98, 0xc0, 0x72, 0xc8, - 0x42, 0x42, 0x62, 0x5c, 0x6c, 0x10, 0xab, 0x25, 0x98, 0xc1, 0x92, 0x50, 0x1e, 0x48, 0x3c, 0x31, - 0xb9, 0x24, 0xb3, 0x2c, 0x55, 0x82, 0x45, 0x81, 0x51, 0x83, 0x23, 0x08, 0xca, 0x73, 0xf2, 0x38, - 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, 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, - 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xa4, 0xaa, 0x54, 0xdd, 0xc4, 0x9c, 0x82, 0x8c, 0xc4, 0x92, - 0xd4, 0x44, 0x30, 0x4f, 0xbf, 0x42, 0x1f, 0xe1, 0xe9, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, - 0xb0, 0x17, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe7, 0x83, 0x5c, 0x70, 0x0e, 0x01, 0x00, - 0x00, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x48, 0xaa, 0x4a, 0xd5, 0x83, 0xab, 0xd6, 0x2b, 0x33, 0x54, + 0x6a, 0x60, 0xe4, 0x12, 0x73, 0x84, 0x6a, 0x72, 0x01, 0xeb, 0x09, 0x80, 0x6a, 0x11, 0x12, 0xe1, + 0x62, 0x2d, 0xc9, 0x2c, 0xc9, 0x49, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0x70, 0x84, + 0x14, 0xb8, 0xb8, 0x53, 0x52, 0x8b, 0x93, 0x8b, 0x32, 0x0b, 0x4a, 0x32, 0xf3, 0xf3, 0x24, 0x98, + 0xc0, 0x72, 0xc8, 0x42, 0x42, 0x62, 0x5c, 0x6c, 0x10, 0xdb, 0x25, 0x98, 0xc1, 0x92, 0x50, 0x1e, + 0x48, 0x3c, 0x31, 0xb9, 0x24, 0xb3, 0x2c, 0x55, 0x82, 0x45, 0x81, 0x51, 0x83, 0x23, 0x08, 0xca, + 0x73, 0xf2, 0x38, 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, 0xbd, 0xf4, 0xcc, + 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xa4, 0xaa, 0x54, 0xdd, 0xc4, 0x9c, 0x82, + 0x8c, 0xc4, 0x92, 0xd4, 0x44, 0x30, 0x4f, 0xbf, 0x42, 0x1f, 0xe1, 0xef, 0x92, 0xca, 0x82, 0xd4, + 0xe2, 0x24, 0x36, 0xb0, 0x2f, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x7d, 0x99, 0x3d, + 0x11, 0x01, 0x00, 0x00, } func (m *AcceptedDomainProposal) Marshal() (dAtA []byte, err error) { diff --git a/x/cointrunk/types/anon_articles_counter.pb.go b/x/cointrunk/types/anon_articles_counter.pb.go index 9ffb8495..d8fb7001 100644 --- a/x/cointrunk/types/anon_articles_counter.pb.go +++ b/x/cointrunk/types/anon_articles_counter.pb.go @@ -75,7 +75,7 @@ func (m *AnonArticlesCounter) GetCounter() uint64 { } func init() { - proto.RegisterType((*AnonArticlesCounter)(nil), "bze.cointrunk.AnonArticlesCounter") + proto.RegisterType((*AnonArticlesCounter)(nil), "bze.cointrunk.v1.AnonArticlesCounter") } func init() { @@ -83,19 +83,19 @@ func init() { } var fileDescriptor_ca7739e73afa5661 = []byte{ - // 185 bytes of a gzipped FileDescriptorProto + // 188 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xce, 0xcf, 0xcc, 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0xcc, 0xcb, 0xcf, 0x8b, 0x4f, 0x2c, 0x2a, 0xc9, 0x4c, 0xce, 0x49, 0x2d, 0x8e, 0x4f, 0xce, 0x2f, 0xcd, 0x2b, 0x49, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, - 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x2b, 0x55, 0x72, 0xe4, 0x12, 0x76, 0xcc, 0xcb, - 0xcf, 0x73, 0x84, 0x2a, 0x76, 0x86, 0xa8, 0x15, 0x12, 0xe0, 0x62, 0xce, 0x4e, 0xad, 0x94, 0x60, - 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0x31, 0x85, 0x24, 0xb8, 0xd8, 0xa1, 0x06, 0x49, 0x30, 0x29, - 0x30, 0x6a, 0xb0, 0x04, 0xc1, 0xb8, 0x4e, 0x1e, 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, 0xa5, 0x97, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x54, - 0x95, 0xaa, 0x9b, 0x98, 0x53, 0x90, 0x91, 0x58, 0x92, 0x9a, 0x08, 0xe6, 0xe9, 0x57, 0xe8, 0x23, - 0x5c, 0x5c, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0xa2, 0x31, 0x20, 0x00, 0x00, 0xff, - 0xff, 0x5a, 0x7a, 0x3d, 0xb1, 0xcb, 0x00, 0x00, 0x00, + 0xc9, 0x17, 0x12, 0x48, 0xaa, 0x4a, 0xd5, 0x83, 0x2b, 0xd5, 0x2b, 0x33, 0x54, 0x72, 0xe4, 0x12, + 0x76, 0xcc, 0xcb, 0xcf, 0x73, 0x84, 0xaa, 0x77, 0x86, 0x28, 0x17, 0x12, 0xe0, 0x62, 0xce, 0x4e, + 0xad, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0x31, 0x85, 0x24, 0xb8, 0xd8, 0xa1, 0x66, + 0x49, 0x30, 0x29, 0x30, 0x6a, 0xb0, 0x04, 0xc1, 0xb8, 0x4e, 0x1e, 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, 0xa5, 0x97, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, + 0xab, 0x9f, 0x54, 0x95, 0xaa, 0x9b, 0x98, 0x53, 0x90, 0x91, 0x58, 0x92, 0x9a, 0x08, 0xe6, 0xe9, + 0x57, 0xe8, 0x23, 0x1c, 0x5d, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0xa5, 0x31, 0x20, + 0x00, 0x00, 0xff, 0xff, 0x41, 0xe9, 0xce, 0x20, 0xce, 0x00, 0x00, 0x00, } func (m *AnonArticlesCounter) Marshal() (dAtA []byte, err error) { diff --git a/x/cointrunk/types/article.pb.go b/x/cointrunk/types/article.pb.go index 81727729..d4032a5d 100644 --- a/x/cointrunk/types/article.pb.go +++ b/x/cointrunk/types/article.pb.go @@ -115,29 +115,29 @@ func (m *Article) GetCreatedAt() int64 { } func init() { - proto.RegisterType((*Article)(nil), "bze.cointrunk.Article") + proto.RegisterType((*Article)(nil), "bze.cointrunk.v1.Article") } func init() { proto.RegisterFile("cointrunk/article.proto", fileDescriptor_b0f4352c8e9bdd9e) } var fileDescriptor_b0f4352c8e9bdd9e = []byte{ - // 246 bytes of a gzipped FileDescriptorProto + // 249 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x90, 0x31, 0x4e, 0xc3, 0x30, - 0x14, 0x86, 0xe3, 0x24, 0x6d, 0xa8, 0x25, 0x10, 0xb2, 0x90, 0xf0, 0x80, 0xac, 0x88, 0x29, 0x0b, - 0xc9, 0xc0, 0x09, 0xca, 0xc4, 0x9c, 0x91, 0xcd, 0x76, 0x9e, 0x88, 0x85, 0x69, 0x2c, 0xf7, 0x59, - 0x82, 0x9e, 0x82, 0x7b, 0x70, 0x11, 0xc6, 0x8e, 0x8c, 0x28, 0xb9, 0x08, 0xaa, 0x23, 0xc8, 0xf6, - 0x7f, 0xdf, 0xff, 0xde, 0xf2, 0xd3, 0x6b, 0x3d, 0x98, 0x1d, 0xfa, 0xb0, 0x7b, 0x69, 0xa4, 0x47, - 0xa3, 0x2d, 0xd4, 0xce, 0x0f, 0x38, 0xb0, 0x73, 0x75, 0x80, 0xfa, 0xbf, 0xbc, 0xfd, 0x24, 0xb4, - 0xd8, 0xce, 0x07, 0xec, 0x82, 0xa6, 0xa6, 0xe3, 0xa4, 0x24, 0x55, 0xde, 0xa6, 0xa6, 0x63, 0x57, - 0x74, 0x85, 0x06, 0x2d, 0xf0, 0xb4, 0x24, 0xd5, 0xa6, 0x9d, 0x81, 0x5d, 0xd2, 0x2c, 0x78, 0xcb, - 0xb3, 0xe8, 0x4e, 0x91, 0x71, 0x5a, 0x38, 0xa3, 0x31, 0x78, 0xe0, 0x79, 0xb4, 0x7f, 0xc8, 0x6e, - 0xe8, 0xc6, 0x05, 0x65, 0xcd, 0xbe, 0x07, 0xcf, 0x57, 0xb1, 0x5b, 0x04, 0x63, 0x34, 0x77, 0xd2, - 0x74, 0x7c, 0x5d, 0x92, 0xea, 0xac, 0x8d, 0xf9, 0xf4, 0xa1, 0x3d, 0x48, 0x84, 0x6e, 0x8b, 0xbc, - 0x28, 0x49, 0x95, 0xb5, 0x8b, 0x78, 0x78, 0xfc, 0x1a, 0x05, 0x39, 0x8e, 0x82, 0xfc, 0x8c, 0x82, - 0x7c, 0x4c, 0x22, 0x39, 0x4e, 0x22, 0xf9, 0x9e, 0x44, 0xf2, 0x54, 0x3f, 0x1b, 0xec, 0x83, 0xaa, - 0xf5, 0xf0, 0xda, 0xa8, 0x03, 0xdc, 0x49, 0xeb, 0x7a, 0x89, 0x20, 0x23, 0x35, 0x6f, 0xcd, 0x32, - 0x07, 0xbe, 0x3b, 0xd8, 0xab, 0x75, 0x5c, 0xe3, 0xfe, 0x37, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x4c, - 0x12, 0xbc, 0x28, 0x01, 0x00, 0x00, + 0x14, 0x86, 0xe3, 0x24, 0x6d, 0xa8, 0x07, 0x54, 0x59, 0x48, 0x78, 0x40, 0x56, 0xc4, 0x94, 0x85, + 0x44, 0x88, 0x13, 0x94, 0x89, 0x39, 0x23, 0x9b, 0xed, 0x3c, 0x11, 0x0b, 0xd3, 0x58, 0xee, 0x33, + 0x82, 0x9e, 0x82, 0x7b, 0x70, 0x11, 0xc6, 0x8e, 0x8c, 0x28, 0xb9, 0x08, 0xaa, 0x2b, 0xc8, 0xf6, + 0x7f, 0xdf, 0xff, 0xde, 0xf2, 0xd3, 0x4b, 0x3d, 0x98, 0x2d, 0xfa, 0xb0, 0x7d, 0x6e, 0xa4, 0x47, + 0xa3, 0x2d, 0xd4, 0xce, 0x0f, 0x38, 0xb0, 0xb5, 0xda, 0x43, 0xfd, 0x5f, 0xd6, 0xaf, 0xb7, 0xd7, + 0x9f, 0x84, 0x16, 0x9b, 0xd3, 0x0d, 0x3b, 0xa7, 0xa9, 0xe9, 0x38, 0x29, 0x49, 0x95, 0xb7, 0xa9, + 0xe9, 0xd8, 0x05, 0x5d, 0xa0, 0x41, 0x0b, 0x3c, 0x2d, 0x49, 0xb5, 0x6a, 0x4f, 0xc0, 0xd6, 0x34, + 0x0b, 0xde, 0xf2, 0x2c, 0xba, 0x63, 0x64, 0x9c, 0x16, 0xce, 0x68, 0x0c, 0x1e, 0x78, 0x1e, 0xed, + 0x1f, 0xb2, 0x2b, 0xba, 0x72, 0x41, 0x59, 0xb3, 0xeb, 0xc1, 0xf3, 0x45, 0xec, 0x66, 0xc1, 0x18, + 0xcd, 0x9d, 0x34, 0x1d, 0x5f, 0x96, 0xa4, 0x3a, 0x6b, 0x63, 0x3e, 0x7e, 0x68, 0x0f, 0x12, 0xa1, + 0xdb, 0x20, 0x2f, 0x4a, 0x52, 0x65, 0xed, 0x2c, 0xee, 0x1f, 0xbe, 0x46, 0x41, 0x0e, 0xa3, 0x20, + 0x3f, 0xa3, 0x20, 0x1f, 0x93, 0x48, 0x0e, 0x93, 0x48, 0xbe, 0x27, 0x91, 0x3c, 0xd6, 0x4f, 0x06, + 0xfb, 0xa0, 0x6a, 0x3d, 0xbc, 0x34, 0x6a, 0x0f, 0x37, 0xd2, 0xba, 0x5e, 0x22, 0xc8, 0x48, 0xcd, + 0x5b, 0x33, 0x2f, 0x82, 0xef, 0x0e, 0x76, 0x6a, 0x19, 0x07, 0xb9, 0xfb, 0x0d, 0x00, 0x00, 0xff, + 0xff, 0x0b, 0x97, 0x9a, 0x43, 0x2b, 0x01, 0x00, 0x00, } func (m *Article) Marshal() (dAtA []byte, err error) { diff --git a/x/cointrunk/types/genesis.pb.go b/x/cointrunk/types/genesis.pb.go index 9e8461ae..beebebab 100644 --- a/x/cointrunk/types/genesis.pb.go +++ b/x/cointrunk/types/genesis.pb.go @@ -26,10 +26,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the cointrunk module's genesis state. type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - PublisherList []Publisher `protobuf:"bytes,2,rep,name=PublisherList,proto3" json:"PublisherList"` - AcceptedDomainList []AcceptedDomain `protobuf:"bytes,3,rep,name=AcceptedDomainList,proto3" json:"AcceptedDomainList"` - ArticleList []Article `protobuf:"bytes,4,rep,name=ArticleList,proto3" json:"ArticleList"` - ArticlesCounter uint64 `protobuf:"varint,6,opt,name=articlesCounter,proto3" json:"articlesCounter,omitempty"` + PublisherList []Publisher `protobuf:"bytes,2,rep,name=PublisherList,proto3" json:"publisher_list,omitempty"` + AcceptedDomainList []AcceptedDomain `protobuf:"bytes,3,rep,name=AcceptedDomainList,proto3" json:"accepted_domain_list,omitempty"` + ArticleList []Article `protobuf:"bytes,4,rep,name=ArticleList,proto3" json:"article_list,omitempty"` + ArticlesCounter uint64 `protobuf:"varint,5,opt,name=articlesCounter,proto3" json:"articles_counter,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -101,34 +101,38 @@ func (m *GenesisState) GetArticlesCounter() uint64 { } func init() { - proto.RegisterType((*GenesisState)(nil), "bze.cointrunk.GenesisState") + proto.RegisterType((*GenesisState)(nil), "bze.cointrunk.v1.GenesisState") } func init() { proto.RegisterFile("cointrunk/genesis.proto", fileDescriptor_20104b77ac07c6a4) } var fileDescriptor_20104b77ac07c6a4 = []byte{ - // 332 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x41, 0x4f, 0xfa, 0x30, - 0x18, 0xc6, 0x37, 0x20, 0x1c, 0xca, 0x9f, 0xfc, 0x93, 0x46, 0x71, 0x92, 0x58, 0x88, 0xa7, 0x5d, - 0xec, 0x12, 0xb8, 0x9b, 0x80, 0x24, 0x7a, 0xf0, 0x40, 0xe0, 0xe6, 0xc5, 0x74, 0xe3, 0xcd, 0x68, - 0x84, 0x75, 0x69, 0xbb, 0x44, 0xf9, 0x14, 0x7e, 0x2c, 0x8e, 0x1c, 0x3d, 0x19, 0x03, 0x5f, 0xc4, - 0xd8, 0x16, 0x81, 0xc5, 0xdb, 0xf6, 0x3e, 0xcf, 0xf3, 0xeb, 0xd3, 0xbe, 0xe8, 0x22, 0x11, 0x3c, - 0xd3, 0xb2, 0xc8, 0x5e, 0xa2, 0x14, 0x32, 0x50, 0x5c, 0xd1, 0x5c, 0x0a, 0x2d, 0x70, 0x33, 0x5e, - 0x01, 0xfd, 0x15, 0xdb, 0x67, 0xa9, 0x48, 0x85, 0x51, 0xa2, 0x9f, 0x2f, 0x6b, 0x6a, 0xb7, 0x0e, - 0xe9, 0x9c, 0x49, 0xb6, 0x74, 0xe1, 0xf6, 0xe5, 0xd1, 0xbc, 0x88, 0x17, 0x5c, 0xcd, 0x41, 0x3a, - 0xa9, 0x73, 0x90, 0x58, 0x92, 0x40, 0xae, 0x61, 0xf6, 0x3c, 0x13, 0x4b, 0xc6, 0x33, 0x67, 0x38, - 0x6a, 0xc4, 0xa4, 0xe6, 0xc9, 0x02, 0xac, 0x70, 0xbd, 0xae, 0xa0, 0x7f, 0xf7, 0xb6, 0xe3, 0x54, - 0x33, 0x0d, 0xb8, 0x8f, 0xea, 0xf6, 0xd4, 0xc0, 0xef, 0xfa, 0x61, 0xa3, 0x77, 0x4e, 0x4f, 0x3a, - 0xd3, 0xb1, 0x11, 0x87, 0xb5, 0xf5, 0x67, 0xc7, 0x9b, 0x38, 0x2b, 0x1e, 0xa1, 0xe6, 0x78, 0x5f, - 0xe9, 0x91, 0x2b, 0x1d, 0x54, 0xba, 0xd5, 0xb0, 0xd1, 0x0b, 0xca, 0xd9, 0xbd, 0xc7, 0xc5, 0x4f, - 0x43, 0x78, 0x8a, 0xf0, 0xc0, 0xb5, 0x1f, 0x99, 0xf2, 0x06, 0x55, 0x35, 0xa8, 0xab, 0x12, 0xea, - 0xd4, 0xe8, 0x78, 0x7f, 0xc4, 0xf1, 0x2d, 0x6a, 0x0c, 0xec, 0x8d, 0x0d, 0xad, 0x66, 0x68, 0xad, - 0x32, 0xcd, 0x3a, 0x1c, 0xe6, 0x38, 0x80, 0x43, 0xf4, 0xdf, 0xbd, 0x98, 0xba, 0x13, 0x45, 0xa6, - 0x41, 0x06, 0xf5, 0xae, 0x1f, 0xd6, 0x26, 0xe5, 0xf1, 0xf0, 0x61, 0xbd, 0x25, 0xfe, 0x66, 0x4b, - 0xfc, 0xaf, 0x2d, 0xf1, 0xdf, 0x77, 0xc4, 0xdb, 0xec, 0x88, 0xf7, 0xb1, 0x23, 0xde, 0x13, 0x4d, - 0xb9, 0x9e, 0x17, 0x31, 0x4d, 0xc4, 0x32, 0x8a, 0x57, 0x70, 0xc3, 0x16, 0xf9, 0x9c, 0x69, 0x60, - 0xe6, 0x2f, 0x7a, 0x8d, 0x0e, 0xcb, 0xd1, 0x6f, 0x39, 0xa8, 0xb8, 0x6e, 0x76, 0xd3, 0xff, 0x0e, - 0x00, 0x00, 0xff, 0xff, 0x4c, 0xe4, 0x82, 0xe6, 0x48, 0x02, 0x00, 0x00, + // 386 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0x6e, 0xaa, 0x40, + 0x14, 0x86, 0xe1, 0xea, 0x75, 0x81, 0xf7, 0xe6, 0xde, 0x90, 0xc6, 0x22, 0x4d, 0x06, 0xd2, 0x45, + 0xe3, 0xa2, 0x85, 0xd4, 0x26, 0xdd, 0x4b, 0x9b, 0xd4, 0x45, 0x17, 0xc6, 0xee, 0xda, 0x85, 0x19, + 0x70, 0x82, 0x93, 0x02, 0x43, 0xe0, 0xd0, 0xa8, 0x4f, 0xd1, 0xc7, 0x72, 0xd1, 0x85, 0xcb, 0xae, + 0x4c, 0xa3, 0x3b, 0x9f, 0xa2, 0x71, 0x18, 0x15, 0xa9, 0x3b, 0x98, 0xff, 0x3f, 0xff, 0x77, 0xce, + 0xc9, 0x51, 0x4e, 0x3d, 0x46, 0x23, 0x48, 0xb2, 0xe8, 0xd5, 0xf6, 0x49, 0x44, 0x52, 0x9a, 0x5a, + 0x71, 0xc2, 0x80, 0xa9, 0xff, 0xdd, 0x29, 0xb1, 0x76, 0xa2, 0xf5, 0x76, 0xad, 0x9f, 0xf8, 0xcc, + 0x67, 0x5c, 0xb4, 0x37, 0x5f, 0xb9, 0x4f, 0x6f, 0xec, 0x03, 0x62, 0x9c, 0xe0, 0x50, 0xd4, 0xeb, + 0xcd, 0xc2, 0x7b, 0xe6, 0x06, 0x34, 0x1d, 0x91, 0x44, 0x48, 0xc6, 0x5e, 0xc2, 0x9e, 0x47, 0x62, + 0x20, 0xc3, 0xc1, 0x90, 0x85, 0x98, 0x46, 0xc2, 0x50, 0x68, 0x0a, 0x27, 0x40, 0xbd, 0x80, 0xe4, + 0xc2, 0xf9, 0x47, 0x45, 0xf9, 0xf3, 0x90, 0xb7, 0xf9, 0x04, 0x18, 0x88, 0x7a, 0xab, 0xd4, 0x72, + 0xaa, 0x26, 0x9b, 0x72, 0xab, 0xde, 0xd6, 0xac, 0x72, 0xdb, 0x56, 0x8f, 0xeb, 0x4e, 0x75, 0xb6, + 0x30, 0xa4, 0xbe, 0x70, 0xab, 0x9e, 0xf2, 0xb7, 0xb7, 0xed, 0xea, 0x91, 0xa6, 0xa0, 0xfd, 0x32, + 0x2b, 0xad, 0x7a, 0xfb, 0xec, 0x48, 0xf9, 0xd6, 0xe6, 0x98, 0x9b, 0x84, 0xf5, 0xc2, 0xd0, 0x76, + 0xf3, 0x0c, 0x02, 0x9a, 0xc2, 0x25, 0x0b, 0x29, 0x90, 0x30, 0x86, 0x49, 0xff, 0x30, 0x53, 0x1d, + 0x2b, 0x6a, 0x47, 0xcc, 0x77, 0xcf, 0xc7, 0xe3, 0xa4, 0x0a, 0x27, 0x99, 0x3f, 0x49, 0x87, 0x5e, + 0xe7, 0x42, 0xe0, 0x50, 0x69, 0x47, 0x65, 0xe8, 0x11, 0x86, 0xfa, 0xa2, 0xd4, 0x3b, 0xf9, 0xe2, + 0x38, 0xb2, 0xca, 0x91, 0xcd, 0x23, 0xc8, 0xdc, 0xe4, 0x20, 0xc1, 0x6a, 0x88, 0x75, 0x97, 0x19, + 0xc5, 0x34, 0xb5, 0xab, 0xfc, 0x13, 0xb6, 0xf4, 0x8e, 0x65, 0x11, 0x90, 0x44, 0xfb, 0x6d, 0xca, + 0xad, 0xaa, 0x83, 0xd6, 0x0b, 0x43, 0xdf, 0x4a, 0x03, 0x2f, 0xd7, 0x0a, 0x29, 0xe5, 0x32, 0xa7, + 0x3b, 0x5b, 0x22, 0x79, 0xbe, 0x44, 0xf2, 0xd7, 0x12, 0xc9, 0xef, 0x2b, 0x24, 0xcd, 0x57, 0x48, + 0xfa, 0x5c, 0x21, 0xe9, 0xd9, 0xf2, 0x29, 0x8c, 0x32, 0xd7, 0xf2, 0x58, 0x68, 0xbb, 0x53, 0x72, + 0x85, 0x83, 0x78, 0x84, 0x81, 0x60, 0xfe, 0x67, 0x8f, 0xed, 0xfd, 0x81, 0xc0, 0x24, 0x26, 0xa9, + 0x5b, 0xe3, 0xf7, 0x71, 0xf3, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x42, 0x26, 0xf9, 0xcf, 0x02, + 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -154,7 +158,7 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.ArticlesCounter != 0 { i = encodeVarintGenesis(dAtA, i, uint64(m.ArticlesCounter)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x28 } if len(m.ArticleList) > 0 { for iNdEx := len(m.ArticleList) - 1; iNdEx >= 0; iNdEx-- { @@ -424,7 +428,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ArticlesCounter", wireType) } diff --git a/x/cointrunk/types/params.go b/x/cointrunk/types/params.go index d769f2a6..7f67d8ed 100644 --- a/x/cointrunk/types/params.go +++ b/x/cointrunk/types/params.go @@ -24,6 +24,14 @@ var ( DefaultAnonArticleCost = sdk.NewCoin(DefaultDenom, sdk.NewInt(DefaultAnonArticleCostAmount)) ) +var ( + KeyPublisherRespectParams = []byte("PublisherRespectParams") + DefaultPublisherRespectParams = PublisherRespectParams{ + Denom: DefaultDenom, + Tax: sdk.NewDecWithPrec(20, 2), + } +) + // ParamKeyTable the param key table for launch module func ParamKeyTable() paramtypes.KeyTable { return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) @@ -33,10 +41,12 @@ func ParamKeyTable() paramtypes.KeyTable { func NewParams( anonArticleLimit uint64, anonArticleCost sdk.Coin, + PublisherRespectParams PublisherRespectParams, ) Params { return Params{ - AnonArticleLimit: anonArticleLimit, - AnonArticleCost: anonArticleCost, + AnonArticleLimit: anonArticleLimit, + AnonArticleCost: anonArticleCost, + PublisherRespectParams: PublisherRespectParams, } } @@ -45,6 +55,7 @@ func DefaultParams() Params { return NewParams( DefaultAnonArticleLimit, DefaultAnonArticleCost, + DefaultPublisherRespectParams, ) } @@ -53,6 +64,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ paramtypes.NewParamSetPair(KeyAnonArticleLimit, &p.AnonArticleLimit, validateAnonArticleLimit), paramtypes.NewParamSetPair(KeyAnonArticleCost, &p.AnonArticleCost, validateAnonArticleCost), + paramtypes.NewParamSetPair(KeyPublisherRespectParams, &p.PublisherRespectParams, validatePublisherRespectParams), } } @@ -66,6 +78,10 @@ func (p Params) Validate() error { return err } + if err := validatePublisherRespectParams(p.PublisherRespectParams); err != nil { + return err + } + return nil } @@ -102,3 +118,22 @@ func validateAnonArticleCost(v interface{}) error { return nil } + +// validateAnonArticleCost validates the AnonArticleCost param +func validatePublisherRespectParams(v interface{}) error { + publisherRespectParams, ok := v.(PublisherRespectParams) + if !ok { + return fmt.Errorf("invalid parameter publisherRespectParams type: %T", v) + } + + if publisherRespectParams.Tax.IsNegative() { + return fmt.Errorf("publisherRespectParams tax should be positive: %s", publisherRespectParams.Tax.String()) + } + + err := sdk.ValidateDenom(publisherRespectParams.Denom) + if err != nil { + return err + } + + return nil +} diff --git a/x/cointrunk/types/params.pb.go b/x/cointrunk/types/params.pb.go index eb02d6f3..63c7173a 100644 --- a/x/cointrunk/types/params.pb.go +++ b/x/cointrunk/types/params.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" @@ -25,15 +26,61 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. +type PublisherRespectParams struct { + Tax github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=tax,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"tax" yaml:"tax"` + Denom string `protobuf:"bytes,5,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` +} + +func (m *PublisherRespectParams) Reset() { *m = PublisherRespectParams{} } +func (m *PublisherRespectParams) String() string { return proto.CompactTextString(m) } +func (*PublisherRespectParams) ProtoMessage() {} +func (*PublisherRespectParams) Descriptor() ([]byte, []int) { + return fileDescriptor_f29b1ecdb66bf452, []int{0} +} +func (m *PublisherRespectParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PublisherRespectParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PublisherRespectParams.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 *PublisherRespectParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_PublisherRespectParams.Merge(m, src) +} +func (m *PublisherRespectParams) XXX_Size() int { + return m.Size() +} +func (m *PublisherRespectParams) XXX_DiscardUnknown() { + xxx_messageInfo_PublisherRespectParams.DiscardUnknown(m) +} + +var xxx_messageInfo_PublisherRespectParams proto.InternalMessageInfo + +func (m *PublisherRespectParams) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + type Params struct { - AnonArticleLimit uint64 `protobuf:"varint,1,opt,name=anonArticleLimit,proto3" json:"anonArticleLimit,omitempty" yaml:"anon_article_limit"` - AnonArticleCost types.Coin `protobuf:"bytes,2,opt,name=anonArticleCost,proto3" json:"anon_article_cost,omitempty" yaml:"anon_article_cost"` + AnonArticleLimit uint64 `protobuf:"varint,1,opt,name=anonArticleLimit,proto3" json:"anonArticleLimit,omitempty" yaml:"anon_article_limit"` + AnonArticleCost types.Coin `protobuf:"bytes,2,opt,name=anonArticleCost,proto3" json:"anon_article_cost,omitempty" yaml:"anon_article_cost"` + PublisherRespectParams PublisherRespectParams `protobuf:"bytes,3,opt,name=publisherRespectParams,proto3" json:"publisher_respect,omitempty" yaml:"publisher_respect"` } func (m *Params) Reset() { *m = Params{} } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_f29b1ecdb66bf452, []int{0} + return fileDescriptor_f29b1ecdb66bf452, []int{1} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -76,34 +123,90 @@ func (m *Params) GetAnonArticleCost() types.Coin { return types.Coin{} } +func (m *Params) GetPublisherRespectParams() PublisherRespectParams { + if m != nil { + return m.PublisherRespectParams + } + return PublisherRespectParams{} +} + func init() { - proto.RegisterType((*Params)(nil), "bze.cointrunk.Params") + proto.RegisterType((*PublisherRespectParams)(nil), "bze.cointrunk.v1.PublisherRespectParams") + proto.RegisterType((*Params)(nil), "bze.cointrunk.v1.Params") } func init() { proto.RegisterFile("cointrunk/params.proto", fileDescriptor_f29b1ecdb66bf452) } var fileDescriptor_f29b1ecdb66bf452 = []byte{ - // 305 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4b, 0xce, 0xcf, 0xcc, - 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, - 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0xcb, 0x49, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, - 0x83, 0x65, 0xf4, 0x41, 0x2c, 0x88, 0x22, 0x29, 0xb9, 0xe4, 0xfc, 0xe2, 0xdc, 0xfc, 0x62, 0xfd, - 0xa4, 0xc4, 0xe2, 0x54, 0xfd, 0x32, 0xc3, 0xa4, 0xd4, 0x92, 0x44, 0x43, 0x7d, 0x90, 0x26, 0x88, - 0xbc, 0xd2, 0x03, 0x46, 0x2e, 0xb6, 0x00, 0xb0, 0xa9, 0x42, 0x9e, 0x5c, 0x02, 0x89, 0x79, 0xf9, - 0x79, 0x8e, 0x45, 0x25, 0x99, 0xc9, 0x39, 0xa9, 0x3e, 0x99, 0xb9, 0x99, 0x25, 0x12, 0x8c, 0x0a, - 0x8c, 0x1a, 0x2c, 0x4e, 0xb2, 0x9f, 0xee, 0xc9, 0x4b, 0x56, 0x26, 0xe6, 0xe6, 0x58, 0x29, 0x81, - 0x54, 0xc4, 0x27, 0x42, 0x94, 0xc4, 0xe7, 0x80, 0xd4, 0x28, 0x05, 0x61, 0x68, 0x13, 0x6a, 0x61, - 0xe4, 0xe2, 0x47, 0x12, 0x74, 0xce, 0x2f, 0x2e, 0x91, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x36, 0x92, - 0xd4, 0x83, 0x38, 0x48, 0x0f, 0xe4, 0x20, 0x3d, 0xa8, 0x83, 0xf4, 0x9c, 0xf3, 0x33, 0xf3, 0x9c, - 0xec, 0x4f, 0xdc, 0x93, 0x67, 0x78, 0x75, 0x4f, 0x5e, 0x1a, 0xc5, 0x8e, 0xe4, 0xfc, 0xe2, 0x12, - 0x9d, 0xfc, 0xdc, 0xcc, 0x92, 0xd4, 0xdc, 0x82, 0x92, 0xca, 0x4f, 0xf7, 0xe4, 0x25, 0xb0, 0x38, - 0x04, 0xa4, 0x48, 0x29, 0x08, 0xdd, 0x4a, 0x2b, 0x96, 0x19, 0x0b, 0xe4, 0x19, 0x9c, 0x3c, 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, 0x4a, 0x2f, 0x3d, 0xb3, 0x24, 0xa3, 0x34, - 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0xa9, 0x2a, 0x55, 0x37, 0x31, 0xa7, 0x20, 0x23, 0xb1, 0x24, - 0x35, 0x11, 0xcc, 0xd3, 0xaf, 0xd0, 0x47, 0x04, 0x7c, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, - 0x38, 0xcc, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x03, 0x5f, 0xd2, 0x92, 0x01, 0x00, - 0x00, + // 435 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x31, 0x6b, 0xdc, 0x30, + 0x14, 0xc7, 0xad, 0x5e, 0x12, 0xa8, 0x5a, 0xe8, 0x61, 0xca, 0xe1, 0xa4, 0xd4, 0x0a, 0x1a, 0xc2, + 0x0d, 0x8d, 0xc4, 0xb5, 0x5b, 0x28, 0x94, 0x3a, 0x1d, 0x5a, 0x28, 0x25, 0x78, 0xec, 0x72, 0xc8, + 0x8e, 0xb8, 0x13, 0xb1, 0x2c, 0x63, 0xe9, 0xc2, 0x5d, 0xe6, 0x7c, 0x80, 0x8c, 0x1d, 0xdb, 0x6f, + 0x93, 0x31, 0x63, 0xe9, 0x60, 0xca, 0xdd, 0xd6, 0xd1, 0x9f, 0xa0, 0x48, 0x3a, 0x92, 0x34, 0xe7, + 0x4e, 0xb6, 0xf4, 0x7e, 0xef, 0xbd, 0xbf, 0xde, 0xfb, 0xc3, 0x41, 0xae, 0x44, 0x69, 0xea, 0x59, + 0x79, 0x46, 0x2b, 0x56, 0x33, 0xa9, 0x49, 0x55, 0x2b, 0xa3, 0xc2, 0x7e, 0x76, 0xc1, 0xc9, 0x6d, + 0x8c, 0x9c, 0x8f, 0xf6, 0x9e, 0x4f, 0xd4, 0x44, 0xb9, 0x20, 0xb5, 0x7f, 0x9e, 0xdb, 0x8b, 0x73, + 0xa5, 0xa5, 0xd2, 0x34, 0x63, 0x9a, 0xd3, 0xf3, 0x51, 0xc6, 0x0d, 0x1b, 0x51, 0x9b, 0xe7, 0xe3, + 0xf8, 0x0a, 0xc0, 0xc1, 0xc9, 0x2c, 0x2b, 0x84, 0x9e, 0xf2, 0x3a, 0xe5, 0xba, 0xe2, 0xb9, 0x39, + 0x71, 0x8d, 0xc2, 0x2f, 0xb0, 0x67, 0xd8, 0x3c, 0x02, 0xfb, 0x60, 0xf8, 0x38, 0x79, 0x7b, 0xdd, + 0xa0, 0xe0, 0x57, 0x83, 0x0e, 0x26, 0xc2, 0x4c, 0x67, 0x19, 0xc9, 0x95, 0xa4, 0xeb, 0xd2, 0xfe, + 0x73, 0xa8, 0x4f, 0xcf, 0xa8, 0x59, 0x54, 0x5c, 0x93, 0x0f, 0x3c, 0x6f, 0x1b, 0x04, 0x17, 0x4c, + 0x16, 0x47, 0xd8, 0xb0, 0x39, 0x4e, 0x6d, 0xa1, 0xf0, 0x00, 0x6e, 0x9f, 0xf2, 0x52, 0xc9, 0x68, + 0xdb, 0x55, 0xec, 0xb7, 0x0d, 0x7a, 0xea, 0x19, 0x77, 0x8d, 0x53, 0x1f, 0xc6, 0x97, 0x3d, 0xb8, + 0xb3, 0x96, 0xf0, 0x09, 0xf6, 0x59, 0xa9, 0xca, 0xf7, 0xb5, 0x11, 0x79, 0xc1, 0x3f, 0x0b, 0x29, + 0x8c, 0xd3, 0xb3, 0x95, 0xbc, 0x6c, 0x1b, 0xb4, 0xeb, 0xb3, 0x2d, 0x31, 0x66, 0x1e, 0x19, 0x17, + 0x96, 0xc1, 0xe9, 0x46, 0x5a, 0x78, 0x09, 0xe0, 0xb3, 0x7b, 0x97, 0xc7, 0x4a, 0x9b, 0xe8, 0xd1, + 0x3e, 0x18, 0x3e, 0x79, 0xbd, 0x4b, 0xfc, 0x0b, 0x88, 0x9d, 0x11, 0x59, 0xcf, 0x88, 0x1c, 0x2b, + 0x51, 0x26, 0xef, 0xec, 0xab, 0xff, 0x34, 0xe8, 0xc5, 0x3f, 0x3d, 0x72, 0xa5, 0xcd, 0x2b, 0x25, + 0x85, 0xe1, 0xb2, 0x32, 0x8b, 0xb6, 0x41, 0x51, 0x87, 0x10, 0x0b, 0xe1, 0xf4, 0x61, 0xcb, 0xf0, + 0x07, 0x80, 0x83, 0xaa, 0x73, 0xde, 0x51, 0xcf, 0xa9, 0x19, 0x92, 0x87, 0x9b, 0x25, 0xdd, 0xfb, + 0xb9, 0x13, 0x77, 0x5b, 0x6f, 0x5c, 0x7b, 0xa0, 0x4b, 0xdc, 0x06, 0x84, 0xd3, 0xff, 0x08, 0x39, + 0xda, 0xfa, 0xf6, 0x1d, 0x05, 0xc9, 0xc7, 0xeb, 0x65, 0x0c, 0x6e, 0x96, 0x31, 0xf8, 0xbd, 0x8c, + 0xc1, 0xd5, 0x2a, 0x0e, 0x6e, 0x56, 0x71, 0xf0, 0x73, 0x15, 0x07, 0x5f, 0xc9, 0x3d, 0x0f, 0x64, + 0x17, 0xfc, 0x90, 0x15, 0xd5, 0x94, 0x19, 0xce, 0xdc, 0x89, 0xce, 0xe9, 0x9d, 0x65, 0x9d, 0x1f, + 0xb2, 0x1d, 0x67, 0xb5, 0x37, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x1e, 0x82, 0x0e, 0x47, 0xcc, + 0x02, 0x00, 0x00, +} + +func (m *PublisherRespectParams) 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 *PublisherRespectParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PublisherRespectParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintParams(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x2a + } + { + size := m.Tax.Size() + i -= size + if _, err := m.Tax.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -126,6 +229,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.PublisherRespectParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a { size, err := m.AnonArticleCost.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -155,6 +268,21 @@ func encodeVarintParams(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *PublisherRespectParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Tax.Size() + n += 1 + l + sovParams(uint64(l)) + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + return n +} + func (m *Params) Size() (n int) { if m == nil { return 0 @@ -166,6 +294,8 @@ func (m *Params) Size() (n int) { } l = m.AnonArticleCost.Size() n += 1 + l + sovParams(uint64(l)) + l = m.PublisherRespectParams.Size() + n += 1 + l + sovParams(uint64(l)) return n } @@ -175,6 +305,122 @@ func sovParams(x uint64) (n int) { func sozParams(x uint64) (n int) { return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *PublisherRespectParams) 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: PublisherRespectParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PublisherRespectParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tax", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Tax.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + 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 (m *Params) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -256,6 +502,39 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublisherRespectParams", 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 + } + if err := m.PublisherRespectParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/cointrunk/types/publisher.pb.go b/x/cointrunk/types/publisher.pb.go index af30b8f9..8f0bf818 100644 --- a/x/cointrunk/types/publisher.pb.go +++ b/x/cointrunk/types/publisher.pb.go @@ -107,29 +107,29 @@ func (m *Publisher) GetRespect() int64 { } func init() { - proto.RegisterType((*Publisher)(nil), "bze.cointrunk.Publisher") + proto.RegisterType((*Publisher)(nil), "bze.cointrunk.v1.Publisher") } func init() { proto.RegisterFile("cointrunk/publisher.proto", fileDescriptor_13a2ab3c46c6721e) } var fileDescriptor_13a2ab3c46c6721e = []byte{ - // 247 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xb1, 0x4a, 0xc5, 0x30, - 0x14, 0x86, 0x1b, 0xef, 0xb5, 0xda, 0x40, 0x97, 0x0c, 0x12, 0x41, 0x42, 0x11, 0x87, 0x2e, 0xb6, - 0x83, 0x4f, 0xa0, 0x2e, 0x8e, 0xd2, 0xd1, 0x2d, 0x49, 0x0f, 0x36, 0xd8, 0xdb, 0x84, 0xe4, 0x54, - 0xf4, 0x3e, 0x85, 0x6f, 0xe2, 0x6b, 0x38, 0xde, 0xd1, 0x51, 0xda, 0x17, 0x11, 0x83, 0xf5, 0xe2, - 0x76, 0xbe, 0xef, 0x3f, 0xf0, 0xc3, 0x4f, 0x4f, 0xb5, 0x35, 0x03, 0xfa, 0x71, 0x78, 0xaa, 0xdd, - 0xa8, 0x7a, 0x13, 0x3a, 0xf0, 0x95, 0xf3, 0x16, 0x2d, 0xcb, 0xd5, 0x16, 0xaa, 0xbf, 0xf8, 0xfc, - 0x9d, 0xd0, 0xec, 0x7e, 0x79, 0x61, 0x8c, 0xae, 0x07, 0xb9, 0x01, 0x4e, 0x0a, 0x52, 0x66, 0x4d, - 0xbc, 0x19, 0xa7, 0x47, 0xb2, 0x6d, 0x3d, 0x84, 0xc0, 0x0f, 0xa2, 0x5e, 0x90, 0x9d, 0xd0, 0x54, - 0x6a, 0x34, 0xcf, 0xc0, 0x57, 0x05, 0x29, 0x8f, 0x9b, 0x5f, 0x62, 0x17, 0x34, 0x97, 0x1e, 0x8d, - 0xee, 0x21, 0xdc, 0xda, 0x71, 0x40, 0xbe, 0x2e, 0x48, 0x99, 0x37, 0xff, 0x25, 0x3b, 0xa3, 0x99, - 0xf6, 0x20, 0x11, 0xda, 0x6b, 0xe4, 0x87, 0x05, 0x29, 0x57, 0xcd, 0x5e, 0xfc, 0xb4, 0x7a, 0x08, - 0x0e, 0x34, 0xf2, 0x34, 0x66, 0x0b, 0xde, 0xdc, 0x7d, 0x4c, 0x82, 0xec, 0x26, 0x41, 0xbe, 0x26, - 0x41, 0xde, 0x66, 0x91, 0xec, 0x66, 0x91, 0x7c, 0xce, 0x22, 0x79, 0xa8, 0x1e, 0x0d, 0x76, 0xa3, - 0xaa, 0xb4, 0xdd, 0xd4, 0x6a, 0x0b, 0x97, 0xb2, 0x77, 0x9d, 0x44, 0x90, 0x91, 0xea, 0x97, 0x7a, - 0x3f, 0x0a, 0xbe, 0x3a, 0x08, 0x2a, 0x8d, 0x8b, 0x5c, 0x7d, 0x07, 0x00, 0x00, 0xff, 0xff, 0x3b, - 0x7c, 0x16, 0x76, 0x2e, 0x01, 0x00, 0x00, + // 252 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xc1, 0x4a, 0xf4, 0x30, + 0x14, 0x85, 0x9b, 0x7f, 0xe6, 0xaf, 0x36, 0x30, 0x20, 0x59, 0x48, 0x04, 0x09, 0x45, 0x5c, 0x74, + 0x63, 0x8b, 0xf8, 0x04, 0xea, 0xc6, 0xa5, 0x74, 0xe9, 0x2e, 0x49, 0x2f, 0x36, 0xd8, 0x69, 0x42, + 0x72, 0x3b, 0xe8, 0x3c, 0x85, 0x6f, 0xe2, 0x6b, 0xb8, 0x9c, 0xa5, 0x4b, 0x69, 0x5f, 0x44, 0x0c, + 0xd6, 0xc1, 0xdd, 0xfd, 0xbe, 0x73, 0xe1, 0xc0, 0xa1, 0x27, 0xda, 0x9a, 0x1e, 0xfd, 0xd0, 0x3f, + 0x55, 0x6e, 0x50, 0x9d, 0x09, 0x2d, 0xf8, 0xd2, 0x79, 0x8b, 0x96, 0x1d, 0xa9, 0x2d, 0x94, 0xbf, + 0x71, 0xb9, 0xb9, 0x3c, 0x7b, 0x23, 0x34, 0xbb, 0x9f, 0xbf, 0x18, 0xa3, 0xcb, 0x5e, 0xae, 0x81, + 0x93, 0x9c, 0x14, 0x59, 0x1d, 0x6f, 0xc6, 0xe9, 0x81, 0x6c, 0x1a, 0x0f, 0x21, 0xf0, 0x7f, 0x51, + 0xcf, 0xc8, 0x8e, 0x69, 0x2a, 0x35, 0x9a, 0x0d, 0xf0, 0x45, 0x4e, 0x8a, 0xc3, 0xfa, 0x87, 0xd8, + 0x39, 0x5d, 0x49, 0x8f, 0x46, 0x77, 0x10, 0x6e, 0xed, 0xd0, 0x23, 0x5f, 0xe6, 0xa4, 0x58, 0xd5, + 0x7f, 0x25, 0x3b, 0xa5, 0x99, 0xf6, 0x20, 0x11, 0x9a, 0x6b, 0xe4, 0xff, 0x73, 0x52, 0x2c, 0xea, + 0xbd, 0xf8, 0x6e, 0xf5, 0x10, 0x1c, 0x68, 0xe4, 0x69, 0xcc, 0x66, 0xbc, 0xb9, 0x7b, 0x1f, 0x05, + 0xd9, 0x8d, 0x82, 0x7c, 0x8e, 0x82, 0xbc, 0x4e, 0x22, 0xd9, 0x4d, 0x22, 0xf9, 0x98, 0x44, 0xf2, + 0x50, 0x3e, 0x1a, 0x6c, 0x07, 0x55, 0x6a, 0xbb, 0xae, 0xd4, 0x16, 0x2e, 0x64, 0xe7, 0x5a, 0x89, + 0x20, 0x23, 0x55, 0xcf, 0xd5, 0x7e, 0x17, 0x7c, 0x71, 0x10, 0x54, 0x1a, 0x47, 0xb9, 0xfa, 0x0a, + 0x00, 0x00, 0xff, 0xff, 0x4d, 0x37, 0xc3, 0xf1, 0x31, 0x01, 0x00, 0x00, } func (m *Publisher) Marshal() (dAtA []byte, err error) { diff --git a/x/cointrunk/types/publisher_proposal.pb.go b/x/cointrunk/types/publisher_proposal.pb.go index 9a381de3..72a68633 100644 --- a/x/cointrunk/types/publisher_proposal.pb.go +++ b/x/cointrunk/types/publisher_proposal.pb.go @@ -99,7 +99,7 @@ func (m *PublisherProposal) GetActive() bool { } func init() { - proto.RegisterType((*PublisherProposal)(nil), "bze.cointrunk.PublisherProposal") + proto.RegisterType((*PublisherProposal)(nil), "bze.cointrunk.v1.PublisherProposal") } func init() { @@ -107,22 +107,22 @@ func init() { } var fileDescriptor_3acb71719072ee70 = []byte{ - // 233 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x8f, 0x31, 0x4e, 0xc3, 0x30, - 0x18, 0x85, 0x63, 0x68, 0x0b, 0x18, 0x31, 0x60, 0x21, 0xe4, 0xc9, 0x8a, 0x3a, 0x75, 0x21, 0x1e, - 0xb8, 0x01, 0x13, 0x63, 0xd5, 0x91, 0x05, 0xd9, 0xce, 0x2f, 0x62, 0xe1, 0xda, 0x96, 0xfd, 0x07, - 0x41, 0x4f, 0x01, 0xb7, 0x62, 0xec, 0xc8, 0x88, 0x92, 0x8b, 0x20, 0x99, 0x16, 0xba, 0xbd, 0xef, - 0xbd, 0x6f, 0x79, 0x74, 0x6e, 0x82, 0xf5, 0x98, 0x7a, 0xff, 0x2c, 0x63, 0xaf, 0x9d, 0xcd, 0x1d, - 0xa4, 0xc7, 0x98, 0x42, 0x0c, 0x59, 0xb9, 0x26, 0xa6, 0x80, 0x81, 0x5d, 0xe8, 0x0d, 0x34, 0x7f, - 0xde, 0xfc, 0x83, 0xd0, 0xcb, 0xe5, 0xde, 0x5d, 0xee, 0x54, 0x76, 0x45, 0xa7, 0x68, 0xd1, 0x01, - 0x27, 0x35, 0x59, 0x9c, 0xad, 0x7e, 0x81, 0xd5, 0xf4, 0xbc, 0x85, 0x6c, 0x92, 0x8d, 0x68, 0x83, - 0xe7, 0x47, 0x65, 0x3b, 0xac, 0x18, 0xa3, 0x13, 0xaf, 0xd6, 0xc0, 0x8f, 0xcb, 0x54, 0x32, 0xe3, - 0xf4, 0x44, 0xb5, 0x6d, 0x82, 0x9c, 0xf9, 0xa4, 0xd4, 0x7b, 0x64, 0xd7, 0x74, 0xa6, 0x0c, 0xda, - 0x17, 0xe0, 0xd3, 0x9a, 0x2c, 0x4e, 0x57, 0x3b, 0xba, 0xbb, 0xff, 0x1c, 0x04, 0xd9, 0x0e, 0x82, - 0x7c, 0x0f, 0x82, 0xbc, 0x8f, 0xa2, 0xda, 0x8e, 0xa2, 0xfa, 0x1a, 0x45, 0xf5, 0xd0, 0x3c, 0x59, - 0xec, 0x7a, 0xdd, 0x98, 0xb0, 0x96, 0x7a, 0x03, 0x37, 0xca, 0xc5, 0x4e, 0x21, 0xa8, 0x42, 0xf2, - 0x55, 0xfe, 0xff, 0xc7, 0xb7, 0x08, 0x59, 0xcf, 0xca, 0xe7, 0xdb, 0x9f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x77, 0x79, 0x0e, 0xad, 0x19, 0x01, 0x00, 0x00, + // 236 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xb1, 0x4e, 0xc3, 0x30, + 0x14, 0x45, 0x63, 0x68, 0x0b, 0x98, 0x05, 0x2c, 0x84, 0x3c, 0x59, 0x51, 0xa7, 0x2e, 0x38, 0x42, + 0xfc, 0x01, 0x13, 0x63, 0xd5, 0x91, 0x05, 0xd9, 0xc9, 0x13, 0xb1, 0x70, 0x6d, 0xcb, 0x7e, 0xa9, + 0xa0, 0x5f, 0x01, 0x7f, 0xc5, 0xd8, 0x91, 0x11, 0x25, 0x3f, 0x82, 0x64, 0x1a, 0xe8, 0xf6, 0xce, + 0xbd, 0x67, 0x79, 0x97, 0xce, 0x6b, 0x6f, 0x1c, 0xc6, 0xce, 0xbd, 0x54, 0xa1, 0xd3, 0xd6, 0xa4, + 0x16, 0xe2, 0x53, 0x88, 0x3e, 0xf8, 0xa4, 0xac, 0x0c, 0xd1, 0xa3, 0x67, 0x17, 0x7a, 0x0b, 0xf2, + 0xcf, 0x93, 0x9b, 0xdb, 0xf9, 0x07, 0xa1, 0x97, 0xcb, 0x51, 0x5f, 0xee, 0x6d, 0x76, 0x45, 0xa7, + 0x68, 0xd0, 0x02, 0x27, 0x25, 0x59, 0x9c, 0xad, 0x7e, 0x81, 0x95, 0xf4, 0xbc, 0x81, 0x54, 0x47, + 0x13, 0xd0, 0x78, 0xc7, 0x8f, 0x72, 0x77, 0x18, 0x31, 0x46, 0x27, 0x4e, 0xad, 0x81, 0x1f, 0xe7, + 0x2a, 0xdf, 0x8c, 0xd3, 0x13, 0xd5, 0x34, 0x11, 0x52, 0xe2, 0x93, 0x1c, 0x8f, 0xc8, 0xae, 0xe9, + 0x4c, 0xd5, 0x68, 0x36, 0xc0, 0xa7, 0x25, 0x59, 0x9c, 0xae, 0xf6, 0x74, 0xff, 0xf0, 0xd9, 0x0b, + 0xb2, 0xeb, 0x05, 0xf9, 0xee, 0x05, 0x79, 0x1f, 0x44, 0xb1, 0x1b, 0x44, 0xf1, 0x35, 0x88, 0xe2, + 0x51, 0x3e, 0x1b, 0x6c, 0x3b, 0x2d, 0x6b, 0xbf, 0xae, 0xf4, 0x16, 0x6e, 0x94, 0x0d, 0xad, 0x42, + 0x50, 0x99, 0xaa, 0xd7, 0xea, 0x7f, 0x02, 0x7c, 0x0b, 0x90, 0xf4, 0x2c, 0xbf, 0x7d, 0xf7, 0x13, + 0x00, 0x00, 0xff, 0xff, 0xb9, 0x8e, 0x86, 0xc1, 0x1c, 0x01, 0x00, 0x00, } func (m *PublisherProposal) Marshal() (dAtA []byte, err error) { diff --git a/x/cointrunk/types/query.pb.go b/x/cointrunk/types/query.pb.go index 8fc32b4c..564a9183 100644 --- a/x/cointrunk/types/query.pb.go +++ b/x/cointrunk/types/query.pb.go @@ -586,73 +586,73 @@ func (m *QueryAllAnonArticlesCountersResponse) GetPagination() *query.PageRespon } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "bze.cointrunk.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "bze.cointrunk.QueryParamsResponse") - proto.RegisterType((*QueryAcceptedDomainRequest)(nil), "bze.cointrunk.QueryAcceptedDomainRequest") - proto.RegisterType((*QueryAcceptedDomainResponse)(nil), "bze.cointrunk.QueryAcceptedDomainResponse") - proto.RegisterType((*QueryPublisherRequest)(nil), "bze.cointrunk.QueryPublisherRequest") - proto.RegisterType((*QueryPublisherResponse)(nil), "bze.cointrunk.QueryPublisherResponse") - proto.RegisterType((*QueryPublisherByIndexRequest)(nil), "bze.cointrunk.QueryPublisherByIndexRequest") - proto.RegisterType((*QueryPublisherByIndexResponse)(nil), "bze.cointrunk.QueryPublisherByIndexResponse") - proto.RegisterType((*QueryAllArticlesRequest)(nil), "bze.cointrunk.QueryAllArticlesRequest") - proto.RegisterType((*QueryAllArticlesResponse)(nil), "bze.cointrunk.QueryAllArticlesResponse") - proto.RegisterType((*QueryAllAnonArticlesCountersRequest)(nil), "bze.cointrunk.QueryAllAnonArticlesCountersRequest") - proto.RegisterType((*QueryAllAnonArticlesCountersResponse)(nil), "bze.cointrunk.QueryAllAnonArticlesCountersResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "bze.cointrunk.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "bze.cointrunk.v1.QueryParamsResponse") + proto.RegisterType((*QueryAcceptedDomainRequest)(nil), "bze.cointrunk.v1.QueryAcceptedDomainRequest") + proto.RegisterType((*QueryAcceptedDomainResponse)(nil), "bze.cointrunk.v1.QueryAcceptedDomainResponse") + proto.RegisterType((*QueryPublisherRequest)(nil), "bze.cointrunk.v1.QueryPublisherRequest") + proto.RegisterType((*QueryPublisherResponse)(nil), "bze.cointrunk.v1.QueryPublisherResponse") + proto.RegisterType((*QueryPublisherByIndexRequest)(nil), "bze.cointrunk.v1.QueryPublisherByIndexRequest") + proto.RegisterType((*QueryPublisherByIndexResponse)(nil), "bze.cointrunk.v1.QueryPublisherByIndexResponse") + proto.RegisterType((*QueryAllArticlesRequest)(nil), "bze.cointrunk.v1.QueryAllArticlesRequest") + proto.RegisterType((*QueryAllArticlesResponse)(nil), "bze.cointrunk.v1.QueryAllArticlesResponse") + proto.RegisterType((*QueryAllAnonArticlesCountersRequest)(nil), "bze.cointrunk.v1.QueryAllAnonArticlesCountersRequest") + proto.RegisterType((*QueryAllAnonArticlesCountersResponse)(nil), "bze.cointrunk.v1.QueryAllAnonArticlesCountersResponse") } func init() { proto.RegisterFile("cointrunk/query.proto", fileDescriptor_12b6eb50b0e9fa00) } var fileDescriptor_12b6eb50b0e9fa00 = []byte{ - // 770 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcd, 0x4e, 0x13, 0x51, - 0x14, 0xc7, 0x7b, 0x51, 0x6a, 0x38, 0x44, 0x62, 0xae, 0x05, 0xea, 0x58, 0x0a, 0x0c, 0xdf, 0x1f, - 0xce, 0x84, 0x42, 0x5c, 0xb9, 0x01, 0x8d, 0x9f, 0x1b, 0xec, 0xd2, 0x68, 0x9a, 0xdb, 0xf6, 0xa6, - 0x4c, 0x9c, 0xce, 0x1d, 0x3a, 0x53, 0x02, 0x18, 0x5d, 0xf0, 0x04, 0x46, 0x77, 0xba, 0xf0, 0x21, - 0xdc, 0xf8, 0x08, 0x6c, 0x4c, 0x48, 0xdc, 0xb8, 0x32, 0x06, 0x5c, 0xfa, 0x10, 0xa6, 0xf7, 0x9e, - 0x69, 0x3b, 0xd3, 0x69, 0x01, 0xd3, 0x5d, 0xa7, 0xe7, 0xeb, 0x77, 0xfe, 0xe7, 0xde, 0x33, 0x03, - 0xa3, 0x25, 0x61, 0x39, 0x7e, 0xad, 0xee, 0xbc, 0x36, 0x77, 0xeb, 0xbc, 0x76, 0x60, 0xb8, 0x35, - 0xe1, 0x0b, 0x7a, 0xbd, 0x78, 0xc8, 0x8d, 0xa6, 0x49, 0x4b, 0x55, 0x44, 0x45, 0x48, 0x8b, 0xd9, - 0xf8, 0xa5, 0x9c, 0xb4, 0x4c, 0x45, 0x88, 0x8a, 0xcd, 0x4d, 0xe6, 0x5a, 0x26, 0x73, 0x1c, 0xe1, - 0x33, 0xdf, 0x12, 0x8e, 0x87, 0xd6, 0xe5, 0x92, 0xf0, 0xaa, 0xc2, 0x33, 0x8b, 0xcc, 0xe3, 0x2a, - 0xb7, 0xb9, 0xb7, 0x56, 0xe4, 0x3e, 0x5b, 0x33, 0x5d, 0x56, 0xb1, 0x1c, 0xe9, 0x8c, 0xbe, 0x63, - 0x2d, 0x0a, 0x97, 0xd5, 0x58, 0x35, 0xc8, 0x31, 0xd9, 0xfa, 0x9f, 0x95, 0x4a, 0xdc, 0xf5, 0x79, - 0xb9, 0x50, 0x16, 0x55, 0x66, 0x05, 0x81, 0xb7, 0xda, 0x02, 0xeb, 0x45, 0xdb, 0xf2, 0x76, 0x78, - 0x0d, 0x4d, 0xe3, 0x6d, 0xb1, 0x35, 0xdf, 0x2a, 0xd9, 0x1c, 0x0d, 0x73, 0x6d, 0x06, 0x47, 0x38, - 0x05, 0xb4, 0x7a, 0x85, 0x92, 0xa8, 0x3b, 0x7e, 0x10, 0xaf, 0xa7, 0x80, 0x3e, 0x6f, 0x50, 0x6f, - 0x4b, 0xa0, 0x3c, 0xdf, 0xad, 0x73, 0xcf, 0xd7, 0x9f, 0xc2, 0xcd, 0xd0, 0xbf, 0x9e, 0x2b, 0x1c, - 0x8f, 0xd3, 0x75, 0x48, 0x2a, 0xf0, 0x34, 0x99, 0x22, 0x8b, 0xc3, 0xb9, 0x51, 0x23, 0x24, 0xa0, - 0xa1, 0xdc, 0xb7, 0xae, 0x1e, 0xff, 0x9a, 0x4c, 0xe4, 0xd1, 0x55, 0x2f, 0x83, 0x26, 0x73, 0x6d, - 0x62, 0x6b, 0x0f, 0x64, 0x67, 0x58, 0x89, 0x3e, 0x04, 0x68, 0xe9, 0x84, 0x69, 0xe7, 0x0d, 0x25, - 0xaa, 0xd1, 0x10, 0xd5, 0x50, 0x03, 0x43, 0x51, 0x8d, 0x6d, 0x56, 0xe1, 0x18, 0x9b, 0x6f, 0x8b, - 0xd4, 0xbf, 0x12, 0xb8, 0x1d, 0x5b, 0x06, 0xd1, 0x9f, 0xc1, 0x08, 0x0b, 0x59, 0xd2, 0x64, 0xea, - 0xca, 0xe2, 0x70, 0x6e, 0x22, 0xd2, 0x42, 0x38, 0x1c, 0x5b, 0x89, 0x84, 0xd2, 0x47, 0x21, 0xe8, - 0x01, 0x09, 0xbd, 0x70, 0x2e, 0xb4, 0x22, 0x09, 0x51, 0x17, 0x60, 0x54, 0xe9, 0x1c, 0x4c, 0xb5, - 0xdf, 0xb2, 0x7c, 0x21, 0x30, 0x16, 0xad, 0x80, 0x8a, 0xdc, 0x83, 0xa1, 0xe6, 0x61, 0x42, 0x31, - 0xd2, 0xd1, 0x79, 0x06, 0x76, 0xd4, 0xa1, 0x15, 0xd0, 0x3f, 0x09, 0x36, 0x20, 0x13, 0x06, 0xdc, - 0x3a, 0x78, 0xe2, 0x94, 0xf9, 0x7e, 0xa0, 0x44, 0x0a, 0x06, 0xad, 0xc6, 0xb3, 0x14, 0x61, 0x28, - 0xaf, 0x1e, 0xf4, 0x57, 0x30, 0xd1, 0x25, 0x2a, 0xbe, 0x3b, 0x72, 0xa9, 0xee, 0x74, 0x06, 0xe3, - 0xea, 0x30, 0xd9, 0xf6, 0x26, 0xde, 0x9b, 0xf8, 0xc9, 0x0c, 0xfc, 0xf7, 0x64, 0x3e, 0x13, 0x48, - 0x77, 0xd6, 0x40, 0xfa, 0xbb, 0x70, 0x0d, 0xef, 0x2b, 0x4e, 0x66, 0x2c, 0x7a, 0x4c, 0x95, 0x15, - 0xc9, 0x03, 0xe7, 0xfe, 0x4d, 0xa5, 0x0a, 0x33, 0x4d, 0x38, 0x47, 0x38, 0x01, 0xe0, 0x7d, 0xb5, - 0x3b, 0xbc, 0x7e, 0x1f, 0xd3, 0xef, 0x04, 0x66, 0x7b, 0xd7, 0x43, 0x61, 0x5e, 0x42, 0x2a, 0xce, - 0x8e, 0x2a, 0xe9, 0x51, 0x95, 0x3a, 0x5d, 0x51, 0xb1, 0xd8, 0x2c, 0x7d, 0x93, 0x2f, 0xf7, 0x37, - 0x09, 0x83, 0xb2, 0x1f, 0xba, 0x0b, 0x49, 0xb5, 0x15, 0xe9, 0x74, 0x04, 0xae, 0x73, 0xed, 0x6a, - 0x7a, 0x2f, 0x17, 0x55, 0x46, 0x9f, 0x3a, 0xfa, 0xf1, 0xe7, 0xe3, 0x80, 0x46, 0xd3, 0x66, 0xf1, - 0x90, 0x9b, 0xad, 0x25, 0xbf, 0xb7, 0x86, 0x2f, 0x15, 0xfa, 0x81, 0xc0, 0x48, 0x78, 0x8d, 0xd1, - 0xa5, 0xb8, 0xc4, 0xb1, 0x0b, 0x59, 0x5b, 0xbe, 0x88, 0x2b, 0xb2, 0x2c, 0x49, 0x96, 0x19, 0x3a, - 0xdd, 0xc9, 0x12, 0x79, 0x91, 0xd1, 0x77, 0x30, 0xd4, 0xbc, 0x6f, 0x74, 0x36, 0xb6, 0xcf, 0xc8, - 0x0e, 0xd4, 0xe6, 0xce, 0xf1, 0x42, 0x88, 0x59, 0x09, 0x91, 0xa5, 0x99, 0x18, 0x41, 0x02, 0x67, - 0x8f, 0x7e, 0x22, 0x70, 0x23, 0xba, 0x2c, 0xe8, 0x4a, 0xcf, 0x0a, 0xe1, 0x45, 0xa4, 0xad, 0x5e, - 0xcc, 0x19, 0xa9, 0x56, 0x24, 0xd5, 0x1c, 0x9d, 0xe9, 0x41, 0x65, 0xbe, 0x91, 0xcb, 0xec, 0x2d, - 0x3d, 0x22, 0x30, 0xdc, 0xb6, 0x06, 0xe8, 0x7c, 0xec, 0x0c, 0x3a, 0x76, 0x91, 0xb6, 0x70, 0xae, - 0x1f, 0xd2, 0xe8, 0x92, 0x26, 0x43, 0xb5, 0x98, 0x41, 0x05, 0x45, 0xbf, 0x11, 0x18, 0xef, 0x72, - 0xfd, 0x68, 0xae, 0x5b, 0xa1, 0xee, 0xbb, 0x41, 0x5b, 0xbf, 0x54, 0x0c, 0x82, 0x6e, 0x48, 0x50, - 0x83, 0xae, 0xc6, 0x80, 0xda, 0x76, 0x21, 0xf6, 0x4b, 0xc6, 0xdb, 0x7a, 0x7c, 0x7c, 0x9a, 0x25, - 0x27, 0xa7, 0x59, 0xf2, 0xfb, 0x34, 0x4b, 0xde, 0x9f, 0x65, 0x13, 0x27, 0x67, 0xd9, 0xc4, 0xcf, - 0xb3, 0x6c, 0xe2, 0x85, 0x51, 0xb1, 0xfc, 0x9d, 0x7a, 0xd1, 0x28, 0x89, 0x6a, 0x23, 0xe3, 0x1d, - 0x66, 0xbb, 0x3b, 0xcc, 0xe7, 0x4c, 0x3e, 0x99, 0xfb, 0x6d, 0x15, 0xfc, 0x03, 0x97, 0x7b, 0xc5, - 0xa4, 0xfc, 0x2a, 0x5a, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0x91, 0xa0, 0xf0, 0x83, 0x31, 0x0a, - 0x00, 0x00, + // 779 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcf, 0x4f, 0x13, 0x5b, + 0x14, 0xc7, 0x7b, 0x79, 0x0f, 0x08, 0x87, 0x84, 0x90, 0xfb, 0x0a, 0x94, 0xa1, 0xaf, 0xf4, 0x0d, + 0xf4, 0xf1, 0x43, 0x98, 0x49, 0x11, 0x49, 0x5c, 0x19, 0xd0, 0xf8, 0x63, 0xa1, 0xc1, 0x2e, 0xdd, + 0xd4, 0xdb, 0xf6, 0xa6, 0x4c, 0x9c, 0xce, 0x1d, 0x3a, 0x53, 0x04, 0x8c, 0x1b, 0xe3, 0xc2, 0xa5, + 0xc6, 0x8d, 0x2b, 0x63, 0xfc, 0x23, 0x5c, 0xba, 0x66, 0x49, 0xe2, 0xc6, 0x95, 0x31, 0xe0, 0x1f, + 0x62, 0x7a, 0xef, 0x99, 0xb6, 0xd3, 0x99, 0x52, 0x30, 0xdd, 0x75, 0x7a, 0x7e, 0x7d, 0xce, 0xf7, + 0xdc, 0x7b, 0x66, 0x60, 0xaa, 0x2c, 0x2c, 0xc7, 0xaf, 0x37, 0x9c, 0x67, 0xe6, 0x7e, 0x83, 0xd7, + 0x8f, 0x0c, 0xb7, 0x2e, 0x7c, 0x41, 0x27, 0x4b, 0xc7, 0xdc, 0x68, 0x99, 0x8c, 0x83, 0xbc, 0x96, + 0xac, 0x8a, 0xaa, 0x90, 0x46, 0xb3, 0xf9, 0x4b, 0xf9, 0x69, 0xe9, 0xaa, 0x10, 0x55, 0x9b, 0x9b, + 0xcc, 0xb5, 0x4c, 0xe6, 0x38, 0xc2, 0x67, 0xbe, 0x25, 0x1c, 0x0f, 0xad, 0xab, 0x65, 0xe1, 0xd5, + 0x84, 0x67, 0x96, 0x98, 0xc7, 0x55, 0x7a, 0xf3, 0x20, 0x5f, 0xe2, 0x3e, 0xcb, 0x9b, 0x2e, 0xab, + 0x5a, 0x8e, 0x74, 0x46, 0xdf, 0xe9, 0x36, 0x88, 0xcb, 0xea, 0xac, 0x16, 0xe4, 0x98, 0x6f, 0xff, + 0xcf, 0xca, 0x65, 0xee, 0xfa, 0xbc, 0x52, 0xac, 0x88, 0x1a, 0xb3, 0x82, 0xc0, 0xd9, 0x8e, 0xc0, + 0x46, 0xc9, 0xb6, 0xbc, 0x3d, 0x5e, 0x47, 0xd3, 0x4c, 0x47, 0x6c, 0xdd, 0xb7, 0xca, 0x36, 0x47, + 0x43, 0xae, 0xc3, 0xe0, 0x08, 0xa7, 0x88, 0x56, 0xaf, 0x58, 0x16, 0x0d, 0xc7, 0x0f, 0xe2, 0xf5, + 0x24, 0xd0, 0xc7, 0x4d, 0xea, 0x5d, 0x09, 0x54, 0xe0, 0xfb, 0x0d, 0xee, 0xf9, 0xfa, 0x43, 0xf8, + 0x27, 0xf4, 0xaf, 0xe7, 0x0a, 0xc7, 0xe3, 0x74, 0x0b, 0x46, 0x14, 0x78, 0x8a, 0x64, 0xc9, 0xf2, + 0xf8, 0x46, 0xca, 0xe8, 0xd6, 0xd0, 0x50, 0x11, 0x3b, 0x7f, 0x9f, 0xfc, 0x98, 0x4f, 0x14, 0xd0, + 0x5b, 0xaf, 0x80, 0x26, 0xd3, 0x6d, 0x63, 0x77, 0x77, 0x64, 0x73, 0x58, 0x8c, 0xde, 0x05, 0x68, + 0x4b, 0x85, 0x99, 0xff, 0x37, 0x94, 0xae, 0x46, 0x53, 0x57, 0x43, 0x8d, 0x0d, 0x75, 0x35, 0x76, + 0x59, 0x95, 0x63, 0x6c, 0xa1, 0x23, 0x52, 0xff, 0x42, 0x60, 0x2e, 0xb6, 0x0c, 0xd2, 0x3f, 0x82, + 0x09, 0x16, 0xb2, 0xa4, 0x48, 0xf6, 0xaf, 0xe5, 0xf1, 0x8d, 0x6c, 0xb4, 0x8b, 0x70, 0x06, 0xec, + 0xa6, 0x2b, 0x9a, 0xde, 0x0b, 0x71, 0x0f, 0x49, 0xee, 0xa5, 0xbe, 0xdc, 0x0a, 0x26, 0x04, 0x5e, + 0x84, 0x29, 0xa5, 0x76, 0x30, 0xdb, 0x41, 0x2b, 0xf3, 0x99, 0xc0, 0x74, 0x77, 0x05, 0x14, 0xe5, + 0x16, 0x8c, 0xb5, 0x8e, 0x14, 0xea, 0x31, 0x17, 0x33, 0xd5, 0xc0, 0x05, 0xa5, 0x68, 0xc7, 0x0c, + 0x4e, 0x85, 0x4d, 0x48, 0x87, 0x19, 0x77, 0x8e, 0x1e, 0x38, 0x15, 0x7e, 0x18, 0x88, 0x91, 0x84, + 0x61, 0xab, 0xf9, 0x2c, 0x75, 0x18, 0x2b, 0xa8, 0x07, 0xfd, 0x29, 0xfc, 0xdb, 0x23, 0x2a, 0xbe, + 0x41, 0x72, 0xd5, 0x06, 0x75, 0x06, 0x33, 0xea, 0x54, 0xd9, 0xf6, 0x36, 0xde, 0xa1, 0xf8, 0xf9, + 0x0c, 0xfd, 0xf1, 0x7c, 0x3e, 0x12, 0x48, 0x45, 0x6b, 0x60, 0x03, 0x37, 0x61, 0x14, 0xef, 0x2e, + 0xce, 0x67, 0x36, 0xe6, 0xbc, 0x2a, 0x07, 0x84, 0x0f, 0xfc, 0x07, 0x37, 0x9b, 0x1a, 0x2c, 0xb4, + 0xf8, 0x1c, 0xe1, 0x04, 0x8c, 0xb7, 0xd5, 0x2a, 0xf1, 0x06, 0x7d, 0x5e, 0x4f, 0x09, 0x2c, 0x5e, + 0x5c, 0x0f, 0xb5, 0x29, 0x42, 0x32, 0xce, 0x8e, 0x42, 0xe5, 0x62, 0x84, 0x8a, 0x7a, 0xa3, 0x68, + 0xb1, 0x89, 0x06, 0xa6, 0xe0, 0xc6, 0xbb, 0x51, 0x18, 0x96, 0x2d, 0xd1, 0xe7, 0x30, 0xa2, 0x96, + 0x24, 0x5d, 0x8c, 0xf2, 0x45, 0x77, 0xb1, 0x96, 0xeb, 0xe3, 0xa5, 0x8a, 0xe9, 0xd9, 0x57, 0xdf, + 0x7e, 0xbd, 0x1f, 0xd2, 0x68, 0xca, 0x2c, 0x1d, 0x73, 0xb3, 0xbd, 0xfc, 0x0f, 0xf2, 0xf8, 0xb2, + 0xa1, 0x1f, 0x08, 0x4c, 0x84, 0x17, 0x1b, 0x5d, 0xeb, 0x91, 0x3b, 0x76, 0x51, 0x6b, 0xeb, 0x97, + 0xf4, 0x46, 0xa2, 0x15, 0x49, 0xb4, 0x40, 0xff, 0x8b, 0x12, 0x75, 0xbd, 0xe6, 0xe8, 0x6b, 0x02, + 0x63, 0xad, 0x2b, 0x48, 0x97, 0x7a, 0x75, 0xdc, 0xb5, 0x1f, 0xb5, 0xe5, 0xfe, 0x8e, 0xc8, 0xb2, + 0x28, 0x59, 0x32, 0x34, 0x1d, 0xa3, 0x4e, 0xe0, 0xec, 0xd1, 0x4f, 0x04, 0x26, 0xbb, 0x17, 0x09, + 0x35, 0xfa, 0x15, 0x09, 0xef, 0x29, 0xcd, 0xbc, 0xb4, 0x3f, 0xb2, 0x5d, 0x93, 0x6c, 0x39, 0xba, + 0x70, 0x01, 0x9b, 0xf9, 0x42, 0xae, 0xbb, 0x97, 0xf4, 0x0d, 0x81, 0xf1, 0x8e, 0x2d, 0x41, 0x57, + 0x7a, 0xcd, 0x24, 0xb2, 0xad, 0xb4, 0xd5, 0xcb, 0xb8, 0x22, 0x93, 0x2e, 0x99, 0xd2, 0x54, 0x8b, + 0x99, 0x5d, 0x50, 0xfa, 0x2b, 0x81, 0x99, 0x1e, 0x17, 0x94, 0xde, 0xb8, 0xa0, 0x56, 0xef, 0x05, + 0xa2, 0x6d, 0x5d, 0x35, 0x0c, 0x71, 0x37, 0x25, 0xae, 0x41, 0xd7, 0x62, 0x70, 0x6d, 0xbb, 0x18, + 0xfb, 0x01, 0xe4, 0xed, 0xdc, 0x3f, 0x39, 0xcb, 0x90, 0xd3, 0xb3, 0x0c, 0xf9, 0x79, 0x96, 0x21, + 0x6f, 0xcf, 0x33, 0x89, 0xd3, 0xf3, 0x4c, 0xe2, 0xfb, 0x79, 0x26, 0xf1, 0xc4, 0xa8, 0x5a, 0xfe, + 0x5e, 0xa3, 0x64, 0x94, 0x45, 0xad, 0x99, 0x71, 0x9d, 0xd9, 0xee, 0x1e, 0xf3, 0x39, 0x93, 0x4f, + 0xe6, 0x61, 0x47, 0x05, 0xff, 0xc8, 0xe5, 0x5e, 0x69, 0x44, 0x7e, 0x4c, 0x5d, 0xff, 0x1d, 0x00, + 0x00, 0xff, 0xff, 0x9b, 0x6e, 0xdb, 0xc8, 0x6b, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -691,7 +691,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/bze.cointrunk.v1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -700,7 +700,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . func (c *queryClient) AcceptedDomain(ctx context.Context, in *QueryAcceptedDomainRequest, opts ...grpc.CallOption) (*QueryAcceptedDomainResponse, error) { out := new(QueryAcceptedDomainResponse) - err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/AcceptedDomain", in, out, opts...) + err := c.cc.Invoke(ctx, "/bze.cointrunk.v1.Query/AcceptedDomain", in, out, opts...) if err != nil { return nil, err } @@ -709,7 +709,7 @@ func (c *queryClient) AcceptedDomain(ctx context.Context, in *QueryAcceptedDomai func (c *queryClient) Publisher(ctx context.Context, in *QueryPublisherRequest, opts ...grpc.CallOption) (*QueryPublisherResponse, error) { out := new(QueryPublisherResponse) - err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/Publisher", in, out, opts...) + err := c.cc.Invoke(ctx, "/bze.cointrunk.v1.Query/Publisher", in, out, opts...) if err != nil { return nil, err } @@ -718,7 +718,7 @@ func (c *queryClient) Publisher(ctx context.Context, in *QueryPublisherRequest, func (c *queryClient) PublisherByIndex(ctx context.Context, in *QueryPublisherByIndexRequest, opts ...grpc.CallOption) (*QueryPublisherByIndexResponse, error) { out := new(QueryPublisherByIndexResponse) - err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/PublisherByIndex", in, out, opts...) + err := c.cc.Invoke(ctx, "/bze.cointrunk.v1.Query/PublisherByIndex", in, out, opts...) if err != nil { return nil, err } @@ -727,7 +727,7 @@ func (c *queryClient) PublisherByIndex(ctx context.Context, in *QueryPublisherBy func (c *queryClient) AllArticles(ctx context.Context, in *QueryAllArticlesRequest, opts ...grpc.CallOption) (*QueryAllArticlesResponse, error) { out := new(QueryAllArticlesResponse) - err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/AllArticles", in, out, opts...) + err := c.cc.Invoke(ctx, "/bze.cointrunk.v1.Query/AllArticles", in, out, opts...) if err != nil { return nil, err } @@ -736,7 +736,7 @@ func (c *queryClient) AllArticles(ctx context.Context, in *QueryAllArticlesReque func (c *queryClient) AllAnonArticlesCounters(ctx context.Context, in *QueryAllAnonArticlesCountersRequest, opts ...grpc.CallOption) (*QueryAllAnonArticlesCountersResponse, error) { out := new(QueryAllAnonArticlesCountersResponse) - err := c.cc.Invoke(ctx, "/bze.cointrunk.Query/AllAnonArticlesCounters", in, out, opts...) + err := c.cc.Invoke(ctx, "/bze.cointrunk.v1.Query/AllAnonArticlesCounters", in, out, opts...) if err != nil { return nil, err } @@ -796,7 +796,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bze.cointrunk.Query/Params", + FullMethod: "/bze.cointrunk.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -814,7 +814,7 @@ func _Query_AcceptedDomain_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bze.cointrunk.Query/AcceptedDomain", + FullMethod: "/bze.cointrunk.v1.Query/AcceptedDomain", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).AcceptedDomain(ctx, req.(*QueryAcceptedDomainRequest)) @@ -832,7 +832,7 @@ func _Query_Publisher_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bze.cointrunk.Query/Publisher", + FullMethod: "/bze.cointrunk.v1.Query/Publisher", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Publisher(ctx, req.(*QueryPublisherRequest)) @@ -850,7 +850,7 @@ func _Query_PublisherByIndex_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bze.cointrunk.Query/PublisherByIndex", + FullMethod: "/bze.cointrunk.v1.Query/PublisherByIndex", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).PublisherByIndex(ctx, req.(*QueryPublisherByIndexRequest)) @@ -868,7 +868,7 @@ func _Query_AllArticles_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bze.cointrunk.Query/AllArticles", + FullMethod: "/bze.cointrunk.v1.Query/AllArticles", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).AllArticles(ctx, req.(*QueryAllArticlesRequest)) @@ -886,7 +886,7 @@ func _Query_AllAnonArticlesCounters_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bze.cointrunk.Query/AllAnonArticlesCounters", + FullMethod: "/bze.cointrunk.v1.Query/AllAnonArticlesCounters", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).AllAnonArticlesCounters(ctx, req.(*QueryAllAnonArticlesCountersRequest)) @@ -895,7 +895,7 @@ func _Query_AllAnonArticlesCounters_Handler(srv interface{}, ctx context.Context } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "bze.cointrunk.Query", + ServiceName: "bze.cointrunk.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/x/cointrunk/types/tx.pb.go b/x/cointrunk/types/tx.pb.go index d43c0e6c..3d847bce 100644 --- a/x/cointrunk/types/tx.pb.go +++ b/x/cointrunk/types/tx.pb.go @@ -252,40 +252,40 @@ func (m *MsgPayPublisherRespectResponse) GetCommunityPoolFunds() uint64 { } func init() { - proto.RegisterType((*MsgAddArticle)(nil), "bze.cointrunk.MsgAddArticle") - proto.RegisterType((*MsgAddArticleResponse)(nil), "bze.cointrunk.MsgAddArticleResponse") - proto.RegisterType((*MsgPayPublisherRespect)(nil), "bze.cointrunk.MsgPayPublisherRespect") - proto.RegisterType((*MsgPayPublisherRespectResponse)(nil), "bze.cointrunk.MsgPayPublisherRespectResponse") + proto.RegisterType((*MsgAddArticle)(nil), "bze.cointrunk.v1.MsgAddArticle") + proto.RegisterType((*MsgAddArticleResponse)(nil), "bze.cointrunk.v1.MsgAddArticleResponse") + proto.RegisterType((*MsgPayPublisherRespect)(nil), "bze.cointrunk.v1.MsgPayPublisherRespect") + proto.RegisterType((*MsgPayPublisherRespectResponse)(nil), "bze.cointrunk.v1.MsgPayPublisherRespectResponse") } func init() { proto.RegisterFile("cointrunk/tx.proto", fileDescriptor_776bb1586e9b1fcd) } var fileDescriptor_776bb1586e9b1fcd = []byte{ - // 378 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcb, 0x6a, 0xdb, 0x40, - 0x14, 0xb5, 0x6a, 0xd5, 0xc5, 0xb7, 0x98, 0x96, 0x69, 0xeb, 0x0a, 0x53, 0x84, 0x11, 0x2d, 0x78, - 0x63, 0x09, 0x9a, 0x2f, 0x70, 0x16, 0x21, 0x1b, 0x83, 0xd0, 0x32, 0xbb, 0x91, 0x66, 0x90, 0x07, - 0x4b, 0x1a, 0x31, 0x0f, 0x62, 0xfb, 0x2b, 0xf2, 0x01, 0xf9, 0x9c, 0x2c, 0xb2, 0xf4, 0x32, 0xcb, - 0x60, 0xff, 0x48, 0xd0, 0xd8, 0xf2, 0x23, 0x11, 0x21, 0x3b, 0x9d, 0x73, 0xee, 0xd5, 0x39, 0x73, - 0xef, 0x05, 0x94, 0x70, 0x56, 0x28, 0xa1, 0x8b, 0x79, 0xa0, 0x16, 0x7e, 0x29, 0xb8, 0xe2, 0xa8, - 0x17, 0xaf, 0xa8, 0x7f, 0xe0, 0x3d, 0x0e, 0xbd, 0xa9, 0x4c, 0x27, 0x84, 0x4c, 0x84, 0x62, 0x49, - 0x46, 0xd1, 0x1f, 0xe8, 0x96, 0x3a, 0xce, 0x98, 0x9c, 0x51, 0xe1, 0x58, 0x43, 0x6b, 0xd4, 0x8d, - 0x8e, 0x04, 0xfa, 0x09, 0x9f, 0x15, 0x53, 0x19, 0x75, 0x3e, 0x19, 0x65, 0x07, 0xd0, 0x77, 0x68, - 0x6b, 0x91, 0x39, 0x6d, 0xc3, 0x55, 0x9f, 0xc8, 0x81, 0x2f, 0x25, 0x4b, 0x94, 0x16, 0xd4, 0xb1, - 0x0d, 0x5b, 0x43, 0xef, 0x37, 0xfc, 0x3a, 0x33, 0x8c, 0xa8, 0x2c, 0x79, 0x21, 0xa9, 0x47, 0xa0, - 0x3f, 0x95, 0x69, 0x88, 0x97, 0x61, 0xed, 0x56, 0x49, 0x34, 0x51, 0xd5, 0xcf, 0x12, 0x41, 0xb1, - 0xe2, 0x75, 0xa0, 0x1a, 0x56, 0x0a, 0x26, 0x44, 0x50, 0x29, 0xf7, 0x81, 0x6a, 0x88, 0xfa, 0xd0, - 0xc1, 0x39, 0xd7, 0x85, 0xda, 0xa7, 0xda, 0x23, 0xef, 0xde, 0x02, 0xb7, 0xd9, 0xa6, 0x0e, 0x82, - 0x86, 0xf0, 0x55, 0xec, 0xa8, 0x10, 0x33, 0x62, 0x2c, 0xed, 0xe8, 0x94, 0x42, 0x23, 0xf8, 0x56, - 0x1e, 0xbb, 0x6f, 0xb1, 0x20, 0xc6, 0xde, 0x8e, 0x5e, 0xd3, 0xc8, 0xaf, 0x76, 0x90, 0xe7, 0xba, - 0x60, 0x6a, 0x19, 0x72, 0x9e, 0x5d, 0xe9, 0x82, 0x48, 0x13, 0xc9, 0x8e, 0x1a, 0x94, 0xff, 0x0f, - 0x16, 0xb4, 0xa7, 0x32, 0x45, 0x21, 0xc0, 0xe9, 0x4e, 0xfc, 0xb3, 0xa5, 0xf9, 0x67, 0x03, 0x1c, - 0xfc, 0x7d, 0x4f, 0x3d, 0xbc, 0x6a, 0x0e, 0x3f, 0x9a, 0x66, 0xfb, 0xef, 0x6d, 0x73, 0x43, 0xd9, - 0x60, 0xfc, 0xa1, 0xb2, 0xda, 0xec, 0xf2, 0xfa, 0x71, 0xe3, 0x5a, 0xeb, 0x8d, 0x6b, 0x3d, 0x6f, - 0x5c, 0xeb, 0x6e, 0xeb, 0xb6, 0xd6, 0x5b, 0xb7, 0xf5, 0xb4, 0x75, 0x5b, 0x37, 0x7e, 0xca, 0xd4, - 0x4c, 0xc7, 0x7e, 0xc2, 0xf3, 0x20, 0x5e, 0xd1, 0x31, 0xce, 0xca, 0x19, 0x56, 0x14, 0x1b, 0x14, - 0x2c, 0x82, 0x93, 0x8b, 0x5d, 0x96, 0x54, 0xc6, 0x1d, 0x73, 0xb5, 0x17, 0x2f, 0x01, 0x00, 0x00, - 0xff, 0xff, 0xac, 0x86, 0xd0, 0x4d, 0xcb, 0x02, 0x00, 0x00, + // 382 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xbb, 0x8e, 0xd3, 0x40, + 0x14, 0x8d, 0x89, 0x09, 0xca, 0x45, 0x88, 0x68, 0x80, 0x60, 0x45, 0xc8, 0x44, 0x6e, 0x48, 0xc3, + 0x98, 0xc7, 0x17, 0x84, 0x02, 0xd1, 0x44, 0xb2, 0x5c, 0x50, 0xd0, 0x8d, 0x3d, 0x23, 0x67, 0x84, + 0xed, 0x31, 0xf3, 0x60, 0x93, 0x7c, 0xc5, 0x7e, 0xc0, 0x7e, 0xd0, 0x96, 0x29, 0xb7, 0x5c, 0x25, + 0x3f, 0xb2, 0xf2, 0x24, 0xce, 0x4b, 0x96, 0x76, 0x3b, 0x9f, 0x73, 0xee, 0xf5, 0x39, 0x73, 0xef, + 0x05, 0x94, 0x0a, 0x5e, 0x6a, 0x69, 0xca, 0xbf, 0xa1, 0x5e, 0xe0, 0x4a, 0x0a, 0x2d, 0xd0, 0x20, + 0x59, 0x31, 0x7c, 0xe0, 0xf1, 0xff, 0xaf, 0x81, 0x80, 0x57, 0x33, 0x95, 0x4d, 0x29, 0x9d, 0x4a, + 0xcd, 0xd3, 0x9c, 0xa1, 0x0f, 0xd0, 0xaf, 0x4c, 0x92, 0x73, 0x35, 0x67, 0xd2, 0x73, 0xc6, 0xce, + 0xa4, 0x1f, 0x1f, 0x09, 0xf4, 0x16, 0x9e, 0x6b, 0xae, 0x73, 0xe6, 0x3d, 0xb3, 0xca, 0x0e, 0xa0, + 0x01, 0x74, 0x8d, 0xcc, 0xbd, 0xae, 0xe5, 0xea, 0x4f, 0xe4, 0xc1, 0x8b, 0x8a, 0xa7, 0xda, 0x48, + 0xe6, 0xb9, 0x96, 0x6d, 0x60, 0xf0, 0x1e, 0xde, 0x9d, 0x19, 0xc6, 0x4c, 0x55, 0xa2, 0x54, 0x2c, + 0xa0, 0x30, 0x9c, 0xa9, 0x2c, 0x22, 0xcb, 0xa8, 0x71, 0xab, 0x25, 0x96, 0xea, 0xfa, 0x67, 0xa9, + 0x64, 0x44, 0x8b, 0x26, 0x50, 0x03, 0x6b, 0x85, 0x50, 0x2a, 0x99, 0x52, 0xfb, 0x40, 0x0d, 0x44, + 0x43, 0xe8, 0x91, 0x42, 0x98, 0x52, 0xef, 0x53, 0xed, 0x51, 0x70, 0xe3, 0x80, 0xdf, 0x6e, 0xd3, + 0x04, 0x41, 0x63, 0x78, 0x29, 0x77, 0x54, 0x44, 0x38, 0xb5, 0x96, 0x6e, 0x7c, 0x4a, 0xa1, 0x09, + 0xbc, 0xae, 0x8e, 0xdd, 0x57, 0x44, 0x52, 0x6b, 0xef, 0xc6, 0x97, 0x34, 0xc2, 0xf5, 0x1a, 0x8a, + 0xc2, 0x94, 0x5c, 0x2f, 0x23, 0x21, 0xf2, 0x9f, 0xa6, 0xa4, 0xca, 0x46, 0x72, 0xe3, 0x16, 0xe5, + 0xdb, 0xda, 0x81, 0xee, 0x4c, 0x65, 0xe8, 0x37, 0xc0, 0xc9, 0x4e, 0x3e, 0xe2, 0xcb, 0xbd, 0xe1, + 0xb3, 0x19, 0x8e, 0x3e, 0x3d, 0x52, 0x70, 0x78, 0xdb, 0x3f, 0x78, 0xd3, 0x36, 0xe1, 0x49, 0x6b, + 0x7f, 0x4b, 0xe5, 0xe8, 0xcb, 0x53, 0x2b, 0x1b, 0xcb, 0x1f, 0xbf, 0x6e, 0x37, 0xbe, 0xb3, 0xde, + 0xf8, 0xce, 0xfd, 0xc6, 0x77, 0xae, 0xb7, 0x7e, 0x67, 0xbd, 0xf5, 0x3b, 0x77, 0x5b, 0xbf, 0xf3, + 0x07, 0x67, 0x5c, 0xcf, 0x4d, 0x82, 0x53, 0x51, 0x84, 0xc9, 0x8a, 0x7d, 0x26, 0x79, 0x35, 0x27, + 0x9a, 0x11, 0x8b, 0xc2, 0x45, 0x78, 0x72, 0xc0, 0xcb, 0x8a, 0xa9, 0xa4, 0x67, 0x8f, 0xf8, 0xfb, + 0x43, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x9e, 0x2f, 0xf3, 0xda, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -314,7 +314,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) AddArticle(ctx context.Context, in *MsgAddArticle, opts ...grpc.CallOption) (*MsgAddArticleResponse, error) { out := new(MsgAddArticleResponse) - err := c.cc.Invoke(ctx, "/bze.cointrunk.Msg/AddArticle", in, out, opts...) + err := c.cc.Invoke(ctx, "/bze.cointrunk.v1.Msg/AddArticle", in, out, opts...) if err != nil { return nil, err } @@ -323,7 +323,7 @@ func (c *msgClient) AddArticle(ctx context.Context, in *MsgAddArticle, opts ...g func (c *msgClient) PayPublisherRespect(ctx context.Context, in *MsgPayPublisherRespect, opts ...grpc.CallOption) (*MsgPayPublisherRespectResponse, error) { out := new(MsgPayPublisherRespectResponse) - err := c.cc.Invoke(ctx, "/bze.cointrunk.Msg/PayPublisherRespect", in, out, opts...) + err := c.cc.Invoke(ctx, "/bze.cointrunk.v1.Msg/PayPublisherRespect", in, out, opts...) if err != nil { return nil, err } @@ -361,7 +361,7 @@ func _Msg_AddArticle_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bze.cointrunk.Msg/AddArticle", + FullMethod: "/bze.cointrunk.v1.Msg/AddArticle", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).AddArticle(ctx, req.(*MsgAddArticle)) @@ -379,7 +379,7 @@ func _Msg_PayPublisherRespect_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bze.cointrunk.Msg/PayPublisherRespect", + FullMethod: "/bze.cointrunk.v1.Msg/PayPublisherRespect", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).PayPublisherRespect(ctx, req.(*MsgPayPublisherRespect)) @@ -388,7 +388,7 @@ func _Msg_PayPublisherRespect_Handler(srv interface{}, ctx context.Context, dec } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "bze.cointrunk.Msg", + ServiceName: "bze.cointrunk.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { From 7d62d49c00f30ece54477463aa64a903e7e8da98 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Wed, 28 Dec 2022 17:27:40 +0200 Subject: [PATCH 46/54] use snake case on genesis state --- go.mod | 3 ++ go.sum | 5 +++ proto/burner/genesis.proto | 2 +- proto/cointrunk/genesis.proto | 10 +++--- proto/cointrunk/params.proto | 6 ++-- x/burner/types/genesis.pb.go | 26 +++++++------- x/cointrunk/types/genesis.pb.go | 60 +++++++++++++++---------------- x/cointrunk/types/params.pb.go | 64 ++++++++++++++++----------------- 8 files changed, 92 insertions(+), 84 deletions(-) diff --git a/go.mod b/go.mod index f108c1ed..95260012 100644 --- a/go.mod +++ b/go.mod @@ -54,11 +54,13 @@ require ( github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.4 // 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.5.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect + github.com/golang/glog v1.0.0 // indirect github.com/golang/snappy v0.0.3 // indirect github.com/google/btree v1.0.0 // indirect github.com/google/go-cmp v0.5.9 // indirect @@ -67,6 +69,7 @@ require ( github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect diff --git a/go.sum b/go.sum index f174aa5f..81fcb86a 100644 --- a/go.sum +++ b/go.sum @@ -528,6 +528,7 @@ github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASx github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +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= @@ -633,6 +634,8 @@ github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/ github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -790,6 +793,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= 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.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= diff --git a/proto/burner/genesis.proto b/proto/burner/genesis.proto index 563ddbcb..940c7f72 100644 --- a/proto/burner/genesis.proto +++ b/proto/burner/genesis.proto @@ -11,7 +11,7 @@ option go_package = "github.com/bze-alphateam/bze/x/burner/types"; // GenesisState defines the burner module's genesis state. message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; - repeated BurnedCoins BurnedCoinsList = 2 [ + repeated BurnedCoins burned_coins_list = 2 [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "burned_coins_list,omitempty" ]; diff --git a/proto/cointrunk/genesis.proto b/proto/cointrunk/genesis.proto index b3519c1b..5ec9b462 100644 --- a/proto/cointrunk/genesis.proto +++ b/proto/cointrunk/genesis.proto @@ -15,19 +15,19 @@ message GenesisState { Params params = 1 [ (gogoproto.nullable) = false ]; - repeated Publisher PublisherList = 2 [ + repeated Publisher publisher_list = 2 [ (gogoproto.nullable) = false, - (gogoproto.jsontag) = "publisher_list,omitempty" + (gogoproto.jsontag) = "publishers_list,omitempty" ]; - repeated AcceptedDomain AcceptedDomainList = 3 [ + repeated AcceptedDomain accepted_domain_list = 3 [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "accepted_domain_list,omitempty" ]; - repeated Article ArticleList = 4 [ + repeated Article article_list = 4 [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "article_list,omitempty" ]; - uint64 articlesCounter = 5 [ + uint64 articles_counter = 5 [ (gogoproto.jsontag) = "articles_counter,omitempty" ]; // this line is used by starport scaffolding # genesis/proto/state diff --git a/proto/cointrunk/params.proto b/proto/cointrunk/params.proto index abbb2b65..52d2b88e 100644 --- a/proto/cointrunk/params.proto +++ b/proto/cointrunk/params.proto @@ -19,14 +19,14 @@ message PublisherRespectParams { message Params { option (gogoproto.goproto_stringer) = false; - uint64 anonArticleLimit = 1 [(gogoproto.moretags) = "yaml:\"anon_article_limit\""]; - cosmos.base.v1beta1.Coin anonArticleCost = 2 [ + uint64 anon_article_limit = 1 [(gogoproto.moretags) = "yaml:\"anon_article_limit\""]; + cosmos.base.v1beta1.Coin anon_article_cost = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"anon_article_cost\"", (gogoproto.jsontag) = "anon_article_cost,omitempty" ]; - PublisherRespectParams publisherRespectParams = 3 [ + PublisherRespectParams publisher_respect_params = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"publisher_respect\"", (gogoproto.jsontag) = "publisher_respect,omitempty" diff --git a/x/burner/types/genesis.pb.go b/x/burner/types/genesis.pb.go index 4db816d5..844a0f50 100644 --- a/x/burner/types/genesis.pb.go +++ b/x/burner/types/genesis.pb.go @@ -26,7 +26,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the burner module's genesis state. type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - BurnedCoinsList []BurnedCoins `protobuf:"bytes,2,rep,name=BurnedCoinsList,proto3" json:"burned_coins_list,omitempty"` + BurnedCoinsList []BurnedCoins `protobuf:"bytes,2,rep,name=burned_coins_list,json=burnedCoinsList,proto3" json:"burned_coins_list,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -83,24 +83,24 @@ func init() { func init() { proto.RegisterFile("burner/genesis.proto", fileDescriptor_62cceffcaad9705b) } var fileDescriptor_62cceffcaad9705b = []byte{ - // 263 bytes of a gzipped FileDescriptorProto + // 264 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x49, 0x2a, 0x2d, 0xca, 0x4b, 0x2d, 0xd2, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0xc8, 0xe8, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x65, 0xf4, 0x41, 0x2c, 0x88, 0x22, 0x29, 0x61, 0xa8, 0xd6, 0x82, 0xc4, 0xa2, 0xc4, 0x5c, 0xa8, 0x4e, 0x29, 0x49, 0xa8, 0x20, 0x98, 0x4a, 0x89, 0x4f, 0xce, 0xcf, 0xcc, 0x83, 0x4a, - 0x29, 0xad, 0x63, 0xe4, 0xe2, 0x71, 0x87, 0x58, 0x13, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xcc, + 0x29, 0x6d, 0x60, 0xe4, 0xe2, 0x71, 0x87, 0x58, 0x13, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xcc, 0xc5, 0x06, 0xd1, 0x2b, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xaa, 0x87, 0x62, 0xad, 0x5e, - 0x00, 0x58, 0xd2, 0x89, 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0xa8, 0x52, 0xa1, 0x4c, 0x2e, 0x7e, - 0x27, 0xb0, 0xd9, 0xce, 0x20, 0xa3, 0x7d, 0x32, 0x8b, 0x4b, 0x24, 0x98, 0x14, 0x98, 0x35, 0xb8, - 0x8d, 0xa4, 0xd0, 0x74, 0x23, 0xa9, 0x72, 0x52, 0x06, 0x19, 0xf1, 0xea, 0x9e, 0xbc, 0x34, 0xb2, - 0xb3, 0xe2, 0x73, 0x32, 0x8b, 0x4b, 0x74, 0xf2, 0x73, 0x33, 0x4b, 0x52, 0x73, 0x0b, 0x4a, 0x2a, - 0x83, 0xd0, 0xcd, 0x75, 0x72, 0x3d, 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, - 0xed, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xa4, 0xaa, 0x54, 0xdd, - 0xc4, 0x9c, 0x82, 0x8c, 0xc4, 0x92, 0xd4, 0x44, 0x30, 0x4f, 0xbf, 0x42, 0x1f, 0x1a, 0x08, 0x25, - 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xef, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x66, - 0x2f, 0xbd, 0xe7, 0x6b, 0x01, 0x00, 0x00, + 0x00, 0x58, 0xd2, 0x89, 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0xa8, 0x52, 0xa1, 0x6c, 0x2e, 0x41, + 0x64, 0xb3, 0xe3, 0x73, 0x32, 0x8b, 0x4b, 0x24, 0x98, 0x14, 0x98, 0x35, 0xb8, 0x8d, 0xa4, 0xd0, + 0xf4, 0x3b, 0x81, 0xd5, 0x39, 0x83, 0x94, 0x39, 0x29, 0x83, 0x0c, 0x79, 0x75, 0x4f, 0x5e, 0x1a, + 0x43, 0xb3, 0x4e, 0x7e, 0x6e, 0x66, 0x49, 0x6a, 0x6e, 0x41, 0x49, 0x65, 0x10, 0x7f, 0x12, 0x42, + 0x87, 0x4f, 0x66, 0x71, 0x89, 0x93, 0xeb, 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, 0x69, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x27, 0x55, 0xa5, + 0xea, 0x26, 0xe6, 0x14, 0x64, 0x24, 0x96, 0xa4, 0x26, 0x82, 0x79, 0xfa, 0x15, 0xfa, 0xd0, 0x60, + 0x28, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x07, 0x80, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, + 0xa3, 0x3c, 0x7a, 0x41, 0x6d, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/cointrunk/types/genesis.pb.go b/x/cointrunk/types/genesis.pb.go index beebebab..a4533665 100644 --- a/x/cointrunk/types/genesis.pb.go +++ b/x/cointrunk/types/genesis.pb.go @@ -26,10 +26,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the cointrunk module's genesis state. type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - PublisherList []Publisher `protobuf:"bytes,2,rep,name=PublisherList,proto3" json:"publisher_list,omitempty"` - AcceptedDomainList []AcceptedDomain `protobuf:"bytes,3,rep,name=AcceptedDomainList,proto3" json:"accepted_domain_list,omitempty"` - ArticleList []Article `protobuf:"bytes,4,rep,name=ArticleList,proto3" json:"article_list,omitempty"` - ArticlesCounter uint64 `protobuf:"varint,5,opt,name=articlesCounter,proto3" json:"articles_counter,omitempty"` + PublisherList []Publisher `protobuf:"bytes,2,rep,name=publisher_list,json=publisherList,proto3" json:"publishers_list,omitempty"` + AcceptedDomainList []AcceptedDomain `protobuf:"bytes,3,rep,name=accepted_domain_list,json=acceptedDomainList,proto3" json:"accepted_domain_list,omitempty"` + ArticleList []Article `protobuf:"bytes,4,rep,name=article_list,json=articleList,proto3" json:"article_list,omitempty"` + ArticlesCounter uint64 `protobuf:"varint,5,opt,name=articles_counter,json=articlesCounter,proto3" json:"articles_counter,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -107,32 +107,32 @@ func init() { func init() { proto.RegisterFile("cointrunk/genesis.proto", fileDescriptor_20104b77ac07c6a4) } var fileDescriptor_20104b77ac07c6a4 = []byte{ - // 386 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0x6e, 0xaa, 0x40, - 0x14, 0x86, 0xe1, 0xea, 0x75, 0x81, 0xf7, 0xe6, 0xde, 0x90, 0xc6, 0x22, 0x4d, 0x06, 0xd2, 0x45, - 0xe3, 0xa2, 0x85, 0xd4, 0x26, 0xdd, 0x4b, 0x9b, 0xd4, 0x45, 0x17, 0xc6, 0xee, 0xda, 0x85, 0x19, - 0x70, 0x82, 0x93, 0x02, 0x43, 0xe0, 0xd0, 0xa8, 0x4f, 0xd1, 0xc7, 0x72, 0xd1, 0x85, 0xcb, 0xae, - 0x4c, 0xa3, 0x3b, 0x9f, 0xa2, 0x71, 0x18, 0x15, 0xa9, 0x3b, 0x98, 0xff, 0x3f, 0xff, 0x77, 0xce, - 0xc9, 0x51, 0x4e, 0x3d, 0x46, 0x23, 0x48, 0xb2, 0xe8, 0xd5, 0xf6, 0x49, 0x44, 0x52, 0x9a, 0x5a, - 0x71, 0xc2, 0x80, 0xa9, 0xff, 0xdd, 0x29, 0xb1, 0x76, 0xa2, 0xf5, 0x76, 0xad, 0x9f, 0xf8, 0xcc, - 0x67, 0x5c, 0xb4, 0x37, 0x5f, 0xb9, 0x4f, 0x6f, 0xec, 0x03, 0x62, 0x9c, 0xe0, 0x50, 0xd4, 0xeb, - 0xcd, 0xc2, 0x7b, 0xe6, 0x06, 0x34, 0x1d, 0x91, 0x44, 0x48, 0xc6, 0x5e, 0xc2, 0x9e, 0x47, 0x62, - 0x20, 0xc3, 0xc1, 0x90, 0x85, 0x98, 0x46, 0xc2, 0x50, 0x68, 0x0a, 0x27, 0x40, 0xbd, 0x80, 0xe4, - 0xc2, 0xf9, 0x47, 0x45, 0xf9, 0xf3, 0x90, 0xb7, 0xf9, 0x04, 0x18, 0x88, 0x7a, 0xab, 0xd4, 0x72, - 0xaa, 0x26, 0x9b, 0x72, 0xab, 0xde, 0xd6, 0xac, 0x72, 0xdb, 0x56, 0x8f, 0xeb, 0x4e, 0x75, 0xb6, - 0x30, 0xa4, 0xbe, 0x70, 0xab, 0x9e, 0xf2, 0xb7, 0xb7, 0xed, 0xea, 0x91, 0xa6, 0xa0, 0xfd, 0x32, - 0x2b, 0xad, 0x7a, 0xfb, 0xec, 0x48, 0xf9, 0xd6, 0xe6, 0x98, 0x9b, 0x84, 0xf5, 0xc2, 0xd0, 0x76, - 0xf3, 0x0c, 0x02, 0x9a, 0xc2, 0x25, 0x0b, 0x29, 0x90, 0x30, 0x86, 0x49, 0xff, 0x30, 0x53, 0x1d, - 0x2b, 0x6a, 0x47, 0xcc, 0x77, 0xcf, 0xc7, 0xe3, 0xa4, 0x0a, 0x27, 0x99, 0x3f, 0x49, 0x87, 0x5e, - 0xe7, 0x42, 0xe0, 0x50, 0x69, 0x47, 0x65, 0xe8, 0x11, 0x86, 0xfa, 0xa2, 0xd4, 0x3b, 0xf9, 0xe2, - 0x38, 0xb2, 0xca, 0x91, 0xcd, 0x23, 0xc8, 0xdc, 0xe4, 0x20, 0xc1, 0x6a, 0x88, 0x75, 0x97, 0x19, - 0xc5, 0x34, 0xb5, 0xab, 0xfc, 0x13, 0xb6, 0xf4, 0x8e, 0x65, 0x11, 0x90, 0x44, 0xfb, 0x6d, 0xca, - 0xad, 0xaa, 0x83, 0xd6, 0x0b, 0x43, 0xdf, 0x4a, 0x03, 0x2f, 0xd7, 0x0a, 0x29, 0xe5, 0x32, 0xa7, - 0x3b, 0x5b, 0x22, 0x79, 0xbe, 0x44, 0xf2, 0xd7, 0x12, 0xc9, 0xef, 0x2b, 0x24, 0xcd, 0x57, 0x48, - 0xfa, 0x5c, 0x21, 0xe9, 0xd9, 0xf2, 0x29, 0x8c, 0x32, 0xd7, 0xf2, 0x58, 0x68, 0xbb, 0x53, 0x72, - 0x85, 0x83, 0x78, 0x84, 0x81, 0x60, 0xfe, 0x67, 0x8f, 0xed, 0xfd, 0x81, 0xc0, 0x24, 0x26, 0xa9, - 0x5b, 0xe3, 0xf7, 0x71, 0xf3, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x42, 0x26, 0xf9, 0xcf, 0x02, - 0x00, 0x00, + // 391 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x41, 0x4f, 0xe2, 0x40, + 0x18, 0x86, 0xdb, 0x85, 0xe5, 0x50, 0xd8, 0x5d, 0xd2, 0x10, 0xb6, 0x74, 0x93, 0x69, 0xd7, 0x83, + 0xe1, 0xa0, 0x6d, 0xc4, 0xc4, 0xbb, 0xd5, 0x44, 0x4d, 0x3c, 0x18, 0xbc, 0x19, 0x13, 0x32, 0x2d, + 0x93, 0x32, 0xb1, 0xed, 0x34, 0x9d, 0xa9, 0x11, 0x7e, 0x85, 0x3f, 0x8b, 0x23, 0xf1, 0xe4, 0x89, + 0x18, 0xb8, 0xf1, 0x2b, 0x0c, 0x33, 0x43, 0xa9, 0xc8, 0x8d, 0x99, 0xe7, 0x7d, 0xbf, 0xe7, 0xa3, + 0x19, 0xed, 0x6f, 0x40, 0x70, 0xc2, 0xb2, 0x3c, 0x79, 0x72, 0x43, 0x94, 0x20, 0x8a, 0xa9, 0x93, + 0x66, 0x84, 0x11, 0xbd, 0xe9, 0x4f, 0x90, 0x53, 0x40, 0xe7, 0xf9, 0xc4, 0x6c, 0x85, 0x24, 0x24, + 0x1c, 0xba, 0xeb, 0x5f, 0x22, 0x67, 0xb6, 0xb7, 0x03, 0x52, 0x98, 0xc1, 0x58, 0xf6, 0xcd, 0x4e, + 0xe9, 0x3e, 0xf7, 0x23, 0x4c, 0x47, 0x28, 0x93, 0xc8, 0xda, 0x22, 0x18, 0x04, 0x28, 0x65, 0x68, + 0x38, 0x18, 0x92, 0x18, 0xe2, 0x44, 0x06, 0x4a, 0x4b, 0xc1, 0x8c, 0xe1, 0x20, 0x42, 0x02, 0x1c, + 0xbc, 0x55, 0xb4, 0xc6, 0x95, 0x58, 0xf3, 0x9e, 0x41, 0x86, 0xf4, 0x33, 0xad, 0x26, 0xac, 0x86, + 0x6a, 0xab, 0xdd, 0x7a, 0xcf, 0x70, 0x76, 0xd7, 0x76, 0xee, 0x38, 0xf7, 0xaa, 0xd3, 0xb9, 0xa5, + 0xf4, 0x65, 0x5a, 0x47, 0xda, 0xef, 0x62, 0xab, 0x41, 0x84, 0x29, 0x33, 0x7e, 0xd8, 0x95, 0x6e, + 0xbd, 0xf7, 0x6f, 0x4f, 0x7f, 0x93, 0xf3, 0xfe, 0xaf, 0x47, 0xac, 0xe6, 0x56, 0xa7, 0xa8, 0x52, + 0xde, 0x3d, 0x22, 0x31, 0x66, 0x28, 0x4e, 0xd9, 0xb8, 0xff, 0xab, 0x40, 0xb7, 0x98, 0x32, 0x7d, + 0xa2, 0xb5, 0x76, 0xfe, 0xa1, 0x90, 0x55, 0xb8, 0xcc, 0xfe, 0x2e, 0x3b, 0x97, 0xe9, 0x4b, 0x1e, + 0xf6, 0x0e, 0xa5, 0x11, 0xec, 0x9b, 0x52, 0xd2, 0xea, 0xf0, 0x4b, 0x8f, 0xbb, 0x1f, 0xb5, 0x86, + 0xfc, 0x78, 0xc2, 0x59, 0xe5, 0xce, 0xce, 0x1e, 0xa7, 0x48, 0x79, 0x40, 0xca, 0xda, 0xe5, 0x5a, + 0x49, 0x52, 0x97, 0xf7, 0x7c, 0xfa, 0x8d, 0xd6, 0x94, 0x47, 0x3a, 0x08, 0x48, 0x9e, 0x30, 0x94, + 0x19, 0x3f, 0x6d, 0xb5, 0x5b, 0xf5, 0xc0, 0x6a, 0x6e, 0x99, 0xbb, 0xac, 0x34, 0xe6, 0xcf, 0x86, + 0x5d, 0x08, 0xe4, 0x5d, 0x4f, 0x17, 0x40, 0x9d, 0x2d, 0x80, 0xfa, 0xb1, 0x00, 0xea, 0xeb, 0x12, + 0x28, 0xb3, 0x25, 0x50, 0xde, 0x97, 0x40, 0x79, 0x70, 0x42, 0xcc, 0x46, 0xb9, 0xef, 0x04, 0x24, + 0x76, 0xfd, 0x09, 0x3a, 0x86, 0x51, 0x3a, 0x82, 0x0c, 0x41, 0x7e, 0x72, 0x5f, 0xdc, 0xed, 0x33, + 0x61, 0xe3, 0x14, 0x51, 0xbf, 0xc6, 0x5f, 0xc9, 0xe9, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4f, + 0x91, 0xaa, 0xd2, 0xd5, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/cointrunk/types/params.pb.go b/x/cointrunk/types/params.pb.go index 63c7173a..8f109489 100644 --- a/x/cointrunk/types/params.pb.go +++ b/x/cointrunk/types/params.pb.go @@ -72,9 +72,9 @@ func (m *PublisherRespectParams) GetDenom() string { } type Params struct { - AnonArticleLimit uint64 `protobuf:"varint,1,opt,name=anonArticleLimit,proto3" json:"anonArticleLimit,omitempty" yaml:"anon_article_limit"` - AnonArticleCost types.Coin `protobuf:"bytes,2,opt,name=anonArticleCost,proto3" json:"anon_article_cost,omitempty" yaml:"anon_article_cost"` - PublisherRespectParams PublisherRespectParams `protobuf:"bytes,3,opt,name=publisherRespectParams,proto3" json:"publisher_respect,omitempty" yaml:"publisher_respect"` + AnonArticleLimit uint64 `protobuf:"varint,1,opt,name=anon_article_limit,json=anonArticleLimit,proto3" json:"anon_article_limit,omitempty" yaml:"anon_article_limit"` + AnonArticleCost types.Coin `protobuf:"bytes,2,opt,name=anon_article_cost,json=anonArticleCost,proto3" json:"anon_article_cost,omitempty" yaml:"anon_article_cost"` + PublisherRespectParams PublisherRespectParams `protobuf:"bytes,3,opt,name=publisher_respect_params,json=publisherRespectParams,proto3" json:"publisher_respect,omitempty" yaml:"publisher_respect"` } func (m *Params) Reset() { *m = Params{} } @@ -138,35 +138,35 @@ func init() { func init() { proto.RegisterFile("cointrunk/params.proto", fileDescriptor_f29b1ecdb66bf452) } var fileDescriptor_f29b1ecdb66bf452 = []byte{ - // 435 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x31, 0x6b, 0xdc, 0x30, - 0x14, 0xc7, 0xad, 0x5e, 0x12, 0xa8, 0x5a, 0xe8, 0x61, 0xca, 0xe1, 0xa4, 0xd4, 0x0a, 0x1a, 0xc2, - 0x0d, 0x8d, 0xc4, 0xb5, 0x5b, 0x28, 0x94, 0x3a, 0x1d, 0x5a, 0x28, 0x25, 0x78, 0xec, 0x72, 0xc8, - 0x8e, 0xb8, 0x13, 0xb1, 0x2c, 0x63, 0xe9, 0xc2, 0x5d, 0xe6, 0x7c, 0x80, 0x8c, 0x1d, 0xdb, 0x6f, - 0x93, 0x31, 0x63, 0xe9, 0x60, 0xca, 0xdd, 0xd6, 0xd1, 0x9f, 0xa0, 0x48, 0x3a, 0x92, 0x34, 0xe7, - 0x4e, 0xb6, 0xf4, 0x7e, 0xef, 0xbd, 0xbf, 0xde, 0xfb, 0xc3, 0x41, 0xae, 0x44, 0x69, 0xea, 0x59, - 0x79, 0x46, 0x2b, 0x56, 0x33, 0xa9, 0x49, 0x55, 0x2b, 0xa3, 0xc2, 0x7e, 0x76, 0xc1, 0xc9, 0x6d, - 0x8c, 0x9c, 0x8f, 0xf6, 0x9e, 0x4f, 0xd4, 0x44, 0xb9, 0x20, 0xb5, 0x7f, 0x9e, 0xdb, 0x8b, 0x73, - 0xa5, 0xa5, 0xd2, 0x34, 0x63, 0x9a, 0xd3, 0xf3, 0x51, 0xc6, 0x0d, 0x1b, 0x51, 0x9b, 0xe7, 0xe3, - 0xf8, 0x0a, 0xc0, 0xc1, 0xc9, 0x2c, 0x2b, 0x84, 0x9e, 0xf2, 0x3a, 0xe5, 0xba, 0xe2, 0xb9, 0x39, - 0x71, 0x8d, 0xc2, 0x2f, 0xb0, 0x67, 0xd8, 0x3c, 0x02, 0xfb, 0x60, 0xf8, 0x38, 0x79, 0x7b, 0xdd, - 0xa0, 0xe0, 0x57, 0x83, 0x0e, 0x26, 0xc2, 0x4c, 0x67, 0x19, 0xc9, 0x95, 0xa4, 0xeb, 0xd2, 0xfe, - 0x73, 0xa8, 0x4f, 0xcf, 0xa8, 0x59, 0x54, 0x5c, 0x93, 0x0f, 0x3c, 0x6f, 0x1b, 0x04, 0x17, 0x4c, - 0x16, 0x47, 0xd8, 0xb0, 0x39, 0x4e, 0x6d, 0xa1, 0xf0, 0x00, 0x6e, 0x9f, 0xf2, 0x52, 0xc9, 0x68, - 0xdb, 0x55, 0xec, 0xb7, 0x0d, 0x7a, 0xea, 0x19, 0x77, 0x8d, 0x53, 0x1f, 0xc6, 0x97, 0x3d, 0xb8, - 0xb3, 0x96, 0xf0, 0x09, 0xf6, 0x59, 0xa9, 0xca, 0xf7, 0xb5, 0x11, 0x79, 0xc1, 0x3f, 0x0b, 0x29, - 0x8c, 0xd3, 0xb3, 0x95, 0xbc, 0x6c, 0x1b, 0xb4, 0xeb, 0xb3, 0x2d, 0x31, 0x66, 0x1e, 0x19, 0x17, - 0x96, 0xc1, 0xe9, 0x46, 0x5a, 0x78, 0x09, 0xe0, 0xb3, 0x7b, 0x97, 0xc7, 0x4a, 0x9b, 0xe8, 0xd1, - 0x3e, 0x18, 0x3e, 0x79, 0xbd, 0x4b, 0xfc, 0x0b, 0x88, 0x9d, 0x11, 0x59, 0xcf, 0x88, 0x1c, 0x2b, - 0x51, 0x26, 0xef, 0xec, 0xab, 0xff, 0x34, 0xe8, 0xc5, 0x3f, 0x3d, 0x72, 0xa5, 0xcd, 0x2b, 0x25, - 0x85, 0xe1, 0xb2, 0x32, 0x8b, 0xb6, 0x41, 0x51, 0x87, 0x10, 0x0b, 0xe1, 0xf4, 0x61, 0xcb, 0xf0, - 0x07, 0x80, 0x83, 0xaa, 0x73, 0xde, 0x51, 0xcf, 0xa9, 0x19, 0x92, 0x87, 0x9b, 0x25, 0xdd, 0xfb, - 0xb9, 0x13, 0x77, 0x5b, 0x6f, 0x5c, 0x7b, 0xa0, 0x4b, 0xdc, 0x06, 0x84, 0xd3, 0xff, 0x08, 0x39, - 0xda, 0xfa, 0xf6, 0x1d, 0x05, 0xc9, 0xc7, 0xeb, 0x65, 0x0c, 0x6e, 0x96, 0x31, 0xf8, 0xbd, 0x8c, - 0xc1, 0xd5, 0x2a, 0x0e, 0x6e, 0x56, 0x71, 0xf0, 0x73, 0x15, 0x07, 0x5f, 0xc9, 0x3d, 0x0f, 0x64, - 0x17, 0xfc, 0x90, 0x15, 0xd5, 0x94, 0x19, 0xce, 0xdc, 0x89, 0xce, 0xe9, 0x9d, 0x65, 0x9d, 0x1f, - 0xb2, 0x1d, 0x67, 0xb5, 0x37, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x1e, 0x82, 0x0e, 0x47, 0xcc, - 0x02, 0x00, 0x00, + // 442 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0x31, 0x6f, 0x13, 0x31, + 0x14, 0x3e, 0x93, 0xb6, 0x12, 0x06, 0x89, 0x70, 0x42, 0xd1, 0xb5, 0x88, 0x73, 0xe5, 0xa1, 0xca, + 0x40, 0x6d, 0x05, 0xb6, 0x0a, 0x09, 0x91, 0x32, 0x20, 0x81, 0x50, 0x75, 0x23, 0x4b, 0xe4, 0xbb, + 0x5a, 0x89, 0xd5, 0xf3, 0xd9, 0x3a, 0x3b, 0x55, 0xd2, 0x1f, 0xc0, 0xc0, 0xd4, 0x91, 0x11, 0x89, + 0x3f, 0xd3, 0xb1, 0x23, 0x62, 0x38, 0xa1, 0x64, 0x63, 0xcc, 0x2f, 0x40, 0xb6, 0x03, 0x2d, 0xcd, + 0x4d, 0x77, 0xf7, 0xde, 0xf7, 0xbe, 0xfb, 0xde, 0xf7, 0x3e, 0xd8, 0x2b, 0x94, 0xa8, 0x6c, 0x3d, + 0xad, 0xce, 0xa8, 0x66, 0x35, 0x93, 0x86, 0xe8, 0x5a, 0x59, 0x15, 0x77, 0xf3, 0x0b, 0x4e, 0xfe, + 0xf5, 0xc8, 0xf9, 0x60, 0xef, 0xc9, 0x58, 0x8d, 0x95, 0x6f, 0x52, 0xf7, 0x16, 0x70, 0x7b, 0x69, + 0xa1, 0x8c, 0x54, 0x86, 0xe6, 0xcc, 0x70, 0x7a, 0x3e, 0xc8, 0xb9, 0x65, 0x03, 0xea, 0xe6, 0x42, + 0x1f, 0x5f, 0x02, 0xd8, 0x3b, 0x99, 0xe6, 0xa5, 0x30, 0x13, 0x5e, 0x67, 0xdc, 0x68, 0x5e, 0xd8, + 0x13, 0xff, 0xa3, 0xf8, 0x23, 0xec, 0x58, 0x36, 0x4b, 0xc0, 0x3e, 0xe8, 0xdf, 0x1f, 0xbe, 0xba, + 0x6a, 0x50, 0xf4, 0xb3, 0x41, 0x07, 0x63, 0x61, 0x27, 0xd3, 0x9c, 0x14, 0x4a, 0xd2, 0x35, 0x75, + 0x78, 0x1c, 0x9a, 0xd3, 0x33, 0x6a, 0xe7, 0x9a, 0x1b, 0xf2, 0x96, 0x17, 0xab, 0x06, 0xc1, 0x39, + 0x93, 0xe5, 0x11, 0xb6, 0x6c, 0x86, 0x33, 0x47, 0x14, 0x1f, 0xc0, 0xed, 0x53, 0x5e, 0x29, 0x99, + 0x6c, 0x7b, 0xc6, 0xee, 0xaa, 0x41, 0x0f, 0x03, 0xc6, 0x97, 0x71, 0x16, 0xda, 0xf8, 0x4b, 0x07, + 0xee, 0xac, 0x25, 0xbc, 0x87, 0x31, 0xab, 0x54, 0x35, 0x62, 0xb5, 0x15, 0x45, 0xc9, 0x47, 0xa5, + 0x90, 0xc2, 0x7a, 0x45, 0x5b, 0xc3, 0x67, 0xab, 0x06, 0xed, 0x86, 0xf9, 0x4d, 0x0c, 0xce, 0xba, + 0xae, 0xf8, 0x26, 0xd4, 0x3e, 0xb8, 0x52, 0xfc, 0x19, 0xc0, 0xc7, 0xff, 0x21, 0x0b, 0x65, 0x6c, + 0x72, 0x6f, 0x1f, 0xf4, 0x1f, 0xbc, 0xd8, 0x25, 0x61, 0x0b, 0xe2, 0x7c, 0x22, 0x6b, 0x9f, 0xc8, + 0xb1, 0x12, 0xd5, 0xf0, 0xb5, 0xdb, 0xfc, 0x77, 0x83, 0x9e, 0x6e, 0xcc, 0x3e, 0x57, 0x52, 0x58, + 0x2e, 0xb5, 0x9d, 0xaf, 0x1a, 0x94, 0xb4, 0x48, 0x71, 0x20, 0x9c, 0x3d, 0xba, 0xa5, 0xe4, 0x58, + 0x19, 0x1b, 0x7f, 0x07, 0x30, 0xd1, 0x7f, 0x3d, 0x1f, 0xd5, 0xc1, 0xf4, 0x51, 0x38, 0x6f, 0xd2, + 0xf1, 0x7a, 0xfa, 0xe4, 0xee, 0x7d, 0x49, 0xfb, 0x95, 0x6e, 0xe4, 0x6d, 0x30, 0xb6, 0xc9, 0xdb, + 0x00, 0xe1, 0xac, 0xa7, 0x5b, 0x89, 0x8f, 0xb6, 0xbe, 0x7e, 0x43, 0xd1, 0xf0, 0xdd, 0xd5, 0x22, + 0x05, 0xd7, 0x8b, 0x14, 0xfc, 0x5a, 0xa4, 0xe0, 0x72, 0x99, 0x46, 0xd7, 0xcb, 0x34, 0xfa, 0xb1, + 0x4c, 0xa3, 0x4f, 0xe4, 0x56, 0x12, 0xf2, 0x0b, 0x7e, 0xc8, 0x4a, 0x3d, 0x61, 0x96, 0x33, 0xff, + 0x45, 0x67, 0xf4, 0x26, 0xb8, 0x3e, 0x15, 0xf9, 0x8e, 0x0f, 0xdc, 0xcb, 0x3f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xd1, 0x68, 0x88, 0x6c, 0xd2, 0x02, 0x00, 0x00, } func (m *PublisherRespectParams) Marshal() (dAtA []byte, err error) { From ceb7f97d9336cd89d9e9e66eeea1b035dfe22a51 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Wed, 28 Dec 2022 18:03:27 +0200 Subject: [PATCH 47/54] use cointrunk params to respect tax and accepted denom --- docs/static/openapi.yml | 18 +-- go.mod | 3 - go.sum | 5 - .../module/types/burner/genesis.ts | 34 ++--- .../bze/bze.cointrunk.v1/module/rest.ts | 6 +- .../module/types/cointrunk/genesis.ts | 126 +++++++++--------- .../module/types/cointrunk/params.ts | 94 ++++++------- .../bze-alphateam/bze/bze.scavenge/index.ts | 40 +++--- .../bze/bze.scavenge/module/index.ts | 6 +- .../msg_server_pay_publisher_respect.go | 24 +++- x/cointrunk/types/params.go | 2 +- 11 files changed, 181 insertions(+), 177 deletions(-) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 0cc70b84..85256d18 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -558,10 +558,10 @@ paths: description: params holds all the parameters of this module. type: object properties: - anonArticleLimit: + anon_article_limit: type: string format: uint64 - anonArticleCost: + anon_article_cost: type: object properties: denom: @@ -576,7 +576,7 @@ paths: custom method signatures required by gogoproto. - publisherRespectParams: + publisher_respect_params: type: object properties: tax: @@ -32727,10 +32727,10 @@ definitions: bze.cointrunk.v1.Params: type: object properties: - anonArticleLimit: + anon_article_limit: type: string format: uint64 - anonArticleCost: + anon_article_cost: type: object properties: denom: @@ -32742,7 +32742,7 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. - publisherRespectParams: + publisher_respect_params: type: object properties: tax: @@ -32907,10 +32907,10 @@ definitions: description: params holds all the parameters of this module. type: object properties: - anonArticleLimit: + anon_article_limit: type: string format: uint64 - anonArticleCost: + anon_article_cost: type: object properties: denom: @@ -32925,7 +32925,7 @@ definitions: method signatures required by gogoproto. - publisherRespectParams: + publisher_respect_params: type: object properties: tax: diff --git a/go.mod b/go.mod index 95260012..f108c1ed 100644 --- a/go.mod +++ b/go.mod @@ -54,13 +54,11 @@ require ( github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.4 // 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.5.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect - github.com/golang/glog v1.0.0 // indirect github.com/golang/snappy v0.0.3 // indirect github.com/google/btree v1.0.0 // indirect github.com/google/go-cmp v0.5.9 // indirect @@ -69,7 +67,6 @@ require ( github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect diff --git a/go.sum b/go.sum index 81fcb86a..f174aa5f 100644 --- a/go.sum +++ b/go.sum @@ -528,7 +528,6 @@ github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASx github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -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= @@ -634,8 +633,6 @@ github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/ github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -793,8 +790,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= 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.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/genesis.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/genesis.ts index 56ea66b9..41869d92 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/genesis.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/genesis.ts @@ -9,7 +9,7 @@ export const protobufPackage = "bze.burner.v1"; export interface GenesisState { params: Params | undefined; /** this line is used by starport scaffolding # genesis/proto/state */ - BurnedCoinsList: BurnedCoins[]; + burned_coins_list: BurnedCoins[]; } const baseGenesisState: object = {}; @@ -19,7 +19,7 @@ export const GenesisState = { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } - for (const v of message.BurnedCoinsList) { + for (const v of message.burned_coins_list) { BurnedCoins.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; @@ -29,7 +29,7 @@ export const GenesisState = { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseGenesisState } as GenesisState; - message.BurnedCoinsList = []; + message.burned_coins_list = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -37,7 +37,7 @@ export const GenesisState = { message.params = Params.decode(reader, reader.uint32()); break; case 2: - message.BurnedCoinsList.push( + message.burned_coins_list.push( BurnedCoins.decode(reader, reader.uint32()) ); break; @@ -51,18 +51,18 @@ export const GenesisState = { fromJSON(object: any): GenesisState { const message = { ...baseGenesisState } as GenesisState; - message.BurnedCoinsList = []; + message.burned_coins_list = []; if (object.params !== undefined && object.params !== null) { message.params = Params.fromJSON(object.params); } else { message.params = undefined; } if ( - object.BurnedCoinsList !== undefined && - object.BurnedCoinsList !== null + object.burned_coins_list !== undefined && + object.burned_coins_list !== null ) { - for (const e of object.BurnedCoinsList) { - message.BurnedCoinsList.push(BurnedCoins.fromJSON(e)); + for (const e of object.burned_coins_list) { + message.burned_coins_list.push(BurnedCoins.fromJSON(e)); } } return message; @@ -72,30 +72,30 @@ export const GenesisState = { const obj: any = {}; message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - if (message.BurnedCoinsList) { - obj.BurnedCoinsList = message.BurnedCoinsList.map((e) => + if (message.burned_coins_list) { + obj.burned_coins_list = message.burned_coins_list.map((e) => e ? BurnedCoins.toJSON(e) : undefined ); } else { - obj.BurnedCoinsList = []; + obj.burned_coins_list = []; } return obj; }, fromPartial(object: DeepPartial): GenesisState { const message = { ...baseGenesisState } as GenesisState; - message.BurnedCoinsList = []; + message.burned_coins_list = []; if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); } else { message.params = undefined; } if ( - object.BurnedCoinsList !== undefined && - object.BurnedCoinsList !== null + object.burned_coins_list !== undefined && + object.burned_coins_list !== null ) { - for (const e of object.BurnedCoinsList) { - message.BurnedCoinsList.push(BurnedCoins.fromPartial(e)); + for (const e of object.burned_coins_list) { + message.burned_coins_list.push(BurnedCoins.fromPartial(e)); } } return message; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts index f099e945..652de616 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts @@ -60,7 +60,7 @@ export interface V1MsgPayPublisherRespectResponse { export interface V1Params { /** @format uint64 */ - anonArticleLimit?: string; + anon_article_limit?: string; /** * Coin defines a token with a denomination and an amount. @@ -68,10 +68,10 @@ export interface V1Params { * NOTE: The amount field is an Int which implements the custom method * signatures required by gogoproto. */ - anonArticleCost?: V1Beta1Coin; + anon_article_cost?: V1Beta1Coin; /** Params defines the parameters for the module. */ - publisherRespectParams?: V1PublisherRespectParams; + publisher_respect_params?: V1PublisherRespectParams; } export interface V1Publisher { diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/genesis.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/genesis.ts index 283c83b6..f4bd4fc3 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/genesis.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/genesis.ts @@ -11,31 +11,31 @@ export const protobufPackage = "bze.cointrunk.v1"; /** GenesisState defines the cointrunk module's genesis state. */ export interface GenesisState { params: Params | undefined; - PublisherList: Publisher[]; - AcceptedDomainList: AcceptedDomain[]; - ArticleList: Article[]; + publisher_list: Publisher[]; + accepted_domain_list: AcceptedDomain[]; + article_list: Article[]; /** this line is used by starport scaffolding # genesis/proto/state */ - articlesCounter: number; + articles_counter: number; } -const baseGenesisState: object = { articlesCounter: 0 }; +const baseGenesisState: object = { articles_counter: 0 }; export const GenesisState = { encode(message: GenesisState, writer: Writer = Writer.create()): Writer { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } - for (const v of message.PublisherList) { + for (const v of message.publisher_list) { Publisher.encode(v!, writer.uint32(18).fork()).ldelim(); } - for (const v of message.AcceptedDomainList) { + for (const v of message.accepted_domain_list) { AcceptedDomain.encode(v!, writer.uint32(26).fork()).ldelim(); } - for (const v of message.ArticleList) { + for (const v of message.article_list) { Article.encode(v!, writer.uint32(34).fork()).ldelim(); } - if (message.articlesCounter !== 0) { - writer.uint32(40).uint64(message.articlesCounter); + if (message.articles_counter !== 0) { + writer.uint32(40).uint64(message.articles_counter); } return writer; }, @@ -44,9 +44,9 @@ export const GenesisState = { const reader = input instanceof Uint8Array ? new Reader(input) : input; let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseGenesisState } as GenesisState; - message.PublisherList = []; - message.AcceptedDomainList = []; - message.ArticleList = []; + message.publisher_list = []; + message.accepted_domain_list = []; + message.article_list = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -54,18 +54,20 @@ export const GenesisState = { message.params = Params.decode(reader, reader.uint32()); break; case 2: - message.PublisherList.push(Publisher.decode(reader, reader.uint32())); + message.publisher_list.push( + Publisher.decode(reader, reader.uint32()) + ); break; case 3: - message.AcceptedDomainList.push( + message.accepted_domain_list.push( AcceptedDomain.decode(reader, reader.uint32()) ); break; case 4: - message.ArticleList.push(Article.decode(reader, reader.uint32())); + message.article_list.push(Article.decode(reader, reader.uint32())); break; case 5: - message.articlesCounter = longToNumber(reader.uint64() as Long); + message.articles_counter = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -77,39 +79,39 @@ export const GenesisState = { fromJSON(object: any): GenesisState { const message = { ...baseGenesisState } as GenesisState; - message.PublisherList = []; - message.AcceptedDomainList = []; - message.ArticleList = []; + message.publisher_list = []; + message.accepted_domain_list = []; + message.article_list = []; if (object.params !== undefined && object.params !== null) { message.params = Params.fromJSON(object.params); } else { message.params = undefined; } - if (object.PublisherList !== undefined && object.PublisherList !== null) { - for (const e of object.PublisherList) { - message.PublisherList.push(Publisher.fromJSON(e)); + if (object.publisher_list !== undefined && object.publisher_list !== null) { + for (const e of object.publisher_list) { + message.publisher_list.push(Publisher.fromJSON(e)); } } if ( - object.AcceptedDomainList !== undefined && - object.AcceptedDomainList !== null + object.accepted_domain_list !== undefined && + object.accepted_domain_list !== null ) { - for (const e of object.AcceptedDomainList) { - message.AcceptedDomainList.push(AcceptedDomain.fromJSON(e)); + for (const e of object.accepted_domain_list) { + message.accepted_domain_list.push(AcceptedDomain.fromJSON(e)); } } - if (object.ArticleList !== undefined && object.ArticleList !== null) { - for (const e of object.ArticleList) { - message.ArticleList.push(Article.fromJSON(e)); + if (object.article_list !== undefined && object.article_list !== null) { + for (const e of object.article_list) { + message.article_list.push(Article.fromJSON(e)); } } if ( - object.articlesCounter !== undefined && - object.articlesCounter !== null + object.articles_counter !== undefined && + object.articles_counter !== null ) { - message.articlesCounter = Number(object.articlesCounter); + message.articles_counter = Number(object.articles_counter); } else { - message.articlesCounter = 0; + message.articles_counter = 0; } return message; }, @@ -118,67 +120,67 @@ export const GenesisState = { const obj: any = {}; message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - if (message.PublisherList) { - obj.PublisherList = message.PublisherList.map((e) => + if (message.publisher_list) { + obj.publisher_list = message.publisher_list.map((e) => e ? Publisher.toJSON(e) : undefined ); } else { - obj.PublisherList = []; + obj.publisher_list = []; } - if (message.AcceptedDomainList) { - obj.AcceptedDomainList = message.AcceptedDomainList.map((e) => + if (message.accepted_domain_list) { + obj.accepted_domain_list = message.accepted_domain_list.map((e) => e ? AcceptedDomain.toJSON(e) : undefined ); } else { - obj.AcceptedDomainList = []; + obj.accepted_domain_list = []; } - if (message.ArticleList) { - obj.ArticleList = message.ArticleList.map((e) => + if (message.article_list) { + obj.article_list = message.article_list.map((e) => e ? Article.toJSON(e) : undefined ); } else { - obj.ArticleList = []; + obj.article_list = []; } - message.articlesCounter !== undefined && - (obj.articlesCounter = message.articlesCounter); + message.articles_counter !== undefined && + (obj.articles_counter = message.articles_counter); return obj; }, fromPartial(object: DeepPartial): GenesisState { const message = { ...baseGenesisState } as GenesisState; - message.PublisherList = []; - message.AcceptedDomainList = []; - message.ArticleList = []; + message.publisher_list = []; + message.accepted_domain_list = []; + message.article_list = []; if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); } else { message.params = undefined; } - if (object.PublisherList !== undefined && object.PublisherList !== null) { - for (const e of object.PublisherList) { - message.PublisherList.push(Publisher.fromPartial(e)); + if (object.publisher_list !== undefined && object.publisher_list !== null) { + for (const e of object.publisher_list) { + message.publisher_list.push(Publisher.fromPartial(e)); } } if ( - object.AcceptedDomainList !== undefined && - object.AcceptedDomainList !== null + object.accepted_domain_list !== undefined && + object.accepted_domain_list !== null ) { - for (const e of object.AcceptedDomainList) { - message.AcceptedDomainList.push(AcceptedDomain.fromPartial(e)); + for (const e of object.accepted_domain_list) { + message.accepted_domain_list.push(AcceptedDomain.fromPartial(e)); } } - if (object.ArticleList !== undefined && object.ArticleList !== null) { - for (const e of object.ArticleList) { - message.ArticleList.push(Article.fromPartial(e)); + if (object.article_list !== undefined && object.article_list !== null) { + for (const e of object.article_list) { + message.article_list.push(Article.fromPartial(e)); } } if ( - object.articlesCounter !== undefined && - object.articlesCounter !== null + object.articles_counter !== undefined && + object.articles_counter !== null ) { - message.articlesCounter = object.articlesCounter; + message.articles_counter = object.articles_counter; } else { - message.articlesCounter = 0; + message.articles_counter = 0; } return message; }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/params.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/params.ts index b5a20b00..207308bb 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/params.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/params.ts @@ -12,9 +12,9 @@ export interface PublisherRespectParams { } export interface Params { - anonArticleLimit: number; - anonArticleCost: Coin | undefined; - publisherRespectParams: PublisherRespectParams | undefined; + anon_article_limit: number; + anon_article_cost: Coin | undefined; + publisher_respect_params: PublisherRespectParams | undefined; } const basePublisherRespectParams: object = { tax: "", denom: "" }; @@ -94,19 +94,19 @@ export const PublisherRespectParams = { }, }; -const baseParams: object = { anonArticleLimit: 0 }; +const baseParams: object = { anon_article_limit: 0 }; export const Params = { encode(message: Params, writer: Writer = Writer.create()): Writer { - if (message.anonArticleLimit !== 0) { - writer.uint32(8).uint64(message.anonArticleLimit); + if (message.anon_article_limit !== 0) { + writer.uint32(8).uint64(message.anon_article_limit); } - if (message.anonArticleCost !== undefined) { - Coin.encode(message.anonArticleCost, writer.uint32(18).fork()).ldelim(); + if (message.anon_article_cost !== undefined) { + Coin.encode(message.anon_article_cost, writer.uint32(18).fork()).ldelim(); } - if (message.publisherRespectParams !== undefined) { + if (message.publisher_respect_params !== undefined) { PublisherRespectParams.encode( - message.publisherRespectParams, + message.publisher_respect_params, writer.uint32(26).fork() ).ldelim(); } @@ -121,13 +121,13 @@ export const Params = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.anonArticleLimit = longToNumber(reader.uint64() as Long); + message.anon_article_limit = longToNumber(reader.uint64() as Long); break; case 2: - message.anonArticleCost = Coin.decode(reader, reader.uint32()); + message.anon_article_cost = Coin.decode(reader, reader.uint32()); break; case 3: - message.publisherRespectParams = PublisherRespectParams.decode( + message.publisher_respect_params = PublisherRespectParams.decode( reader, reader.uint32() ); @@ -143,45 +143,45 @@ export const Params = { fromJSON(object: any): Params { const message = { ...baseParams } as Params; if ( - object.anonArticleLimit !== undefined && - object.anonArticleLimit !== null + object.anon_article_limit !== undefined && + object.anon_article_limit !== null ) { - message.anonArticleLimit = Number(object.anonArticleLimit); + message.anon_article_limit = Number(object.anon_article_limit); } else { - message.anonArticleLimit = 0; + message.anon_article_limit = 0; } if ( - object.anonArticleCost !== undefined && - object.anonArticleCost !== null + object.anon_article_cost !== undefined && + object.anon_article_cost !== null ) { - message.anonArticleCost = Coin.fromJSON(object.anonArticleCost); + message.anon_article_cost = Coin.fromJSON(object.anon_article_cost); } else { - message.anonArticleCost = undefined; + message.anon_article_cost = undefined; } if ( - object.publisherRespectParams !== undefined && - object.publisherRespectParams !== null + object.publisher_respect_params !== undefined && + object.publisher_respect_params !== null ) { - message.publisherRespectParams = PublisherRespectParams.fromJSON( - object.publisherRespectParams + message.publisher_respect_params = PublisherRespectParams.fromJSON( + object.publisher_respect_params ); } else { - message.publisherRespectParams = undefined; + message.publisher_respect_params = undefined; } return message; }, toJSON(message: Params): unknown { const obj: any = {}; - message.anonArticleLimit !== undefined && - (obj.anonArticleLimit = message.anonArticleLimit); - message.anonArticleCost !== undefined && - (obj.anonArticleCost = message.anonArticleCost - ? Coin.toJSON(message.anonArticleCost) + message.anon_article_limit !== undefined && + (obj.anon_article_limit = message.anon_article_limit); + message.anon_article_cost !== undefined && + (obj.anon_article_cost = message.anon_article_cost + ? Coin.toJSON(message.anon_article_cost) : undefined); - message.publisherRespectParams !== undefined && - (obj.publisherRespectParams = message.publisherRespectParams - ? PublisherRespectParams.toJSON(message.publisherRespectParams) + message.publisher_respect_params !== undefined && + (obj.publisher_respect_params = message.publisher_respect_params + ? PublisherRespectParams.toJSON(message.publisher_respect_params) : undefined); return obj; }, @@ -189,30 +189,30 @@ export const Params = { fromPartial(object: DeepPartial): Params { const message = { ...baseParams } as Params; if ( - object.anonArticleLimit !== undefined && - object.anonArticleLimit !== null + object.anon_article_limit !== undefined && + object.anon_article_limit !== null ) { - message.anonArticleLimit = object.anonArticleLimit; + message.anon_article_limit = object.anon_article_limit; } else { - message.anonArticleLimit = 0; + message.anon_article_limit = 0; } if ( - object.anonArticleCost !== undefined && - object.anonArticleCost !== null + object.anon_article_cost !== undefined && + object.anon_article_cost !== null ) { - message.anonArticleCost = Coin.fromPartial(object.anonArticleCost); + message.anon_article_cost = Coin.fromPartial(object.anon_article_cost); } else { - message.anonArticleCost = undefined; + message.anon_article_cost = undefined; } if ( - object.publisherRespectParams !== undefined && - object.publisherRespectParams !== null + object.publisher_respect_params !== undefined && + object.publisher_respect_params !== null ) { - message.publisherRespectParams = PublisherRespectParams.fromPartial( - object.publisherRespectParams + message.publisher_respect_params = PublisherRespectParams.fromPartial( + object.publisher_respect_params ); } else { - message.publisherRespectParams = undefined; + message.publisher_respect_params = undefined; } return message; }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 474b327f..0a633940 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,6 +232,21 @@ export default { }, + async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgCommitSolution(value) + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') + }else{ + throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + } + } + }, async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -262,22 +277,20 @@ export default { } } }, - async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { + + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) const msg = await txClient.msgCommitSolution(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result + return msg } catch (e) { if (e == MissingWalletError) { throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgCommitSolution:Send Could not broadcast Tx: '+ e.message) + } else{ + throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) } } }, - async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) @@ -304,19 +317,6 @@ export default { } } }, - async MsgCommitSolution({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCommitSolution(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgCommitSolution:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgCommitSolution:Create Could not create message: ' + e.message) - } - } - }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 5f72a96b..44bd4fda 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; +import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; -import { MsgCommitSolution } from "./types/scavenge/tx"; const types = [ + ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], - ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), - msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/keeper/msg_server_pay_publisher_respect.go b/x/cointrunk/keeper/msg_server_pay_publisher_respect.go index b25b753b..cdeeec1e 100644 --- a/x/cointrunk/keeper/msg_server_pay_publisher_respect.go +++ b/x/cointrunk/keeper/msg_server_pay_publisher_respect.go @@ -15,7 +15,17 @@ func (k msgServer) PayPublisherRespect(goCtx context.Context, msg *types.MsgPayP if err != nil { return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid amount (%s)", err) } - //TODO: param to decide the denom we accept to be paid as respect + + publisherRespectParams := k.PublisherRespectParams(ctx) + if coin.Denom != publisherRespectParams.Denom { + return nil, sdkerrors.Wrapf( + sdkerrors.ErrInvalidRequest, + "invalid coin denom. Accepted (%s) got (%s)", + publisherRespectParams.Denom, + coin.Denom, + ) + } + if !coin.IsPositive() { return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid coin amount (amount should be positive)") } @@ -36,8 +46,7 @@ func (k msgServer) PayPublisherRespect(goCtx context.Context, msg *types.MsgPayP } totalAmountInt := sdk.NewInt(coin.Amount.Int64()) - //TODO: param to decide the tax % we take - taxPercent := sdk.NewDecWithPrec(20, 2) //20% + taxPercent := publisherRespectParams.Tax taxAmountDec := taxPercent.MulInt(totalAmountInt) taxAmountInt := taxAmountDec.TruncateInt() if taxAmountInt.IsNegative() { @@ -55,11 +64,12 @@ func (k msgServer) PayPublisherRespect(goCtx context.Context, msg *types.MsgPayP return nil, sdkErr } - //TODO: check the tax is > 0 taxPaidCoin := sdk.NewCoin(coin.Denom, taxAmountInt) - err = k.distrKeeper.FundCommunityPool(ctx, sdk.NewCoins(taxPaidCoin), creatorAcc) - if err != nil { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "Could not fund community pool (%s)", err) + if !taxPaidCoin.IsZero() { + err = k.distrKeeper.FundCommunityPool(ctx, sdk.NewCoins(taxPaidCoin), creatorAcc) + if err != nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "Could not fund community pool (%s)", err) + } } publisher.Respect += coin.Amount.Int64() diff --git a/x/cointrunk/types/params.go b/x/cointrunk/types/params.go index 7f67d8ed..7ddd16a6 100644 --- a/x/cointrunk/types/params.go +++ b/x/cointrunk/types/params.go @@ -28,7 +28,7 @@ var ( KeyPublisherRespectParams = []byte("PublisherRespectParams") DefaultPublisherRespectParams = PublisherRespectParams{ Denom: DefaultDenom, - Tax: sdk.NewDecWithPrec(20, 2), + Tax: sdk.NewDecWithPrec(20, 2), //20% } ) From 216c75f01a02c4d7ee62d00f6181b0cfa59a937e Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Wed, 28 Dec 2022 22:38:09 +0200 Subject: [PATCH 48/54] emit events on burner and cointrunk --- docs/static/openapi.yml | 8 +- proto/burner/events.proto | 13 + proto/cointrunk/article.proto | 2 +- proto/cointrunk/events.proto | 29 + proto/cointrunk/query.proto | 2 +- .../bze-alphateam/bze/bze.burner.v1/index.ts | 6 +- .../module/types/burner/events.ts | 151 +++ .../bze/bze.cointrunk.v1/index.ts | 44 +- .../bze/bze.cointrunk.v1/module/index.ts | 6 +- .../bze/bze.cointrunk.v1/module/rest.ts | 4 +- .../module/types/cointrunk/article.ts | 24 +- .../module/types/cointrunk/events.ts | 451 +++++++ .../module/types/cointrunk/query.ts | 2 +- .../bze-alphateam/bze/bze.scavenge/index.ts | 40 +- .../bze/bze.scavenge/module/index.ts | 6 +- x/burner/keeper/gov.go | 5 + x/burner/keeper/msg_server_fund_burner.go | 5 + x/burner/types/events.pb.go | 538 ++++++++ x/cointrunk/keeper/gov.go | 29 +- x/cointrunk/keeper/msg_server_add_article.go | 15 + x/cointrunk/types/article.pb.go | 34 +- x/cointrunk/types/events.pb.go | 1116 +++++++++++++++++ x/cointrunk/types/query.pb.go | 4 +- 23 files changed, 2449 insertions(+), 85 deletions(-) create mode 100644 proto/burner/events.proto create mode 100644 proto/cointrunk/events.proto create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/events.ts create mode 100644 vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/events.ts create mode 100644 x/burner/types/events.pb.go create mode 100644 x/cointrunk/types/events.pb.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 85256d18..af061b5a 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -411,7 +411,7 @@ paths: - Query /bze/cointrunk/v1/articles: get: - summary: Queries a list of ArticlesByPrefix items. + summary: Queries a list of Article items. operationId: BzeCointrunkV1AllArticles responses: '200': @@ -437,7 +437,7 @@ paths: type: string paid: type: boolean - createdAt: + created_at: type: string format: int64 pagination: @@ -32707,7 +32707,7 @@ definitions: type: string paid: type: boolean - createdAt: + created_at: type: string format: int64 bze.cointrunk.v1.MsgAddArticleResponse: @@ -32872,7 +32872,7 @@ definitions: type: string paid: type: boolean - createdAt: + created_at: type: string format: int64 pagination: diff --git a/proto/burner/events.proto b/proto/burner/events.proto new file mode 100644 index 00000000..dc2b4a28 --- /dev/null +++ b/proto/burner/events.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package bze.burner.v1; + +option go_package = "github.com/bze-alphateam/bze/x/burner/types"; + +message CoinsBurnedEvent { + string burned = 1; +} + +message FundBurnerEvent { + string from = 1; + string amount = 2; +} \ No newline at end of file diff --git a/proto/cointrunk/article.proto b/proto/cointrunk/article.proto index 9b958953..a7269347 100644 --- a/proto/cointrunk/article.proto +++ b/proto/cointrunk/article.proto @@ -11,5 +11,5 @@ message Article { string picture = 4; string publisher = 5; bool paid = 6; - int64 createdAt = 7; + int64 created_at = 7; } \ No newline at end of file diff --git a/proto/cointrunk/events.proto b/proto/cointrunk/events.proto new file mode 100644 index 00000000..b8e3c04f --- /dev/null +++ b/proto/cointrunk/events.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package bze.cointrunk.v1; + +import "cointrunk/publisher.proto"; +import "cointrunk/accepted_domain.proto"; + +option go_package = "github.com/bze-alphateam/bze/x/cointrunk/types"; + +message ArticleAddedEvent { + string publisher = 1; + uint64 article_id = 2; + bool paid = 3; +} + +message PublisherAddedEvent { + Publisher publisher = 1; +} + +message PublisherUpdatedEvent { + Publisher publisher = 1; +} + +message AcceptedDomainAddedEvent { + AcceptedDomain accepted_domain = 1; +} + +message AcceptedDomainUpdatedEvent { + AcceptedDomain accepted_domain = 1; +} \ No newline at end of file diff --git a/proto/cointrunk/query.proto b/proto/cointrunk/query.proto index e49dc67e..50f203ec 100644 --- a/proto/cointrunk/query.proto +++ b/proto/cointrunk/query.proto @@ -34,7 +34,7 @@ service Query { option (google.api.http).get = "/bze/cointrunk/v1/publisher/{index}"; } -// Queries a list of ArticlesByPrefix items. +// Queries a list of Article items. rpc AllArticles(QueryAllArticlesRequest) returns (QueryAllArticlesResponse) { option (google.api.http).get = "/bze/cointrunk/v1/articles"; } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts index a8dd1479..694141d0 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/index.ts @@ -2,10 +2,12 @@ import { txClient, queryClient, MissingWalletError , registry} from './module' import { BurnCoinsProposal } from "./module/types/burner/burn_coins_proposal" import { BurnedCoins } from "./module/types/burner/burned_coins" +import { CoinsBurnedEvent } from "./module/types/burner/events" +import { FundBurnerEvent } from "./module/types/burner/events" import { Params } from "./module/types/burner/params" -export { BurnCoinsProposal, BurnedCoins, Params }; +export { BurnCoinsProposal, BurnedCoins, CoinsBurnedEvent, FundBurnerEvent, Params }; async function initTxClient(vuexGetters) { return await txClient(vuexGetters['common/wallet/signer'], { @@ -49,6 +51,8 @@ const getDefaultState = () => { _Structure: { BurnCoinsProposal: getStructure(BurnCoinsProposal.fromPartial({})), BurnedCoins: getStructure(BurnedCoins.fromPartial({})), + CoinsBurnedEvent: getStructure(CoinsBurnedEvent.fromPartial({})), + FundBurnerEvent: getStructure(FundBurnerEvent.fromPartial({})), Params: getStructure(Params.fromPartial({})), }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/events.ts b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/events.ts new file mode 100644 index 00000000..32869ff7 --- /dev/null +++ b/vue/src/store/generated/bze-alphateam/bze/bze.burner.v1/module/types/burner/events.ts @@ -0,0 +1,151 @@ +/* eslint-disable */ +import { Writer, Reader } from "protobufjs/minimal"; + +export const protobufPackage = "bze.burner.v1"; + +export interface CoinsBurnedEvent { + burned: string; +} + +export interface FundBurnerEvent { + from: string; + amount: string; +} + +const baseCoinsBurnedEvent: object = { burned: "" }; + +export const CoinsBurnedEvent = { + encode(message: CoinsBurnedEvent, writer: Writer = Writer.create()): Writer { + if (message.burned !== "") { + writer.uint32(10).string(message.burned); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): CoinsBurnedEvent { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCoinsBurnedEvent } as CoinsBurnedEvent; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.burned = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CoinsBurnedEvent { + const message = { ...baseCoinsBurnedEvent } as CoinsBurnedEvent; + if (object.burned !== undefined && object.burned !== null) { + message.burned = String(object.burned); + } else { + message.burned = ""; + } + return message; + }, + + toJSON(message: CoinsBurnedEvent): unknown { + const obj: any = {}; + message.burned !== undefined && (obj.burned = message.burned); + return obj; + }, + + fromPartial(object: DeepPartial): CoinsBurnedEvent { + const message = { ...baseCoinsBurnedEvent } as CoinsBurnedEvent; + if (object.burned !== undefined && object.burned !== null) { + message.burned = object.burned; + } else { + message.burned = ""; + } + return message; + }, +}; + +const baseFundBurnerEvent: object = { from: "", amount: "" }; + +export const FundBurnerEvent = { + encode(message: FundBurnerEvent, writer: Writer = Writer.create()): Writer { + if (message.from !== "") { + writer.uint32(10).string(message.from); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): FundBurnerEvent { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFundBurnerEvent } as FundBurnerEvent; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.from = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FundBurnerEvent { + const message = { ...baseFundBurnerEvent } as FundBurnerEvent; + if (object.from !== undefined && object.from !== null) { + message.from = String(object.from); + } else { + message.from = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + return message; + }, + + toJSON(message: FundBurnerEvent): unknown { + const obj: any = {}; + message.from !== undefined && (obj.from = message.from); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, + + fromPartial(object: DeepPartial): FundBurnerEvent { + const message = { ...baseFundBurnerEvent } as FundBurnerEvent; + if (object.from !== undefined && object.from !== null) { + message.from = object.from; + } else { + message.from = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts index 0c724b02..c37d06c8 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts @@ -4,13 +4,18 @@ import { AcceptedDomain } from "./module/types/cointrunk/accepted_domain" import { AcceptedDomainProposal } from "./module/types/cointrunk/accepted_domain_proposal" import { AnonArticlesCounter } from "./module/types/cointrunk/anon_articles_counter" import { Article } from "./module/types/cointrunk/article" +import { ArticleAddedEvent } from "./module/types/cointrunk/events" +import { PublisherAddedEvent } from "./module/types/cointrunk/events" +import { PublisherUpdatedEvent } from "./module/types/cointrunk/events" +import { AcceptedDomainAddedEvent } from "./module/types/cointrunk/events" +import { AcceptedDomainUpdatedEvent } from "./module/types/cointrunk/events" import { PublisherRespectParams } from "./module/types/cointrunk/params" import { Params } from "./module/types/cointrunk/params" import { Publisher } from "./module/types/cointrunk/publisher" import { PublisherProposal } from "./module/types/cointrunk/publisher_proposal" -export { AcceptedDomain, AcceptedDomainProposal, AnonArticlesCounter, Article, PublisherRespectParams, Params, Publisher, PublisherProposal }; +export { AcceptedDomain, AcceptedDomainProposal, AnonArticlesCounter, Article, ArticleAddedEvent, PublisherAddedEvent, PublisherUpdatedEvent, AcceptedDomainAddedEvent, AcceptedDomainUpdatedEvent, PublisherRespectParams, Params, Publisher, PublisherProposal }; async function initTxClient(vuexGetters) { return await txClient(vuexGetters['common/wallet/signer'], { @@ -60,6 +65,11 @@ const getDefaultState = () => { AcceptedDomainProposal: getStructure(AcceptedDomainProposal.fromPartial({})), AnonArticlesCounter: getStructure(AnonArticlesCounter.fromPartial({})), Article: getStructure(Article.fromPartial({})), + ArticleAddedEvent: getStructure(ArticleAddedEvent.fromPartial({})), + PublisherAddedEvent: getStructure(PublisherAddedEvent.fromPartial({})), + PublisherUpdatedEvent: getStructure(PublisherUpdatedEvent.fromPartial({})), + AcceptedDomainAddedEvent: getStructure(AcceptedDomainAddedEvent.fromPartial({})), + AcceptedDomainUpdatedEvent: getStructure(AcceptedDomainUpdatedEvent.fromPartial({})), PublisherRespectParams: getStructure(PublisherRespectParams.fromPartial({})), Params: getStructure(Params.fromPartial({})), Publisher: getStructure(Publisher.fromPartial({})), @@ -310,60 +320,60 @@ export default { }, - async sendMsgPayPublisherRespect({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgAddArticle({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgPayPublisherRespect(value) + const msg = await txClient.msgAddArticle(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgPayPublisherRespect:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgAddArticle:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgAddArticle({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgPayPublisherRespect({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgAddArticle(value) + const msg = await txClient.msgPayPublisherRespect(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgAddArticle:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgPayPublisherRespect:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgPayPublisherRespect({ rootGetters }, { value }) { + async MsgAddArticle({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgPayPublisherRespect(value) + const msg = await txClient.msgAddArticle(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgPayPublisherRespect:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgAddArticle:Create Could not create message: ' + e.message) } } }, - async MsgAddArticle({ rootGetters }, { value }) { + async MsgPayPublisherRespect({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgAddArticle(value) + const msg = await txClient.msgPayPublisherRespect(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgAddArticle:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgPayPublisherRespect:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts index 9119ba33..71fe5dc5 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts @@ -4,13 +4,13 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgPayPublisherRespect } from "./types/cointrunk/tx"; import { MsgAddArticle } from "./types/cointrunk/tx"; +import { MsgPayPublisherRespect } from "./types/cointrunk/tx"; const types = [ - ["/bze.cointrunk.v1.MsgPayPublisherRespect", MsgPayPublisherRespect], ["/bze.cointrunk.v1.MsgAddArticle", MsgAddArticle], + ["/bze.cointrunk.v1.MsgPayPublisherRespect", MsgPayPublisherRespect], ]; export const MissingWalletError = new Error("wallet is required"); @@ -43,8 +43,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgPayPublisherRespect: (data: MsgPayPublisherRespect): EncodeObject => ({ typeUrl: "/bze.cointrunk.v1.MsgPayPublisherRespect", value: MsgPayPublisherRespect.fromPartial( data ) }), msgAddArticle: (data: MsgAddArticle): EncodeObject => ({ typeUrl: "/bze.cointrunk.v1.MsgAddArticle", value: MsgAddArticle.fromPartial( data ) }), + msgPayPublisherRespect: (data: MsgPayPublisherRespect): EncodeObject => ({ typeUrl: "/bze.cointrunk.v1.MsgPayPublisherRespect", value: MsgPayPublisherRespect.fromPartial( data ) }), }; }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts index 652de616..b621b8bf 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts @@ -42,7 +42,7 @@ export interface V1Article { paid?: boolean; /** @format int64 */ - createdAt?: string; + created_at?: string; } export type V1MsgAddArticleResponse = object; @@ -496,7 +496,7 @@ export class Api extends HttpClient>> 3) { + case 1: + message.publisher = reader.string(); + break; + case 2: + message.article_id = longToNumber(reader.uint64() as Long); + break; + case 3: + message.paid = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ArticleAddedEvent { + const message = { ...baseArticleAddedEvent } as ArticleAddedEvent; + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = String(object.publisher); + } else { + message.publisher = ""; + } + if (object.article_id !== undefined && object.article_id !== null) { + message.article_id = Number(object.article_id); + } else { + message.article_id = 0; + } + if (object.paid !== undefined && object.paid !== null) { + message.paid = Boolean(object.paid); + } else { + message.paid = false; + } + return message; + }, + + toJSON(message: ArticleAddedEvent): unknown { + const obj: any = {}; + message.publisher !== undefined && (obj.publisher = message.publisher); + message.article_id !== undefined && (obj.article_id = message.article_id); + message.paid !== undefined && (obj.paid = message.paid); + return obj; + }, + + fromPartial(object: DeepPartial): ArticleAddedEvent { + const message = { ...baseArticleAddedEvent } as ArticleAddedEvent; + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = object.publisher; + } else { + message.publisher = ""; + } + if (object.article_id !== undefined && object.article_id !== null) { + message.article_id = object.article_id; + } else { + message.article_id = 0; + } + if (object.paid !== undefined && object.paid !== null) { + message.paid = object.paid; + } else { + message.paid = false; + } + return message; + }, +}; + +const basePublisherAddedEvent: object = {}; + +export const PublisherAddedEvent = { + encode( + message: PublisherAddedEvent, + writer: Writer = Writer.create() + ): Writer { + if (message.publisher !== undefined) { + Publisher.encode(message.publisher, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PublisherAddedEvent { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublisherAddedEvent } as PublisherAddedEvent; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publisher = Publisher.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PublisherAddedEvent { + const message = { ...basePublisherAddedEvent } as PublisherAddedEvent; + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = Publisher.fromJSON(object.publisher); + } else { + message.publisher = undefined; + } + return message; + }, + + toJSON(message: PublisherAddedEvent): unknown { + const obj: any = {}; + message.publisher !== undefined && + (obj.publisher = message.publisher + ? Publisher.toJSON(message.publisher) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): PublisherAddedEvent { + const message = { ...basePublisherAddedEvent } as PublisherAddedEvent; + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = Publisher.fromPartial(object.publisher); + } else { + message.publisher = undefined; + } + return message; + }, +}; + +const basePublisherUpdatedEvent: object = {}; + +export const PublisherUpdatedEvent = { + encode( + message: PublisherUpdatedEvent, + writer: Writer = Writer.create() + ): Writer { + if (message.publisher !== undefined) { + Publisher.encode(message.publisher, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): PublisherUpdatedEvent { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublisherUpdatedEvent } as PublisherUpdatedEvent; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publisher = Publisher.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PublisherUpdatedEvent { + const message = { ...basePublisherUpdatedEvent } as PublisherUpdatedEvent; + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = Publisher.fromJSON(object.publisher); + } else { + message.publisher = undefined; + } + return message; + }, + + toJSON(message: PublisherUpdatedEvent): unknown { + const obj: any = {}; + message.publisher !== undefined && + (obj.publisher = message.publisher + ? Publisher.toJSON(message.publisher) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): PublisherUpdatedEvent { + const message = { ...basePublisherUpdatedEvent } as PublisherUpdatedEvent; + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = Publisher.fromPartial(object.publisher); + } else { + message.publisher = undefined; + } + return message; + }, +}; + +const baseAcceptedDomainAddedEvent: object = {}; + +export const AcceptedDomainAddedEvent = { + encode( + message: AcceptedDomainAddedEvent, + writer: Writer = Writer.create() + ): Writer { + if (message.accepted_domain !== undefined) { + AcceptedDomain.encode( + message.accepted_domain, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): AcceptedDomainAddedEvent { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAcceptedDomainAddedEvent, + } as AcceptedDomainAddedEvent; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accepted_domain = AcceptedDomain.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AcceptedDomainAddedEvent { + const message = { + ...baseAcceptedDomainAddedEvent, + } as AcceptedDomainAddedEvent; + if ( + object.accepted_domain !== undefined && + object.accepted_domain !== null + ) { + message.accepted_domain = AcceptedDomain.fromJSON(object.accepted_domain); + } else { + message.accepted_domain = undefined; + } + return message; + }, + + toJSON(message: AcceptedDomainAddedEvent): unknown { + const obj: any = {}; + message.accepted_domain !== undefined && + (obj.accepted_domain = message.accepted_domain + ? AcceptedDomain.toJSON(message.accepted_domain) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): AcceptedDomainAddedEvent { + const message = { + ...baseAcceptedDomainAddedEvent, + } as AcceptedDomainAddedEvent; + if ( + object.accepted_domain !== undefined && + object.accepted_domain !== null + ) { + message.accepted_domain = AcceptedDomain.fromPartial( + object.accepted_domain + ); + } else { + message.accepted_domain = undefined; + } + return message; + }, +}; + +const baseAcceptedDomainUpdatedEvent: object = {}; + +export const AcceptedDomainUpdatedEvent = { + encode( + message: AcceptedDomainUpdatedEvent, + writer: Writer = Writer.create() + ): Writer { + if (message.accepted_domain !== undefined) { + AcceptedDomain.encode( + message.accepted_domain, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): AcceptedDomainUpdatedEvent { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAcceptedDomainUpdatedEvent, + } as AcceptedDomainUpdatedEvent; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accepted_domain = AcceptedDomain.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AcceptedDomainUpdatedEvent { + const message = { + ...baseAcceptedDomainUpdatedEvent, + } as AcceptedDomainUpdatedEvent; + if ( + object.accepted_domain !== undefined && + object.accepted_domain !== null + ) { + message.accepted_domain = AcceptedDomain.fromJSON(object.accepted_domain); + } else { + message.accepted_domain = undefined; + } + return message; + }, + + toJSON(message: AcceptedDomainUpdatedEvent): unknown { + const obj: any = {}; + message.accepted_domain !== undefined && + (obj.accepted_domain = message.accepted_domain + ? AcceptedDomain.toJSON(message.accepted_domain) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial + ): AcceptedDomainUpdatedEvent { + const message = { + ...baseAcceptedDomainUpdatedEvent, + } as AcceptedDomainUpdatedEvent; + if ( + object.accepted_domain !== undefined && + object.accepted_domain !== null + ) { + message.accepted_domain = AcceptedDomain.fromPartial( + object.accepted_domain + ); + } else { + message.accepted_domain = undefined; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/query.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/query.ts index ec1886e9..e4ad6c08 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/query.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/query.ts @@ -998,7 +998,7 @@ export interface Query { PublisherByIndex( request: QueryPublisherByIndexRequest ): Promise; - /** Queries a list of ArticlesByPrefix items. */ + /** Queries a list of Article items. */ AllArticles( request: QueryAllArticlesRequest ): Promise; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 0a633940..36486b56 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,6 +232,21 @@ export default { }, + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgSubmitScavenge(value) + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + }else{ + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + } + } + }, async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -262,22 +277,20 @@ export default { } } }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) const msg = await txClient.msgSubmitScavenge(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result + return msg } catch (e) { if (e == MissingWalletError) { throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + } else{ + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, - async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) @@ -304,19 +317,6 @@ export default { } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) - return msg - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) - } - } - }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 44bd4fda..27b7f752 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; const types = [ + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), }; }; diff --git a/x/burner/keeper/gov.go b/x/burner/keeper/gov.go index 3b863de5..77d19379 100644 --- a/x/burner/keeper/gov.go +++ b/x/burner/keeper/gov.go @@ -25,5 +25,10 @@ func (k Keeper) HandleBurnCoinsProposal(ctx sdk.Context, proposal *types.BurnCoi } k.SetBurnedCoins(ctx, burnedCoins) + err = ctx.EventManager().EmitTypedEvent(&types.CoinsBurnedEvent{Burned: burnedCoins.Burned}) + if err != nil { + return err + } + return nil } diff --git a/x/burner/keeper/msg_server_fund_burner.go b/x/burner/keeper/msg_server_fund_burner.go index 1b98518b..29bf601d 100644 --- a/x/burner/keeper/msg_server_fund_burner.go +++ b/x/burner/keeper/msg_server_fund_burner.go @@ -24,6 +24,11 @@ func (k msgServer) FundBurner(goCtx context.Context, msg *types.MsgFundBurner) ( return nil, err } + err = ctx.EventManager().EmitTypedEvent(&types.FundBurnerEvent{From: msg.Creator, Amount: amount.String()}) + if err != nil { + return nil, err + } + _ = ctx return &types.MsgFundBurnerResponse{}, nil diff --git a/x/burner/types/events.pb.go b/x/burner/types/events.pb.go new file mode 100644 index 00000000..65eeed57 --- /dev/null +++ b/x/burner/types/events.pb.go @@ -0,0 +1,538 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: burner/events.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/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 CoinsBurnedEvent struct { + Burned string `protobuf:"bytes,1,opt,name=burned,proto3" json:"burned,omitempty"` +} + +func (m *CoinsBurnedEvent) Reset() { *m = CoinsBurnedEvent{} } +func (m *CoinsBurnedEvent) String() string { return proto.CompactTextString(m) } +func (*CoinsBurnedEvent) ProtoMessage() {} +func (*CoinsBurnedEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_1ac06489072f6c70, []int{0} +} +func (m *CoinsBurnedEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CoinsBurnedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CoinsBurnedEvent.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 *CoinsBurnedEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_CoinsBurnedEvent.Merge(m, src) +} +func (m *CoinsBurnedEvent) XXX_Size() int { + return m.Size() +} +func (m *CoinsBurnedEvent) XXX_DiscardUnknown() { + xxx_messageInfo_CoinsBurnedEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_CoinsBurnedEvent proto.InternalMessageInfo + +func (m *CoinsBurnedEvent) GetBurned() string { + if m != nil { + return m.Burned + } + return "" +} + +type FundBurnerEvent struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + Amount string `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *FundBurnerEvent) Reset() { *m = FundBurnerEvent{} } +func (m *FundBurnerEvent) String() string { return proto.CompactTextString(m) } +func (*FundBurnerEvent) ProtoMessage() {} +func (*FundBurnerEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_1ac06489072f6c70, []int{1} +} +func (m *FundBurnerEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FundBurnerEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FundBurnerEvent.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 *FundBurnerEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_FundBurnerEvent.Merge(m, src) +} +func (m *FundBurnerEvent) XXX_Size() int { + return m.Size() +} +func (m *FundBurnerEvent) XXX_DiscardUnknown() { + xxx_messageInfo_FundBurnerEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_FundBurnerEvent proto.InternalMessageInfo + +func (m *FundBurnerEvent) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *FundBurnerEvent) GetAmount() string { + if m != nil { + return m.Amount + } + return "" +} + +func init() { + proto.RegisterType((*CoinsBurnedEvent)(nil), "bze.burner.v1.CoinsBurnedEvent") + proto.RegisterType((*FundBurnerEvent)(nil), "bze.burner.v1.FundBurnerEvent") +} + +func init() { proto.RegisterFile("burner/events.proto", fileDescriptor_1ac06489072f6c70) } + +var fileDescriptor_1ac06489072f6c70 = []byte{ + // 195 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4e, 0x2a, 0x2d, 0xca, + 0x4b, 0x2d, 0xd2, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0xe2, 0x4d, 0xaa, 0x4a, 0xd5, 0x83, 0x48, 0xe8, 0x95, 0x19, 0x2a, 0x69, 0x71, 0x09, 0x38, 0xe7, + 0x67, 0xe6, 0x15, 0x3b, 0x81, 0x44, 0x52, 0x5c, 0x41, 0x2a, 0x85, 0xc4, 0xb8, 0xd8, 0xc0, 0x0a, + 0x52, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0xa0, 0x3c, 0x25, 0x5b, 0x2e, 0x7e, 0xb7, 0xd2, + 0xbc, 0x14, 0xb0, 0xd2, 0x22, 0x88, 0x52, 0x21, 0x2e, 0x96, 0xb4, 0xa2, 0xfc, 0x5c, 0xa8, 0x42, + 0x30, 0x1b, 0xa4, 0x3d, 0x31, 0x37, 0xbf, 0x34, 0xaf, 0x44, 0x82, 0x09, 0xa2, 0x1d, 0xc2, 0x73, + 0x72, 0x3d, 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, 0xed, 0xf4, 0xcc, 0x92, + 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xa4, 0xaa, 0x54, 0xdd, 0xc4, 0x9c, 0x82, 0x8c, + 0xc4, 0x92, 0xd4, 0x44, 0x30, 0x4f, 0xbf, 0x42, 0x1f, 0xea, 0x8f, 0x92, 0xca, 0x82, 0xd4, 0xe2, + 0x24, 0x36, 0xb0, 0x3f, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5d, 0xe7, 0x79, 0xbe, 0xde, + 0x00, 0x00, 0x00, +} + +func (m *CoinsBurnedEvent) 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 *CoinsBurnedEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CoinsBurnedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Burned) > 0 { + i -= len(m.Burned) + copy(dAtA[i:], m.Burned) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Burned))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *FundBurnerEvent) 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 *FundBurnerEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FundBurnerEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + i -= len(m.Amount) + copy(dAtA[i:], m.Amount) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Amount))) + i-- + dAtA[i] = 0x12 + } + if len(m.From) > 0 { + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintEvents(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *CoinsBurnedEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Burned) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *FundBurnerEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Amount) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *CoinsBurnedEvent) 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 ErrIntOverflowEvents + } + 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: CoinsBurnedEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CoinsBurnedEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Burned", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Burned = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FundBurnerEvent) 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 ErrIntOverflowEvents + } + 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: FundBurnerEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FundBurnerEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(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, ErrIntOverflowEvents + } + 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, ErrIntOverflowEvents + } + 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, ErrIntOverflowEvents + } + 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, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/cointrunk/keeper/gov.go b/x/cointrunk/keeper/gov.go index e3f7411a..06a912d5 100644 --- a/x/cointrunk/keeper/gov.go +++ b/x/cointrunk/keeper/gov.go @@ -16,14 +16,41 @@ func (k Keeper) HandlePublisherProposal(ctx sdk.Context, proposal *types.Publish publisher.ArticlesCount = 0 publisher.Respect = 0 } + k.SetPublisher(ctx, publisher) + + if found { + event := types.PublisherUpdatedEvent{Publisher: &publisher} + if err := ctx.EventManager().EmitTypedEvent(&event); err != nil { + return err + } + } else { + event := types.PublisherAddedEvent{Publisher: &publisher} + if err := ctx.EventManager().EmitTypedEvent(&event); err != nil { + return err + } + } + return nil } func (k Keeper) HandleAcceptedDomainProposal(ctx sdk.Context, proposal *types.AcceptedDomainProposal) error { - acceptedDomain, _ := k.GetAcceptedDomain(ctx, proposal.Domain) + acceptedDomain, found := k.GetAcceptedDomain(ctx, proposal.Domain) acceptedDomain.Domain = proposal.Domain acceptedDomain.Active = proposal.Active k.SetAcceptedDomain(ctx, acceptedDomain) + + if found { + event := types.AcceptedDomainUpdatedEvent{AcceptedDomain: &acceptedDomain} + if err := ctx.EventManager().EmitTypedEvent(&event); err != nil { + return err + } + } else { + event := types.AcceptedDomainAddedEvent{AcceptedDomain: &acceptedDomain} + if err := ctx.EventManager().EmitTypedEvent(&event); err != nil { + return err + } + } + return nil } diff --git a/x/cointrunk/keeper/msg_server_add_article.go b/x/cointrunk/keeper/msg_server_add_article.go index b488384a..e0c24c40 100644 --- a/x/cointrunk/keeper/msg_server_add_article.go +++ b/x/cointrunk/keeper/msg_server_add_article.go @@ -53,11 +53,26 @@ func (k msgServer) AddArticle(goCtx context.Context, msg *types.MsgAddArticle) ( k.SetPublisher(ctx, publisher) } + err = k.emitArticleAddedEvent(ctx, article) + if err != nil { + return nil, err + } + _ = ctx return &types.MsgAddArticleResponse{}, nil } +func (k msgServer) emitArticleAddedEvent(ctx sdk.Context, article types.Article) error { + return ctx.EventManager().EmitTypedEvent( + &types.ArticleAddedEvent{ + ArticleId: article.Id, + Publisher: article.Publisher, + Paid: article.Paid, + }, + ) +} + func (k msgServer) validateMessageDomains(ctx sdk.Context, msg *types.MsgAddArticle) error { parsedUrl, err := msg.ParseUrl(msg.Url) if err != nil { diff --git a/x/cointrunk/types/article.pb.go b/x/cointrunk/types/article.pb.go index d4032a5d..d99a8fac 100644 --- a/x/cointrunk/types/article.pb.go +++ b/x/cointrunk/types/article.pb.go @@ -29,7 +29,7 @@ type Article struct { Picture string `protobuf:"bytes,4,opt,name=picture,proto3" json:"picture,omitempty"` Publisher string `protobuf:"bytes,5,opt,name=publisher,proto3" json:"publisher,omitempty"` Paid bool `protobuf:"varint,6,opt,name=paid,proto3" json:"paid,omitempty"` - CreatedAt int64 `protobuf:"varint,7,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + CreatedAt int64 `protobuf:"varint,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` } func (m *Article) Reset() { *m = Article{} } @@ -121,23 +121,23 @@ func init() { func init() { proto.RegisterFile("cointrunk/article.proto", fileDescriptor_b0f4352c8e9bdd9e) } var fileDescriptor_b0f4352c8e9bdd9e = []byte{ - // 249 bytes of a gzipped FileDescriptorProto + // 254 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x90, 0x31, 0x4e, 0xc3, 0x30, - 0x14, 0x86, 0xe3, 0x24, 0x6d, 0xa8, 0x07, 0x54, 0x59, 0x48, 0x78, 0x40, 0x56, 0xc4, 0x94, 0x85, - 0x44, 0x88, 0x13, 0x94, 0x89, 0x39, 0x23, 0x9b, 0xed, 0x3c, 0x11, 0x0b, 0xd3, 0x58, 0xee, 0x33, - 0x82, 0x9e, 0x82, 0x7b, 0x70, 0x11, 0xc6, 0x8e, 0x8c, 0x28, 0xb9, 0x08, 0xaa, 0x2b, 0xc8, 0xf6, - 0x7f, 0xdf, 0xff, 0xde, 0xf2, 0xd3, 0x4b, 0x3d, 0x98, 0x2d, 0xfa, 0xb0, 0x7d, 0x6e, 0xa4, 0x47, - 0xa3, 0x2d, 0xd4, 0xce, 0x0f, 0x38, 0xb0, 0xb5, 0xda, 0x43, 0xfd, 0x5f, 0xd6, 0xaf, 0xb7, 0xd7, - 0x9f, 0x84, 0x16, 0x9b, 0xd3, 0x0d, 0x3b, 0xa7, 0xa9, 0xe9, 0x38, 0x29, 0x49, 0x95, 0xb7, 0xa9, - 0xe9, 0xd8, 0x05, 0x5d, 0xa0, 0x41, 0x0b, 0x3c, 0x2d, 0x49, 0xb5, 0x6a, 0x4f, 0xc0, 0xd6, 0x34, - 0x0b, 0xde, 0xf2, 0x2c, 0xba, 0x63, 0x64, 0x9c, 0x16, 0xce, 0x68, 0x0c, 0x1e, 0x78, 0x1e, 0xed, - 0x1f, 0xb2, 0x2b, 0xba, 0x72, 0x41, 0x59, 0xb3, 0xeb, 0xc1, 0xf3, 0x45, 0xec, 0x66, 0xc1, 0x18, - 0xcd, 0x9d, 0x34, 0x1d, 0x5f, 0x96, 0xa4, 0x3a, 0x6b, 0x63, 0x3e, 0x7e, 0x68, 0x0f, 0x12, 0xa1, - 0xdb, 0x20, 0x2f, 0x4a, 0x52, 0x65, 0xed, 0x2c, 0xee, 0x1f, 0xbe, 0x46, 0x41, 0x0e, 0xa3, 0x20, - 0x3f, 0xa3, 0x20, 0x1f, 0x93, 0x48, 0x0e, 0x93, 0x48, 0xbe, 0x27, 0x91, 0x3c, 0xd6, 0x4f, 0x06, - 0xfb, 0xa0, 0x6a, 0x3d, 0xbc, 0x34, 0x6a, 0x0f, 0x37, 0xd2, 0xba, 0x5e, 0x22, 0xc8, 0x48, 0xcd, - 0x5b, 0x33, 0x2f, 0x82, 0xef, 0x0e, 0x76, 0x6a, 0x19, 0x07, 0xb9, 0xfb, 0x0d, 0x00, 0x00, 0xff, - 0xff, 0x0b, 0x97, 0x9a, 0x43, 0x2b, 0x01, 0x00, 0x00, + 0x18, 0x85, 0xeb, 0x24, 0x6d, 0xc8, 0x3f, 0xa0, 0xca, 0x42, 0xc2, 0x03, 0x58, 0x11, 0x53, 0x16, + 0x12, 0x21, 0x4e, 0x50, 0x26, 0xe6, 0x8c, 0x2c, 0xc8, 0x49, 0x7e, 0x11, 0x0b, 0xd3, 0x58, 0xee, + 0x6f, 0x04, 0x3d, 0x05, 0x07, 0xe1, 0x20, 0x8c, 0x1d, 0x19, 0x51, 0x72, 0x11, 0x84, 0x0b, 0x74, + 0x7b, 0xdf, 0xf7, 0xde, 0xf4, 0xe0, 0xb4, 0x1d, 0xf4, 0x9a, 0x9c, 0x5f, 0x3f, 0x56, 0xca, 0x91, + 0x6e, 0x0d, 0x96, 0xd6, 0x0d, 0x34, 0xf0, 0x65, 0xb3, 0xc5, 0xf2, 0xbf, 0x2c, 0x9f, 0xaf, 0x2e, + 0xde, 0x19, 0xa4, 0xab, 0xfd, 0x86, 0x1f, 0x43, 0xa4, 0x3b, 0xc1, 0x72, 0x56, 0x24, 0x75, 0xa4, + 0x3b, 0x7e, 0x02, 0x73, 0xd2, 0x64, 0x50, 0x44, 0x39, 0x2b, 0xb2, 0x7a, 0x0f, 0x7c, 0x09, 0xb1, + 0x77, 0x46, 0xc4, 0xc1, 0xfd, 0x44, 0x2e, 0x20, 0xb5, 0xba, 0x25, 0xef, 0x50, 0x24, 0xc1, 0xfe, + 0x21, 0x3f, 0x83, 0xcc, 0xfa, 0xc6, 0xe8, 0x4d, 0x8f, 0x4e, 0xcc, 0x43, 0x77, 0x10, 0x9c, 0x43, + 0x62, 0x95, 0xee, 0xc4, 0x22, 0x67, 0xc5, 0x51, 0x1d, 0x32, 0x3f, 0x07, 0x68, 0x1d, 0x2a, 0xc2, + 0xee, 0x5e, 0x91, 0x48, 0x73, 0x56, 0xc4, 0x75, 0xf6, 0x6b, 0x56, 0x74, 0x73, 0xfb, 0x31, 0x4a, + 0xb6, 0x1b, 0x25, 0xfb, 0x1a, 0x25, 0x7b, 0x9b, 0xe4, 0x6c, 0x37, 0xc9, 0xd9, 0xe7, 0x24, 0x67, + 0x77, 0xe5, 0x83, 0xa6, 0xde, 0x37, 0x65, 0x3b, 0x3c, 0x55, 0xcd, 0x16, 0x2f, 0x95, 0xb1, 0xbd, + 0x22, 0x54, 0x81, 0xaa, 0x97, 0xea, 0x70, 0x09, 0xbd, 0x5a, 0xdc, 0x34, 0x8b, 0xf0, 0xc8, 0xf5, + 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc1, 0xd0, 0xb1, 0x11, 0x2c, 0x01, 0x00, 0x00, } func (m *Article) Marshal() (dAtA []byte, err error) { diff --git a/x/cointrunk/types/events.pb.go b/x/cointrunk/types/events.pb.go new file mode 100644 index 00000000..d7eca083 --- /dev/null +++ b/x/cointrunk/types/events.pb.go @@ -0,0 +1,1116 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cointrunk/events.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/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 ArticleAddedEvent struct { + Publisher string `protobuf:"bytes,1,opt,name=publisher,proto3" json:"publisher,omitempty"` + ArticleId uint64 `protobuf:"varint,2,opt,name=article_id,json=articleId,proto3" json:"article_id,omitempty"` + Paid bool `protobuf:"varint,3,opt,name=paid,proto3" json:"paid,omitempty"` +} + +func (m *ArticleAddedEvent) Reset() { *m = ArticleAddedEvent{} } +func (m *ArticleAddedEvent) String() string { return proto.CompactTextString(m) } +func (*ArticleAddedEvent) ProtoMessage() {} +func (*ArticleAddedEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_047659f6c6782b45, []int{0} +} +func (m *ArticleAddedEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ArticleAddedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ArticleAddedEvent.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 *ArticleAddedEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_ArticleAddedEvent.Merge(m, src) +} +func (m *ArticleAddedEvent) XXX_Size() int { + return m.Size() +} +func (m *ArticleAddedEvent) XXX_DiscardUnknown() { + xxx_messageInfo_ArticleAddedEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_ArticleAddedEvent proto.InternalMessageInfo + +func (m *ArticleAddedEvent) GetPublisher() string { + if m != nil { + return m.Publisher + } + return "" +} + +func (m *ArticleAddedEvent) GetArticleId() uint64 { + if m != nil { + return m.ArticleId + } + return 0 +} + +func (m *ArticleAddedEvent) GetPaid() bool { + if m != nil { + return m.Paid + } + return false +} + +type PublisherAddedEvent struct { + Publisher *Publisher `protobuf:"bytes,1,opt,name=publisher,proto3" json:"publisher,omitempty"` +} + +func (m *PublisherAddedEvent) Reset() { *m = PublisherAddedEvent{} } +func (m *PublisherAddedEvent) String() string { return proto.CompactTextString(m) } +func (*PublisherAddedEvent) ProtoMessage() {} +func (*PublisherAddedEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_047659f6c6782b45, []int{1} +} +func (m *PublisherAddedEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PublisherAddedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PublisherAddedEvent.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 *PublisherAddedEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_PublisherAddedEvent.Merge(m, src) +} +func (m *PublisherAddedEvent) XXX_Size() int { + return m.Size() +} +func (m *PublisherAddedEvent) XXX_DiscardUnknown() { + xxx_messageInfo_PublisherAddedEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_PublisherAddedEvent proto.InternalMessageInfo + +func (m *PublisherAddedEvent) GetPublisher() *Publisher { + if m != nil { + return m.Publisher + } + return nil +} + +type PublisherUpdatedEvent struct { + Publisher *Publisher `protobuf:"bytes,1,opt,name=publisher,proto3" json:"publisher,omitempty"` +} + +func (m *PublisherUpdatedEvent) Reset() { *m = PublisherUpdatedEvent{} } +func (m *PublisherUpdatedEvent) String() string { return proto.CompactTextString(m) } +func (*PublisherUpdatedEvent) ProtoMessage() {} +func (*PublisherUpdatedEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_047659f6c6782b45, []int{2} +} +func (m *PublisherUpdatedEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PublisherUpdatedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PublisherUpdatedEvent.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 *PublisherUpdatedEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_PublisherUpdatedEvent.Merge(m, src) +} +func (m *PublisherUpdatedEvent) XXX_Size() int { + return m.Size() +} +func (m *PublisherUpdatedEvent) XXX_DiscardUnknown() { + xxx_messageInfo_PublisherUpdatedEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_PublisherUpdatedEvent proto.InternalMessageInfo + +func (m *PublisherUpdatedEvent) GetPublisher() *Publisher { + if m != nil { + return m.Publisher + } + return nil +} + +type AcceptedDomainAddedEvent struct { + AcceptedDomain *AcceptedDomain `protobuf:"bytes,1,opt,name=accepted_domain,json=acceptedDomain,proto3" json:"accepted_domain,omitempty"` +} + +func (m *AcceptedDomainAddedEvent) Reset() { *m = AcceptedDomainAddedEvent{} } +func (m *AcceptedDomainAddedEvent) String() string { return proto.CompactTextString(m) } +func (*AcceptedDomainAddedEvent) ProtoMessage() {} +func (*AcceptedDomainAddedEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_047659f6c6782b45, []int{3} +} +func (m *AcceptedDomainAddedEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AcceptedDomainAddedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AcceptedDomainAddedEvent.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 *AcceptedDomainAddedEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_AcceptedDomainAddedEvent.Merge(m, src) +} +func (m *AcceptedDomainAddedEvent) XXX_Size() int { + return m.Size() +} +func (m *AcceptedDomainAddedEvent) XXX_DiscardUnknown() { + xxx_messageInfo_AcceptedDomainAddedEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_AcceptedDomainAddedEvent proto.InternalMessageInfo + +func (m *AcceptedDomainAddedEvent) GetAcceptedDomain() *AcceptedDomain { + if m != nil { + return m.AcceptedDomain + } + return nil +} + +type AcceptedDomainUpdatedEvent struct { + AcceptedDomain *AcceptedDomain `protobuf:"bytes,1,opt,name=accepted_domain,json=acceptedDomain,proto3" json:"accepted_domain,omitempty"` +} + +func (m *AcceptedDomainUpdatedEvent) Reset() { *m = AcceptedDomainUpdatedEvent{} } +func (m *AcceptedDomainUpdatedEvent) String() string { return proto.CompactTextString(m) } +func (*AcceptedDomainUpdatedEvent) ProtoMessage() {} +func (*AcceptedDomainUpdatedEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_047659f6c6782b45, []int{4} +} +func (m *AcceptedDomainUpdatedEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AcceptedDomainUpdatedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AcceptedDomainUpdatedEvent.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 *AcceptedDomainUpdatedEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_AcceptedDomainUpdatedEvent.Merge(m, src) +} +func (m *AcceptedDomainUpdatedEvent) XXX_Size() int { + return m.Size() +} +func (m *AcceptedDomainUpdatedEvent) XXX_DiscardUnknown() { + xxx_messageInfo_AcceptedDomainUpdatedEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_AcceptedDomainUpdatedEvent proto.InternalMessageInfo + +func (m *AcceptedDomainUpdatedEvent) GetAcceptedDomain() *AcceptedDomain { + if m != nil { + return m.AcceptedDomain + } + return nil +} + +func init() { + proto.RegisterType((*ArticleAddedEvent)(nil), "bze.cointrunk.v1.ArticleAddedEvent") + proto.RegisterType((*PublisherAddedEvent)(nil), "bze.cointrunk.v1.PublisherAddedEvent") + proto.RegisterType((*PublisherUpdatedEvent)(nil), "bze.cointrunk.v1.PublisherUpdatedEvent") + proto.RegisterType((*AcceptedDomainAddedEvent)(nil), "bze.cointrunk.v1.AcceptedDomainAddedEvent") + proto.RegisterType((*AcceptedDomainUpdatedEvent)(nil), "bze.cointrunk.v1.AcceptedDomainUpdatedEvent") +} + +func init() { proto.RegisterFile("cointrunk/events.proto", fileDescriptor_047659f6c6782b45) } + +var fileDescriptor_047659f6c6782b45 = []byte{ + // 317 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4b, 0xce, 0xcf, 0xcc, + 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, + 0x2f, 0xc9, 0x17, 0x12, 0x48, 0xaa, 0x4a, 0xd5, 0x83, 0xcb, 0xe9, 0x95, 0x19, 0x4a, 0x49, 0x22, + 0x54, 0x16, 0x94, 0x26, 0xe5, 0x64, 0x16, 0x67, 0xa4, 0x16, 0x41, 0x14, 0x4b, 0xc9, 0x23, 0xa4, + 0x12, 0x93, 0x93, 0x53, 0x0b, 0x4a, 0x52, 0x53, 0xe2, 0x53, 0xf2, 0x73, 0x13, 0x33, 0xf3, 0x20, + 0x0a, 0x94, 0x52, 0xb8, 0x04, 0x1d, 0x8b, 0x4a, 0x32, 0x93, 0x73, 0x52, 0x1d, 0x53, 0x52, 0x52, + 0x53, 0x5c, 0x41, 0x36, 0x09, 0xc9, 0x70, 0x71, 0xc2, 0x0d, 0x92, 0x60, 0x54, 0x60, 0xd4, 0xe0, + 0x0c, 0x42, 0x08, 0x08, 0xc9, 0x72, 0x71, 0x25, 0x42, 0xb4, 0xc4, 0x67, 0xa6, 0x48, 0x30, 0x29, + 0x30, 0x6a, 0xb0, 0x04, 0x71, 0x42, 0x45, 0x3c, 0x53, 0x84, 0x84, 0xb8, 0x58, 0x0a, 0x12, 0x33, + 0x53, 0x24, 0x98, 0x15, 0x18, 0x35, 0x38, 0x82, 0xc0, 0x6c, 0xa5, 0x00, 0x2e, 0xe1, 0x00, 0x98, + 0x7e, 0x24, 0x7b, 0x2c, 0xd1, 0xed, 0xe1, 0x36, 0x92, 0xd6, 0x43, 0xf7, 0x9e, 0x1e, 0x5c, 0x27, + 0x92, 0x23, 0x94, 0x82, 0xb8, 0x44, 0xe1, 0xe2, 0xa1, 0x05, 0x29, 0x89, 0x25, 0x54, 0x30, 0x33, + 0x95, 0x4b, 0xc2, 0x11, 0x1a, 0x48, 0x2e, 0xe0, 0x30, 0x42, 0x72, 0xaa, 0x27, 0x17, 0x3f, 0x5a, + 0x00, 0x42, 0x0d, 0x57, 0xc0, 0x34, 0x1c, 0xd5, 0x90, 0x20, 0xbe, 0x44, 0x14, 0xbe, 0x52, 0x3a, + 0x97, 0x14, 0xaa, 0x0a, 0x14, 0xf7, 0x53, 0xcf, 0x22, 0x27, 0x8f, 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, 0xd2, 0x4b, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, + 0xd5, 0x4f, 0xaa, 0x4a, 0xd5, 0x4d, 0xcc, 0x29, 0xc8, 0x48, 0x2c, 0x49, 0x4d, 0x04, 0xf3, 0xf4, + 0x2b, 0xf4, 0x11, 0xa9, 0xa6, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x9c, 0x58, 0x8c, 0x01, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x00, 0xd8, 0xb3, 0x17, 0x94, 0x02, 0x00, 0x00, +} + +func (m *ArticleAddedEvent) 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 *ArticleAddedEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ArticleAddedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Paid { + i-- + if m.Paid { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.ArticleId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.ArticleId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Publisher) > 0 { + i -= len(m.Publisher) + copy(dAtA[i:], m.Publisher) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Publisher))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PublisherAddedEvent) 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 *PublisherAddedEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PublisherAddedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Publisher != nil { + { + size, err := m.Publisher.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PublisherUpdatedEvent) 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 *PublisherUpdatedEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PublisherUpdatedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Publisher != nil { + { + size, err := m.Publisher.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AcceptedDomainAddedEvent) 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 *AcceptedDomainAddedEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AcceptedDomainAddedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AcceptedDomain != nil { + { + size, err := m.AcceptedDomain.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AcceptedDomainUpdatedEvent) 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 *AcceptedDomainUpdatedEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AcceptedDomainUpdatedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AcceptedDomain != nil { + { + size, err := m.AcceptedDomain.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ArticleAddedEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Publisher) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.ArticleId != 0 { + n += 1 + sovEvents(uint64(m.ArticleId)) + } + if m.Paid { + n += 2 + } + return n +} + +func (m *PublisherAddedEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Publisher != nil { + l = m.Publisher.Size() + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *PublisherUpdatedEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Publisher != nil { + l = m.Publisher.Size() + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *AcceptedDomainAddedEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AcceptedDomain != nil { + l = m.AcceptedDomain.Size() + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *AcceptedDomainUpdatedEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AcceptedDomain != nil { + l = m.AcceptedDomain.Size() + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ArticleAddedEvent) 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 ErrIntOverflowEvents + } + 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: ArticleAddedEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ArticleAddedEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Publisher", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Publisher = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ArticleId", wireType) + } + m.ArticleId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ArticleId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Paid", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Paid = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PublisherAddedEvent) 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 ErrIntOverflowEvents + } + 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: PublisherAddedEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PublisherAddedEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Publisher", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Publisher == nil { + m.Publisher = &Publisher{} + } + if err := m.Publisher.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PublisherUpdatedEvent) 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 ErrIntOverflowEvents + } + 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: PublisherUpdatedEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PublisherUpdatedEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Publisher", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Publisher == nil { + m.Publisher = &Publisher{} + } + if err := m.Publisher.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AcceptedDomainAddedEvent) 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 ErrIntOverflowEvents + } + 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: AcceptedDomainAddedEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AcceptedDomainAddedEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AcceptedDomain", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AcceptedDomain == nil { + m.AcceptedDomain = &AcceptedDomain{} + } + if err := m.AcceptedDomain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AcceptedDomainUpdatedEvent) 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 ErrIntOverflowEvents + } + 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: AcceptedDomainUpdatedEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AcceptedDomainUpdatedEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AcceptedDomain", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AcceptedDomain == nil { + m.AcceptedDomain = &AcceptedDomain{} + } + if err := m.AcceptedDomain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(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, ErrIntOverflowEvents + } + 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, ErrIntOverflowEvents + } + 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, ErrIntOverflowEvents + } + 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, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/cointrunk/types/query.pb.go b/x/cointrunk/types/query.pb.go index 564a9183..f3080e08 100644 --- a/x/cointrunk/types/query.pb.go +++ b/x/cointrunk/types/query.pb.go @@ -675,7 +675,7 @@ type QueryClient interface { Publisher(ctx context.Context, in *QueryPublisherRequest, opts ...grpc.CallOption) (*QueryPublisherResponse, error) // Queries publisher by index/address. PublisherByIndex(ctx context.Context, in *QueryPublisherByIndexRequest, opts ...grpc.CallOption) (*QueryPublisherByIndexResponse, error) - // Queries a list of ArticlesByPrefix items. + // Queries a list of Article items. AllArticles(ctx context.Context, in *QueryAllArticlesRequest, opts ...grpc.CallOption) (*QueryAllArticlesResponse, error) // Queries a list of AllAnonArticlesCounters items. AllAnonArticlesCounters(ctx context.Context, in *QueryAllAnonArticlesCountersRequest, opts ...grpc.CallOption) (*QueryAllAnonArticlesCountersResponse, error) @@ -753,7 +753,7 @@ type QueryServer interface { Publisher(context.Context, *QueryPublisherRequest) (*QueryPublisherResponse, error) // Queries publisher by index/address. PublisherByIndex(context.Context, *QueryPublisherByIndexRequest) (*QueryPublisherByIndexResponse, error) - // Queries a list of ArticlesByPrefix items. + // Queries a list of Article items. AllArticles(context.Context, *QueryAllArticlesRequest) (*QueryAllArticlesResponse, error) // Queries a list of AllAnonArticlesCounters items. AllAnonArticlesCounters(context.Context, *QueryAllAnonArticlesCountersRequest) (*QueryAllAnonArticlesCountersResponse, error) From 6365ce87c6a63eef4fdd064c3d914dfa25b73b0a Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Wed, 28 Dec 2022 23:14:42 +0200 Subject: [PATCH 49/54] emit event on publisher respect paid --- config.yml | 5 +- proto/cointrunk/events.proto | 7 + .../bze/bze.cointrunk.v1/index.ts | 36 +- .../bze/bze.cointrunk.v1/module/index.ts | 6 +- .../module/types/cointrunk/events.ts | 147 ++++++++ .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +- .../bze/bze.scavenge/module/index.ts | 12 +- .../msg_server_pay_publisher_respect.go | 11 + x/cointrunk/types/events.pb.go | 323 ++++++++++++++++-- 9 files changed, 515 insertions(+), 64 deletions(-) diff --git a/config.yml b/config.yml index 1f14a3c8..c42157bb 100644 --- a/config.yml +++ b/config.yml @@ -38,4 +38,7 @@ genesis: anonArticleLimit: 5 anonArticleCost: denom: "utestbze" - amount: "25000000000" \ No newline at end of file + amount: "25000000000" + publisher_respect_params: + denom: "utestbze" + tax: "0.200000000000" \ No newline at end of file diff --git a/proto/cointrunk/events.proto b/proto/cointrunk/events.proto index b8e3c04f..fc8a2b6a 100644 --- a/proto/cointrunk/events.proto +++ b/proto/cointrunk/events.proto @@ -26,4 +26,11 @@ message AcceptedDomainAddedEvent { message AcceptedDomainUpdatedEvent { AcceptedDomain accepted_domain = 1; +} + +message PublisherRespectPaidEvent { + uint64 respect_paid = 1; + uint64 publisher_reward = 2; + uint64 community_pool_funds = 3; + string publisher = 4; } \ No newline at end of file diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts index c37d06c8..ee14d6e0 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts @@ -9,13 +9,14 @@ import { PublisherAddedEvent } from "./module/types/cointrunk/events" import { PublisherUpdatedEvent } from "./module/types/cointrunk/events" import { AcceptedDomainAddedEvent } from "./module/types/cointrunk/events" import { AcceptedDomainUpdatedEvent } from "./module/types/cointrunk/events" +import { PublisherRespectPaidEvent } from "./module/types/cointrunk/events" import { PublisherRespectParams } from "./module/types/cointrunk/params" import { Params } from "./module/types/cointrunk/params" import { Publisher } from "./module/types/cointrunk/publisher" import { PublisherProposal } from "./module/types/cointrunk/publisher_proposal" -export { AcceptedDomain, AcceptedDomainProposal, AnonArticlesCounter, Article, ArticleAddedEvent, PublisherAddedEvent, PublisherUpdatedEvent, AcceptedDomainAddedEvent, AcceptedDomainUpdatedEvent, PublisherRespectParams, Params, Publisher, PublisherProposal }; +export { AcceptedDomain, AcceptedDomainProposal, AnonArticlesCounter, Article, ArticleAddedEvent, PublisherAddedEvent, PublisherUpdatedEvent, AcceptedDomainAddedEvent, AcceptedDomainUpdatedEvent, PublisherRespectPaidEvent, PublisherRespectParams, Params, Publisher, PublisherProposal }; async function initTxClient(vuexGetters) { return await txClient(vuexGetters['common/wallet/signer'], { @@ -70,6 +71,7 @@ const getDefaultState = () => { PublisherUpdatedEvent: getStructure(PublisherUpdatedEvent.fromPartial({})), AcceptedDomainAddedEvent: getStructure(AcceptedDomainAddedEvent.fromPartial({})), AcceptedDomainUpdatedEvent: getStructure(AcceptedDomainUpdatedEvent.fromPartial({})), + PublisherRespectPaidEvent: getStructure(PublisherRespectPaidEvent.fromPartial({})), PublisherRespectParams: getStructure(PublisherRespectParams.fromPartial({})), Params: getStructure(Params.fromPartial({})), Publisher: getStructure(Publisher.fromPartial({})), @@ -320,60 +322,60 @@ export default { }, - async sendMsgAddArticle({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgPayPublisherRespect({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgAddArticle(value) + const msg = await txClient.msgPayPublisherRespect(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgAddArticle:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgPayPublisherRespect:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgPayPublisherRespect({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgAddArticle({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgPayPublisherRespect(value) + const msg = await txClient.msgAddArticle(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgPayPublisherRespect:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgAddArticle:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgAddArticle({ rootGetters }, { value }) { + async MsgPayPublisherRespect({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgAddArticle(value) + const msg = await txClient.msgPayPublisherRespect(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgAddArticle:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgPayPublisherRespect:Create Could not create message: ' + e.message) } } }, - async MsgPayPublisherRespect({ rootGetters }, { value }) { + async MsgAddArticle({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgPayPublisherRespect(value) + const msg = await txClient.msgAddArticle(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgPayPublisherRespect:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgAddArticle:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts index 71fe5dc5..9119ba33 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts @@ -4,13 +4,13 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgAddArticle } from "./types/cointrunk/tx"; import { MsgPayPublisherRespect } from "./types/cointrunk/tx"; +import { MsgAddArticle } from "./types/cointrunk/tx"; const types = [ - ["/bze.cointrunk.v1.MsgAddArticle", MsgAddArticle], ["/bze.cointrunk.v1.MsgPayPublisherRespect", MsgPayPublisherRespect], + ["/bze.cointrunk.v1.MsgAddArticle", MsgAddArticle], ]; export const MissingWalletError = new Error("wallet is required"); @@ -43,8 +43,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgAddArticle: (data: MsgAddArticle): EncodeObject => ({ typeUrl: "/bze.cointrunk.v1.MsgAddArticle", value: MsgAddArticle.fromPartial( data ) }), msgPayPublisherRespect: (data: MsgPayPublisherRespect): EncodeObject => ({ typeUrl: "/bze.cointrunk.v1.MsgPayPublisherRespect", value: MsgPayPublisherRespect.fromPartial( data ) }), + msgAddArticle: (data: MsgAddArticle): EncodeObject => ({ typeUrl: "/bze.cointrunk.v1.MsgAddArticle", value: MsgAddArticle.fromPartial( data ) }), }; }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/events.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/events.ts index 1cf873af..678390b8 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/events.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/events.ts @@ -28,6 +28,13 @@ export interface AcceptedDomainUpdatedEvent { accepted_domain: AcceptedDomain | undefined; } +export interface PublisherRespectPaidEvent { + respect_paid: number; + publisher_reward: number; + community_pool_funds: number; + publisher: string; +} + const baseArticleAddedEvent: object = { publisher: "", article_id: 0, @@ -417,6 +424,146 @@ export const AcceptedDomainUpdatedEvent = { }, }; +const basePublisherRespectPaidEvent: object = { + respect_paid: 0, + publisher_reward: 0, + community_pool_funds: 0, + publisher: "", +}; + +export const PublisherRespectPaidEvent = { + encode( + message: PublisherRespectPaidEvent, + writer: Writer = Writer.create() + ): Writer { + if (message.respect_paid !== 0) { + writer.uint32(8).uint64(message.respect_paid); + } + if (message.publisher_reward !== 0) { + writer.uint32(16).uint64(message.publisher_reward); + } + if (message.community_pool_funds !== 0) { + writer.uint32(24).uint64(message.community_pool_funds); + } + if (message.publisher !== "") { + writer.uint32(34).string(message.publisher); + } + return writer; + }, + + decode( + input: Reader | Uint8Array, + length?: number + ): PublisherRespectPaidEvent { + const reader = input instanceof Uint8Array ? new Reader(input) : input; + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePublisherRespectPaidEvent, + } as PublisherRespectPaidEvent; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.respect_paid = longToNumber(reader.uint64() as Long); + break; + case 2: + message.publisher_reward = longToNumber(reader.uint64() as Long); + break; + case 3: + message.community_pool_funds = longToNumber(reader.uint64() as Long); + break; + case 4: + message.publisher = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PublisherRespectPaidEvent { + const message = { + ...basePublisherRespectPaidEvent, + } as PublisherRespectPaidEvent; + if (object.respect_paid !== undefined && object.respect_paid !== null) { + message.respect_paid = Number(object.respect_paid); + } else { + message.respect_paid = 0; + } + if ( + object.publisher_reward !== undefined && + object.publisher_reward !== null + ) { + message.publisher_reward = Number(object.publisher_reward); + } else { + message.publisher_reward = 0; + } + if ( + object.community_pool_funds !== undefined && + object.community_pool_funds !== null + ) { + message.community_pool_funds = Number(object.community_pool_funds); + } else { + message.community_pool_funds = 0; + } + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = String(object.publisher); + } else { + message.publisher = ""; + } + return message; + }, + + toJSON(message: PublisherRespectPaidEvent): unknown { + const obj: any = {}; + message.respect_paid !== undefined && + (obj.respect_paid = message.respect_paid); + message.publisher_reward !== undefined && + (obj.publisher_reward = message.publisher_reward); + message.community_pool_funds !== undefined && + (obj.community_pool_funds = message.community_pool_funds); + message.publisher !== undefined && (obj.publisher = message.publisher); + return obj; + }, + + fromPartial( + object: DeepPartial + ): PublisherRespectPaidEvent { + const message = { + ...basePublisherRespectPaidEvent, + } as PublisherRespectPaidEvent; + if (object.respect_paid !== undefined && object.respect_paid !== null) { + message.respect_paid = object.respect_paid; + } else { + message.respect_paid = 0; + } + if ( + object.publisher_reward !== undefined && + object.publisher_reward !== null + ) { + message.publisher_reward = object.publisher_reward; + } else { + message.publisher_reward = 0; + } + if ( + object.community_pool_funds !== undefined && + object.community_pool_funds !== null + ) { + message.community_pool_funds = object.community_pool_funds; + } else { + message.community_pool_funds = 0; + } + if (object.publisher !== undefined && object.publisher !== null) { + message.publisher = object.publisher; + } else { + message.publisher = ""; + } + return message; + }, +}; + declare var self: any | undefined; declare var window: any | undefined; var globalThis: any = (() => { diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 36486b56..155d50b2 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,18 +232,18 @@ export default { }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgRevealSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, @@ -262,32 +262,32 @@ export default { } } }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgSubmitScavenge(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgRevealSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, @@ -304,16 +304,16 @@ export default { } } }, - async MsgRevealSolution({ rootGetters }, { value }) { + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgSubmitScavenge(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 27b7f752..9a3de64c 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; -import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; +import { MsgCommitSolution } from "./types/scavenge/tx"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], - ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], + ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), - msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), + msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/keeper/msg_server_pay_publisher_respect.go b/x/cointrunk/keeper/msg_server_pay_publisher_respect.go index cdeeec1e..66e8172b 100644 --- a/x/cointrunk/keeper/msg_server_pay_publisher_respect.go +++ b/x/cointrunk/keeper/msg_server_pay_publisher_respect.go @@ -74,6 +74,17 @@ func (k msgServer) PayPublisherRespect(goCtx context.Context, msg *types.MsgPayP publisher.Respect += coin.Amount.Int64() k.SetPublisher(ctx, publisher) + + err = ctx.EventManager().EmitTypedEvent(&types.PublisherRespectPaidEvent{ + Publisher: publisher.Address, + RespectPaid: coin.Amount.Uint64(), + CommunityPoolFunds: taxPaidCoin.Amount.Uint64(), + PublisherReward: publisherRewardCoin.Amount.Uint64(), + }) + if err != nil { + return nil, err + } + _ = ctx return &types.MsgPayPublisherRespectResponse{ diff --git a/x/cointrunk/types/events.pb.go b/x/cointrunk/types/events.pb.go index d7eca083..9e52c973 100644 --- a/x/cointrunk/types/events.pb.go +++ b/x/cointrunk/types/events.pb.go @@ -258,38 +258,113 @@ func (m *AcceptedDomainUpdatedEvent) GetAcceptedDomain() *AcceptedDomain { return nil } +type PublisherRespectPaidEvent struct { + RespectPaid uint64 `protobuf:"varint,1,opt,name=respect_paid,json=respectPaid,proto3" json:"respect_paid,omitempty"` + PublisherReward uint64 `protobuf:"varint,2,opt,name=publisher_reward,json=publisherReward,proto3" json:"publisher_reward,omitempty"` + CommunityPoolFunds uint64 `protobuf:"varint,3,opt,name=community_pool_funds,json=communityPoolFunds,proto3" json:"community_pool_funds,omitempty"` + Publisher string `protobuf:"bytes,4,opt,name=publisher,proto3" json:"publisher,omitempty"` +} + +func (m *PublisherRespectPaidEvent) Reset() { *m = PublisherRespectPaidEvent{} } +func (m *PublisherRespectPaidEvent) String() string { return proto.CompactTextString(m) } +func (*PublisherRespectPaidEvent) ProtoMessage() {} +func (*PublisherRespectPaidEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_047659f6c6782b45, []int{5} +} +func (m *PublisherRespectPaidEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PublisherRespectPaidEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PublisherRespectPaidEvent.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 *PublisherRespectPaidEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_PublisherRespectPaidEvent.Merge(m, src) +} +func (m *PublisherRespectPaidEvent) XXX_Size() int { + return m.Size() +} +func (m *PublisherRespectPaidEvent) XXX_DiscardUnknown() { + xxx_messageInfo_PublisherRespectPaidEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_PublisherRespectPaidEvent proto.InternalMessageInfo + +func (m *PublisherRespectPaidEvent) GetRespectPaid() uint64 { + if m != nil { + return m.RespectPaid + } + return 0 +} + +func (m *PublisherRespectPaidEvent) GetPublisherReward() uint64 { + if m != nil { + return m.PublisherReward + } + return 0 +} + +func (m *PublisherRespectPaidEvent) GetCommunityPoolFunds() uint64 { + if m != nil { + return m.CommunityPoolFunds + } + return 0 +} + +func (m *PublisherRespectPaidEvent) GetPublisher() string { + if m != nil { + return m.Publisher + } + return "" +} + func init() { proto.RegisterType((*ArticleAddedEvent)(nil), "bze.cointrunk.v1.ArticleAddedEvent") proto.RegisterType((*PublisherAddedEvent)(nil), "bze.cointrunk.v1.PublisherAddedEvent") proto.RegisterType((*PublisherUpdatedEvent)(nil), "bze.cointrunk.v1.PublisherUpdatedEvent") proto.RegisterType((*AcceptedDomainAddedEvent)(nil), "bze.cointrunk.v1.AcceptedDomainAddedEvent") proto.RegisterType((*AcceptedDomainUpdatedEvent)(nil), "bze.cointrunk.v1.AcceptedDomainUpdatedEvent") + proto.RegisterType((*PublisherRespectPaidEvent)(nil), "bze.cointrunk.v1.PublisherRespectPaidEvent") } func init() { proto.RegisterFile("cointrunk/events.proto", fileDescriptor_047659f6c6782b45) } var fileDescriptor_047659f6c6782b45 = []byte{ - // 317 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4b, 0xce, 0xcf, 0xcc, - 0x2b, 0x29, 0x2a, 0xcd, 0xcb, 0xd6, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, - 0x2f, 0xc9, 0x17, 0x12, 0x48, 0xaa, 0x4a, 0xd5, 0x83, 0xcb, 0xe9, 0x95, 0x19, 0x4a, 0x49, 0x22, - 0x54, 0x16, 0x94, 0x26, 0xe5, 0x64, 0x16, 0x67, 0xa4, 0x16, 0x41, 0x14, 0x4b, 0xc9, 0x23, 0xa4, - 0x12, 0x93, 0x93, 0x53, 0x0b, 0x4a, 0x52, 0x53, 0xe2, 0x53, 0xf2, 0x73, 0x13, 0x33, 0xf3, 0x20, - 0x0a, 0x94, 0x52, 0xb8, 0x04, 0x1d, 0x8b, 0x4a, 0x32, 0x93, 0x73, 0x52, 0x1d, 0x53, 0x52, 0x52, - 0x53, 0x5c, 0x41, 0x36, 0x09, 0xc9, 0x70, 0x71, 0xc2, 0x0d, 0x92, 0x60, 0x54, 0x60, 0xd4, 0xe0, - 0x0c, 0x42, 0x08, 0x08, 0xc9, 0x72, 0x71, 0x25, 0x42, 0xb4, 0xc4, 0x67, 0xa6, 0x48, 0x30, 0x29, - 0x30, 0x6a, 0xb0, 0x04, 0x71, 0x42, 0x45, 0x3c, 0x53, 0x84, 0x84, 0xb8, 0x58, 0x0a, 0x12, 0x33, - 0x53, 0x24, 0x98, 0x15, 0x18, 0x35, 0x38, 0x82, 0xc0, 0x6c, 0xa5, 0x00, 0x2e, 0xe1, 0x00, 0x98, - 0x7e, 0x24, 0x7b, 0x2c, 0xd1, 0xed, 0xe1, 0x36, 0x92, 0xd6, 0x43, 0xf7, 0x9e, 0x1e, 0x5c, 0x27, - 0x92, 0x23, 0x94, 0x82, 0xb8, 0x44, 0xe1, 0xe2, 0xa1, 0x05, 0x29, 0x89, 0x25, 0x54, 0x30, 0x33, - 0x95, 0x4b, 0xc2, 0x11, 0x1a, 0x48, 0x2e, 0xe0, 0x30, 0x42, 0x72, 0xaa, 0x27, 0x17, 0x3f, 0x5a, - 0x00, 0x42, 0x0d, 0x57, 0xc0, 0x34, 0x1c, 0xd5, 0x90, 0x20, 0xbe, 0x44, 0x14, 0xbe, 0x52, 0x3a, - 0x97, 0x14, 0xaa, 0x0a, 0x14, 0xf7, 0x53, 0xcf, 0x22, 0x27, 0x8f, 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, 0xd2, 0x4b, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, - 0xd5, 0x4f, 0xaa, 0x4a, 0xd5, 0x4d, 0xcc, 0x29, 0xc8, 0x48, 0x2c, 0x49, 0x4d, 0x04, 0xf3, 0xf4, - 0x2b, 0xf4, 0x11, 0xa9, 0xa6, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x9c, 0x58, 0x8c, 0x01, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x00, 0xd8, 0xb3, 0x17, 0x94, 0x02, 0x00, 0x00, + // 405 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0xcb, 0x6e, 0x9b, 0x40, + 0x14, 0xf5, 0xb4, 0xa8, 0xaa, 0xc7, 0x55, 0xed, 0x4e, 0x1f, 0xc2, 0x6e, 0x4b, 0x29, 0x2b, 0x77, + 0x51, 0xe8, 0x63, 0xd5, 0xa5, 0xab, 0x36, 0x8a, 0x77, 0x08, 0x29, 0x9b, 0x6c, 0xd0, 0xc0, 0x4c, + 0xec, 0x51, 0x80, 0x19, 0x0d, 0x83, 0x13, 0xfb, 0x2b, 0xf2, 0x3b, 0xf9, 0x83, 0x2c, 0xbd, 0xcc, + 0x32, 0xb2, 0x7f, 0x24, 0x32, 0x60, 0x30, 0x64, 0xeb, 0x1d, 0x9c, 0x7b, 0xee, 0x39, 0x77, 0xee, + 0x3d, 0xf0, 0x43, 0xc8, 0x59, 0xa2, 0x64, 0x96, 0x5c, 0x3a, 0x74, 0x41, 0x13, 0x95, 0xda, 0x42, + 0x72, 0xc5, 0xd1, 0x20, 0x58, 0x51, 0xbb, 0xaa, 0xd9, 0x8b, 0x9f, 0xa3, 0x61, 0xcd, 0x14, 0x59, + 0x10, 0xb1, 0x74, 0x4e, 0x65, 0x41, 0x1e, 0x7d, 0xa9, 0x4b, 0x38, 0x0c, 0xa9, 0x50, 0x94, 0xf8, + 0x84, 0xc7, 0x98, 0x25, 0x05, 0xc1, 0x22, 0xf0, 0xcd, 0x44, 0x2a, 0x16, 0x46, 0x74, 0x42, 0x08, + 0x25, 0xff, 0x77, 0x4e, 0xe8, 0x13, 0xec, 0x56, 0x42, 0x3a, 0x30, 0xc1, 0xb8, 0xeb, 0xd5, 0x00, + 0xfa, 0x0c, 0x21, 0x2e, 0x5a, 0x7c, 0x46, 0xf4, 0x67, 0x26, 0x18, 0x6b, 0x5e, 0xb7, 0x44, 0xa6, + 0x04, 0x21, 0xa8, 0x09, 0xcc, 0x88, 0xfe, 0xdc, 0x04, 0xe3, 0x97, 0x5e, 0xfe, 0x6d, 0xb9, 0xf0, + 0xad, 0xbb, 0xef, 0x3f, 0xf0, 0xf9, 0xd3, 0xf6, 0xe9, 0xfd, 0xfa, 0x68, 0xb7, 0x9f, 0x67, 0x57, + 0x9d, 0x07, 0x43, 0x58, 0x1e, 0x7c, 0x5f, 0xe1, 0x67, 0x82, 0x60, 0x75, 0x04, 0x4d, 0x0a, 0xf5, + 0x49, 0xb9, 0xa4, 0x7f, 0xf9, 0x8e, 0x0e, 0x46, 0x9d, 0xc2, 0x7e, 0x6b, 0x81, 0xa5, 0xb8, 0xf9, + 0x54, 0xbc, 0x29, 0xe2, 0xbd, 0xc6, 0x8d, 0x7f, 0x6b, 0x06, 0x47, 0x4d, 0x46, 0x63, 0xfe, 0x23, + 0x1a, 0xdd, 0x02, 0x38, 0xac, 0x1f, 0x4a, 0x53, 0x41, 0x43, 0xe5, 0x62, 0x56, 0x1a, 0x7d, 0x85, + 0xaf, 0x64, 0x81, 0xf9, 0xf9, 0xbd, 0x40, 0x7e, 0xc8, 0x9e, 0xac, 0x79, 0xe8, 0x1b, 0x1c, 0x54, + 0xdb, 0xf1, 0x25, 0xbd, 0xc2, 0x72, 0x7f, 0xef, 0xbe, 0xa8, 0x75, 0x77, 0x30, 0xfa, 0x01, 0xdf, + 0x85, 0x3c, 0x8e, 0xb3, 0x84, 0xa9, 0xa5, 0x2f, 0x38, 0x8f, 0xfc, 0x8b, 0x2c, 0x21, 0x69, 0x9e, + 0x02, 0xcd, 0x43, 0x55, 0xcd, 0xe5, 0x3c, 0x3a, 0xd9, 0x55, 0x9a, 0x21, 0xd3, 0x5a, 0x21, 0xfb, + 0x7b, 0x7a, 0xb7, 0x31, 0xc0, 0x7a, 0x63, 0x80, 0x87, 0x8d, 0x01, 0x6e, 0xb6, 0x46, 0x67, 0xbd, + 0x35, 0x3a, 0xf7, 0x5b, 0xa3, 0x73, 0x6e, 0xcf, 0x98, 0x9a, 0x67, 0x81, 0x1d, 0xf2, 0xd8, 0x09, + 0x56, 0xf4, 0x3b, 0x8e, 0xc4, 0x1c, 0x2b, 0x8a, 0xf3, 0x3f, 0xe7, 0xda, 0xa9, 0x13, 0xaf, 0x96, + 0x82, 0xa6, 0xc1, 0x8b, 0x3c, 0xe8, 0xbf, 0x1f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x01, 0xcf, + 0x27, 0x50, 0x03, 0x00, 0x00, } func (m *ArticleAddedEvent) Marshal() (dAtA []byte, err error) { @@ -477,6 +552,51 @@ func (m *AcceptedDomainUpdatedEvent) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *PublisherRespectPaidEvent) 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 *PublisherRespectPaidEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PublisherRespectPaidEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Publisher) > 0 { + i -= len(m.Publisher) + copy(dAtA[i:], m.Publisher) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Publisher))) + i-- + dAtA[i] = 0x22 + } + if m.CommunityPoolFunds != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.CommunityPoolFunds)) + i-- + dAtA[i] = 0x18 + } + if m.PublisherReward != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.PublisherReward)) + i-- + dAtA[i] = 0x10 + } + if m.RespectPaid != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.RespectPaid)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { offset -= sovEvents(v) base := offset @@ -559,6 +679,28 @@ func (m *AcceptedDomainUpdatedEvent) Size() (n int) { return n } +func (m *PublisherRespectPaidEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RespectPaid != 0 { + n += 1 + sovEvents(uint64(m.RespectPaid)) + } + if m.PublisherReward != 0 { + n += 1 + sovEvents(uint64(m.PublisherReward)) + } + if m.CommunityPoolFunds != 0 { + n += 1 + sovEvents(uint64(m.CommunityPoolFunds)) + } + l = len(m.Publisher) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + func sovEvents(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1030,6 +1172,145 @@ func (m *AcceptedDomainUpdatedEvent) Unmarshal(dAtA []byte) error { } return nil } +func (m *PublisherRespectPaidEvent) 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 ErrIntOverflowEvents + } + 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: PublisherRespectPaidEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PublisherRespectPaidEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RespectPaid", wireType) + } + m.RespectPaid = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RespectPaid |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PublisherReward", wireType) + } + m.PublisherReward = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PublisherReward |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CommunityPoolFunds", wireType) + } + m.CommunityPoolFunds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CommunityPoolFunds |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Publisher", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Publisher = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipEvents(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 9b35272c55a8bd2a883a836a0827d4019de59843 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Thu, 29 Dec 2022 23:54:43 +0200 Subject: [PATCH 50/54] send article tax to community fund --- .../bze/bze.cointrunk.v1/index.ts | 32 +++++++++---------- .../bze/bze.cointrunk.v1/module/index.ts | 6 ++-- .../bze-alphateam/bze/bze.scavenge/index.ts | 32 +++++++++---------- .../bze/bze.scavenge/module/index.ts | 12 +++---- x/cointrunk/keeper/msg_server_add_article.go | 3 +- x/cointrunk/types/expected_keepers.go | 1 - 6 files changed, 42 insertions(+), 44 deletions(-) diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts index ee14d6e0..7cf38e1c 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts @@ -322,60 +322,60 @@ export default { }, - async sendMsgPayPublisherRespect({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgAddArticle({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgPayPublisherRespect(value) + const msg = await txClient.msgAddArticle(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgPayPublisherRespect:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgAddArticle:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgAddArticle({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgPayPublisherRespect({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgAddArticle(value) + const msg = await txClient.msgPayPublisherRespect(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgAddArticle:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgPayPublisherRespect:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgPayPublisherRespect({ rootGetters }, { value }) { + async MsgAddArticle({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgPayPublisherRespect(value) + const msg = await txClient.msgAddArticle(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgPayPublisherRespect:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgAddArticle:Create Could not create message: ' + e.message) } } }, - async MsgAddArticle({ rootGetters }, { value }) { + async MsgPayPublisherRespect({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgAddArticle(value) + const msg = await txClient.msgPayPublisherRespect(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgAddArticle:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgPayPublisherRespect:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts index 9119ba33..71fe5dc5 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts @@ -4,13 +4,13 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgPayPublisherRespect } from "./types/cointrunk/tx"; import { MsgAddArticle } from "./types/cointrunk/tx"; +import { MsgPayPublisherRespect } from "./types/cointrunk/tx"; const types = [ - ["/bze.cointrunk.v1.MsgPayPublisherRespect", MsgPayPublisherRespect], ["/bze.cointrunk.v1.MsgAddArticle", MsgAddArticle], + ["/bze.cointrunk.v1.MsgPayPublisherRespect", MsgPayPublisherRespect], ]; export const MissingWalletError = new Error("wallet is required"); @@ -43,8 +43,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgPayPublisherRespect: (data: MsgPayPublisherRespect): EncodeObject => ({ typeUrl: "/bze.cointrunk.v1.MsgPayPublisherRespect", value: MsgPayPublisherRespect.fromPartial( data ) }), msgAddArticle: (data: MsgAddArticle): EncodeObject => ({ typeUrl: "/bze.cointrunk.v1.MsgAddArticle", value: MsgAddArticle.fromPartial( data ) }), + msgPayPublisherRespect: (data: MsgPayPublisherRespect): EncodeObject => ({ typeUrl: "/bze.cointrunk.v1.MsgPayPublisherRespect", value: MsgPayPublisherRespect.fromPartial( data ) }), }; }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 155d50b2..36486b56 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,18 +232,18 @@ export default { }, - async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgSubmitScavenge(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, @@ -262,32 +262,32 @@ export default { } } }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevealSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgRevealSolution(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevealSolution:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgRevealSolution({ rootGetters }, { value }) { + async MsgSubmitScavenge({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRevealSolution(value) + const msg = await txClient.msgSubmitScavenge(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) } } }, @@ -304,16 +304,16 @@ export default { } } }, - async MsgSubmitScavenge({ rootGetters }, { value }) { + async MsgRevealSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) + const msg = await txClient.msgRevealSolution(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevealSolution:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevealSolution:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 9a3de64c..27b7f752 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgRevealSolution } from "./types/scavenge/tx"; -import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgSubmitScavenge } from "./types/scavenge/tx"; +import { MsgCommitSolution } from "./types/scavenge/tx"; +import { MsgRevealSolution } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], - ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], + ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], + ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), - msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), + msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), + msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/keeper/msg_server_add_article.go b/x/cointrunk/keeper/msg_server_add_article.go index e0c24c40..ee62ec16 100644 --- a/x/cointrunk/keeper/msg_server_add_article.go +++ b/x/cointrunk/keeper/msg_server_add_article.go @@ -2,7 +2,6 @@ package keeper import ( "context" - burnermoduletypes "github.com/bze-alphateam/bze/x/burner/types" "github.com/bze-alphateam/bze/x/cointrunk/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -30,7 +29,7 @@ func (k msgServer) AddArticle(goCtx context.Context, msg *types.MsgAddArticle) ( panic(err) } - sdkErr := k.bankKeeper.SendCoinsFromAccountToModule(ctx, publisherAcc, burnermoduletypes.ModuleName, articleCost) + sdkErr := k.distrKeeper.FundCommunityPool(ctx, articleCost, publisherAcc) if sdkErr != nil { return nil, sdkErr } diff --git a/x/cointrunk/types/expected_keepers.go b/x/cointrunk/types/expected_keepers.go index 50c1bade..326a1f8a 100644 --- a/x/cointrunk/types/expected_keepers.go +++ b/x/cointrunk/types/expected_keepers.go @@ -15,7 +15,6 @@ type AccountKeeper interface { // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error // Methods imported from bank should be defined here } From f025fe5d6ca1da8a629813be2ebd22a2a756b145 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Fri, 30 Dec 2022 17:07:47 +0200 Subject: [PATCH 51/54] modified proto files from snake case to camel_case --- docs/static/openapi.yml | 26 +++--- proto/cointrunk/publisher.proto | 4 +- proto/cointrunk/tx.proto | 6 +- .../bze/bze.cointrunk.v1/index.ts | 32 +++---- .../bze/bze.cointrunk.v1/module/index.ts | 6 +- .../bze/bze.cointrunk.v1/module/rest.ts | 10 +-- .../module/types/cointrunk/publisher.ts | 50 +++++------ .../module/types/cointrunk/tx.ts | 86 +++++++++---------- .../bze-alphateam/bze/bze.scavenge/index.ts | 40 ++++----- .../bze/bze.scavenge/module/index.ts | 6 +- x/cointrunk/types/publisher.pb.go | 39 +++++---- x/cointrunk/types/tx.pb.go | 58 +++++++------ 12 files changed, 183 insertions(+), 180 deletions(-) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index af061b5a..805b4c51 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -626,10 +626,10 @@ paths: type: string active: type: boolean - articlesCount: + articles_count: type: integer format: int64 - createdAt: + created_at: type: string format: int64 respect: @@ -681,10 +681,10 @@ paths: type: string active: type: boolean - articlesCount: + articles_count: type: integer format: int64 - createdAt: + created_at: type: string format: int64 respect: @@ -32715,13 +32715,13 @@ definitions: bze.cointrunk.v1.MsgPayPublisherRespectResponse: type: object properties: - respectPaid: + respect_paid: type: string format: uint64 - publisherReward: + publisher_reward: type: string format: uint64 - communityPoolFunds: + community_pool_funds: type: string format: uint64 bze.cointrunk.v1.Params: @@ -32759,10 +32759,10 @@ definitions: type: string active: type: boolean - articlesCount: + articles_count: type: integer format: int64 - createdAt: + created_at: type: string format: int64 respect: @@ -32946,10 +32946,10 @@ definitions: type: string active: type: boolean - articlesCount: + articles_count: type: integer format: int64 - createdAt: + created_at: type: string format: int64 respect: @@ -32969,10 +32969,10 @@ definitions: type: string active: type: boolean - articlesCount: + articles_count: type: integer format: int64 - createdAt: + created_at: type: string format: int64 respect: diff --git a/proto/cointrunk/publisher.proto b/proto/cointrunk/publisher.proto index ca4f3a43..c9fea245 100644 --- a/proto/cointrunk/publisher.proto +++ b/proto/cointrunk/publisher.proto @@ -8,7 +8,7 @@ message Publisher { string name = 1; string address = 2; bool active = 3; - uint32 articlesCount = 4; - int64 createdAt = 5; + uint32 articles_count = 4; + int64 created_at = 5; int64 respect = 6; } diff --git a/proto/cointrunk/tx.proto b/proto/cointrunk/tx.proto index 1638cc6b..6a334c82 100644 --- a/proto/cointrunk/tx.proto +++ b/proto/cointrunk/tx.proto @@ -29,9 +29,9 @@ message MsgPayPublisherRespect { } message MsgPayPublisherRespectResponse { - uint64 respectPaid = 1; - uint64 publisherReward = 2; - uint64 communityPoolFunds = 3; + uint64 respect_paid = 1; + uint64 publisher_reward = 2; + uint64 community_pool_funds = 3; } // this line is used by starport scaffolding # proto/tx/message \ No newline at end of file diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts index 7cf38e1c..ee14d6e0 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/index.ts @@ -322,60 +322,60 @@ export default { }, - async sendMsgAddArticle({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgPayPublisherRespect({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgAddArticle(value) + const msg = await txClient.msgPayPublisherRespect(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgAddArticle:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgPayPublisherRespect:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgPayPublisherRespect({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgAddArticle({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgPayPublisherRespect(value) + const msg = await txClient.msgAddArticle(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgPayPublisherRespect:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgAddArticle:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgAddArticle({ rootGetters }, { value }) { + async MsgPayPublisherRespect({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgAddArticle(value) + const msg = await txClient.msgPayPublisherRespect(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgAddArticle:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgPayPublisherRespect:Create Could not create message: ' + e.message) } } }, - async MsgPayPublisherRespect({ rootGetters }, { value }) { + async MsgAddArticle({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgPayPublisherRespect(value) + const msg = await txClient.msgAddArticle(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgPayPublisherRespect:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgAddArticle:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgPayPublisherRespect:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgAddArticle:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts index 71fe5dc5..9119ba33 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/index.ts @@ -4,13 +4,13 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgAddArticle } from "./types/cointrunk/tx"; import { MsgPayPublisherRespect } from "./types/cointrunk/tx"; +import { MsgAddArticle } from "./types/cointrunk/tx"; const types = [ - ["/bze.cointrunk.v1.MsgAddArticle", MsgAddArticle], ["/bze.cointrunk.v1.MsgPayPublisherRespect", MsgPayPublisherRespect], + ["/bze.cointrunk.v1.MsgAddArticle", MsgAddArticle], ]; export const MissingWalletError = new Error("wallet is required"); @@ -43,8 +43,8 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgAddArticle: (data: MsgAddArticle): EncodeObject => ({ typeUrl: "/bze.cointrunk.v1.MsgAddArticle", value: MsgAddArticle.fromPartial( data ) }), msgPayPublisherRespect: (data: MsgPayPublisherRespect): EncodeObject => ({ typeUrl: "/bze.cointrunk.v1.MsgPayPublisherRespect", value: MsgPayPublisherRespect.fromPartial( data ) }), + msgAddArticle: (data: MsgAddArticle): EncodeObject => ({ typeUrl: "/bze.cointrunk.v1.MsgAddArticle", value: MsgAddArticle.fromPartial( data ) }), }; }; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts index b621b8bf..bf580212 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/rest.ts @@ -49,13 +49,13 @@ export type V1MsgAddArticleResponse = object; export interface V1MsgPayPublisherRespectResponse { /** @format uint64 */ - respectPaid?: string; + respect_paid?: string; /** @format uint64 */ - publisherReward?: string; + publisher_reward?: string; /** @format uint64 */ - communityPoolFunds?: string; + community_pool_funds?: string; } export interface V1Params { @@ -80,10 +80,10 @@ export interface V1Publisher { active?: boolean; /** @format int64 */ - articlesCount?: number; + articles_count?: number; /** @format int64 */ - createdAt?: string; + created_at?: string; /** @format int64 */ respect?: string; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/publisher.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/publisher.ts index e3741382..1f0cbe91 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/publisher.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/publisher.ts @@ -8,8 +8,8 @@ export interface Publisher { name: string; address: string; active: boolean; - articlesCount: number; - createdAt: number; + articles_count: number; + created_at: number; respect: number; } @@ -17,8 +17,8 @@ const basePublisher: object = { name: "", address: "", active: false, - articlesCount: 0, - createdAt: 0, + articles_count: 0, + created_at: 0, respect: 0, }; @@ -33,11 +33,11 @@ export const Publisher = { if (message.active === true) { writer.uint32(24).bool(message.active); } - if (message.articlesCount !== 0) { - writer.uint32(32).uint32(message.articlesCount); + if (message.articles_count !== 0) { + writer.uint32(32).uint32(message.articles_count); } - if (message.createdAt !== 0) { - writer.uint32(40).int64(message.createdAt); + if (message.created_at !== 0) { + writer.uint32(40).int64(message.created_at); } if (message.respect !== 0) { writer.uint32(48).int64(message.respect); @@ -62,10 +62,10 @@ export const Publisher = { message.active = reader.bool(); break; case 4: - message.articlesCount = reader.uint32(); + message.articles_count = reader.uint32(); break; case 5: - message.createdAt = longToNumber(reader.int64() as Long); + message.created_at = longToNumber(reader.int64() as Long); break; case 6: message.respect = longToNumber(reader.int64() as Long); @@ -95,15 +95,15 @@ export const Publisher = { } else { message.active = false; } - if (object.articlesCount !== undefined && object.articlesCount !== null) { - message.articlesCount = Number(object.articlesCount); + if (object.articles_count !== undefined && object.articles_count !== null) { + message.articles_count = Number(object.articles_count); } else { - message.articlesCount = 0; + message.articles_count = 0; } - if (object.createdAt !== undefined && object.createdAt !== null) { - message.createdAt = Number(object.createdAt); + if (object.created_at !== undefined && object.created_at !== null) { + message.created_at = Number(object.created_at); } else { - message.createdAt = 0; + message.created_at = 0; } if (object.respect !== undefined && object.respect !== null) { message.respect = Number(object.respect); @@ -118,9 +118,9 @@ export const Publisher = { message.name !== undefined && (obj.name = message.name); message.address !== undefined && (obj.address = message.address); message.active !== undefined && (obj.active = message.active); - message.articlesCount !== undefined && - (obj.articlesCount = message.articlesCount); - message.createdAt !== undefined && (obj.createdAt = message.createdAt); + message.articles_count !== undefined && + (obj.articles_count = message.articles_count); + message.created_at !== undefined && (obj.created_at = message.created_at); message.respect !== undefined && (obj.respect = message.respect); return obj; }, @@ -142,15 +142,15 @@ export const Publisher = { } else { message.active = false; } - if (object.articlesCount !== undefined && object.articlesCount !== null) { - message.articlesCount = object.articlesCount; + if (object.articles_count !== undefined && object.articles_count !== null) { + message.articles_count = object.articles_count; } else { - message.articlesCount = 0; + message.articles_count = 0; } - if (object.createdAt !== undefined && object.createdAt !== null) { - message.createdAt = object.createdAt; + if (object.created_at !== undefined && object.created_at !== null) { + message.created_at = object.created_at; } else { - message.createdAt = 0; + message.created_at = 0; } if (object.respect !== undefined && object.respect !== null) { message.respect = object.respect; diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/tx.ts b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/tx.ts index 474e7625..e6854a35 100644 --- a/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/tx.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.cointrunk.v1/module/types/cointrunk/tx.ts @@ -20,9 +20,9 @@ export interface MsgPayPublisherRespect { } export interface MsgPayPublisherRespectResponse { - respectPaid: number; - publisherReward: number; - communityPoolFunds: number; + respect_paid: number; + publisher_reward: number; + community_pool_funds: number; } const baseMsgAddArticle: object = { @@ -273,9 +273,9 @@ export const MsgPayPublisherRespect = { }; const baseMsgPayPublisherRespectResponse: object = { - respectPaid: 0, - publisherReward: 0, - communityPoolFunds: 0, + respect_paid: 0, + publisher_reward: 0, + community_pool_funds: 0, }; export const MsgPayPublisherRespectResponse = { @@ -283,14 +283,14 @@ export const MsgPayPublisherRespectResponse = { message: MsgPayPublisherRespectResponse, writer: Writer = Writer.create() ): Writer { - if (message.respectPaid !== 0) { - writer.uint32(8).uint64(message.respectPaid); + if (message.respect_paid !== 0) { + writer.uint32(8).uint64(message.respect_paid); } - if (message.publisherReward !== 0) { - writer.uint32(16).uint64(message.publisherReward); + if (message.publisher_reward !== 0) { + writer.uint32(16).uint64(message.publisher_reward); } - if (message.communityPoolFunds !== 0) { - writer.uint32(24).uint64(message.communityPoolFunds); + if (message.community_pool_funds !== 0) { + writer.uint32(24).uint64(message.community_pool_funds); } return writer; }, @@ -308,13 +308,13 @@ export const MsgPayPublisherRespectResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.respectPaid = longToNumber(reader.uint64() as Long); + message.respect_paid = longToNumber(reader.uint64() as Long); break; case 2: - message.publisherReward = longToNumber(reader.uint64() as Long); + message.publisher_reward = longToNumber(reader.uint64() as Long); break; case 3: - message.communityPoolFunds = longToNumber(reader.uint64() as Long); + message.community_pool_funds = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); @@ -328,38 +328,38 @@ export const MsgPayPublisherRespectResponse = { const message = { ...baseMsgPayPublisherRespectResponse, } as MsgPayPublisherRespectResponse; - if (object.respectPaid !== undefined && object.respectPaid !== null) { - message.respectPaid = Number(object.respectPaid); + if (object.respect_paid !== undefined && object.respect_paid !== null) { + message.respect_paid = Number(object.respect_paid); } else { - message.respectPaid = 0; + message.respect_paid = 0; } if ( - object.publisherReward !== undefined && - object.publisherReward !== null + object.publisher_reward !== undefined && + object.publisher_reward !== null ) { - message.publisherReward = Number(object.publisherReward); + message.publisher_reward = Number(object.publisher_reward); } else { - message.publisherReward = 0; + message.publisher_reward = 0; } if ( - object.communityPoolFunds !== undefined && - object.communityPoolFunds !== null + object.community_pool_funds !== undefined && + object.community_pool_funds !== null ) { - message.communityPoolFunds = Number(object.communityPoolFunds); + message.community_pool_funds = Number(object.community_pool_funds); } else { - message.communityPoolFunds = 0; + message.community_pool_funds = 0; } return message; }, toJSON(message: MsgPayPublisherRespectResponse): unknown { const obj: any = {}; - message.respectPaid !== undefined && - (obj.respectPaid = message.respectPaid); - message.publisherReward !== undefined && - (obj.publisherReward = message.publisherReward); - message.communityPoolFunds !== undefined && - (obj.communityPoolFunds = message.communityPoolFunds); + message.respect_paid !== undefined && + (obj.respect_paid = message.respect_paid); + message.publisher_reward !== undefined && + (obj.publisher_reward = message.publisher_reward); + message.community_pool_funds !== undefined && + (obj.community_pool_funds = message.community_pool_funds); return obj; }, @@ -369,26 +369,26 @@ export const MsgPayPublisherRespectResponse = { const message = { ...baseMsgPayPublisherRespectResponse, } as MsgPayPublisherRespectResponse; - if (object.respectPaid !== undefined && object.respectPaid !== null) { - message.respectPaid = object.respectPaid; + if (object.respect_paid !== undefined && object.respect_paid !== null) { + message.respect_paid = object.respect_paid; } else { - message.respectPaid = 0; + message.respect_paid = 0; } if ( - object.publisherReward !== undefined && - object.publisherReward !== null + object.publisher_reward !== undefined && + object.publisher_reward !== null ) { - message.publisherReward = object.publisherReward; + message.publisher_reward = object.publisher_reward; } else { - message.publisherReward = 0; + message.publisher_reward = 0; } if ( - object.communityPoolFunds !== undefined && - object.communityPoolFunds !== null + object.community_pool_funds !== undefined && + object.community_pool_funds !== null ) { - message.communityPoolFunds = object.communityPoolFunds; + message.community_pool_funds = object.community_pool_funds; } else { - message.communityPoolFunds = 0; + message.community_pool_funds = 0; } return message; }, diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts index 36486b56..0a633940 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/index.ts @@ -232,21 +232,6 @@ export default { }, - async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { - try { - const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgSubmitScavenge(value) - const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, - gas: "200000" }, memo}) - return result - } catch (e) { - if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') - }else{ - throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) - } - } - }, async sendMsgCommitSolution({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -277,20 +262,22 @@ export default { } } }, - - async MsgSubmitScavenge({ rootGetters }, { value }) { + async sendMsgSubmitScavenge({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) const msg = await txClient.msgSubmitScavenge(value) - return msg + const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, + gas: "200000" }, memo}) + return result } catch (e) { if (e == MissingWalletError) { throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') - } else{ - throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + }else{ + throw new Error('TxClient:MsgSubmitScavenge:Send Could not broadcast Tx: '+ e.message) } } }, + async MsgCommitSolution({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) @@ -317,6 +304,19 @@ export default { } } }, + async MsgSubmitScavenge({ rootGetters }, { value }) { + try { + const txClient=await initTxClient(rootGetters) + const msg = await txClient.msgSubmitScavenge(value) + return msg + } catch (e) { + if (e == MissingWalletError) { + throw new Error('TxClient:MsgSubmitScavenge:Init Could not initialize signing client. Wallet is required.') + } else{ + throw new Error('TxClient:MsgSubmitScavenge:Create Could not create message: ' + e.message) + } + } + }, } } diff --git a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts index 27b7f752..44bd4fda 100755 --- a/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts +++ b/vue/src/store/generated/bze-alphateam/bze/bze.scavenge/module/index.ts @@ -4,15 +4,15 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgSubmitScavenge } from "./types/scavenge/tx"; import { MsgCommitSolution } from "./types/scavenge/tx"; import { MsgRevealSolution } from "./types/scavenge/tx"; +import { MsgSubmitScavenge } from "./types/scavenge/tx"; const types = [ - ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ["/bze.scavenge.MsgCommitSolution", MsgCommitSolution], ["/bze.scavenge.MsgRevealSolution", MsgRevealSolution], + ["/bze.scavenge.MsgSubmitScavenge", MsgSubmitScavenge], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +45,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), msgCommitSolution: (data: MsgCommitSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgCommitSolution", value: MsgCommitSolution.fromPartial( data ) }), msgRevealSolution: (data: MsgRevealSolution): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgRevealSolution", value: MsgRevealSolution.fromPartial( data ) }), + msgSubmitScavenge: (data: MsgSubmitScavenge): EncodeObject => ({ typeUrl: "/bze.scavenge.MsgSubmitScavenge", value: MsgSubmitScavenge.fromPartial( data ) }), }; }; diff --git a/x/cointrunk/types/publisher.pb.go b/x/cointrunk/types/publisher.pb.go index 8f0bf818..8a09c0a0 100644 --- a/x/cointrunk/types/publisher.pb.go +++ b/x/cointrunk/types/publisher.pb.go @@ -26,8 +26,8 @@ type Publisher struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` Active bool `protobuf:"varint,3,opt,name=active,proto3" json:"active,omitempty"` - ArticlesCount uint32 `protobuf:"varint,4,opt,name=articlesCount,proto3" json:"articlesCount,omitempty"` - CreatedAt int64 `protobuf:"varint,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + ArticlesCount uint32 `protobuf:"varint,4,opt,name=articles_count,json=articlesCount,proto3" json:"articles_count,omitempty"` + CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` Respect int64 `protobuf:"varint,6,opt,name=respect,proto3" json:"respect,omitempty"` } @@ -113,23 +113,24 @@ func init() { func init() { proto.RegisterFile("cointrunk/publisher.proto", fileDescriptor_13a2ab3c46c6721e) } var fileDescriptor_13a2ab3c46c6721e = []byte{ - // 252 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xc1, 0x4a, 0xf4, 0x30, - 0x14, 0x85, 0x9b, 0x7f, 0xe6, 0xaf, 0x36, 0x30, 0x20, 0x59, 0x48, 0x04, 0x09, 0x45, 0x5c, 0x74, - 0x63, 0x8b, 0xf8, 0x04, 0xea, 0xc6, 0xa5, 0x74, 0xe9, 0x2e, 0x49, 0x2f, 0x36, 0xd8, 0x69, 0x42, - 0x72, 0x3b, 0xe8, 0x3c, 0x85, 0x6f, 0xe2, 0x6b, 0xb8, 0x9c, 0xa5, 0x4b, 0x69, 0x5f, 0x44, 0x0c, - 0xd6, 0xc1, 0xdd, 0xfd, 0xbe, 0x73, 0xe1, 0xc0, 0xa1, 0x27, 0xda, 0x9a, 0x1e, 0xfd, 0xd0, 0x3f, - 0x55, 0x6e, 0x50, 0x9d, 0x09, 0x2d, 0xf8, 0xd2, 0x79, 0x8b, 0x96, 0x1d, 0xa9, 0x2d, 0x94, 0xbf, - 0x71, 0xb9, 0xb9, 0x3c, 0x7b, 0x23, 0x34, 0xbb, 0x9f, 0xbf, 0x18, 0xa3, 0xcb, 0x5e, 0xae, 0x81, - 0x93, 0x9c, 0x14, 0x59, 0x1d, 0x6f, 0xc6, 0xe9, 0x81, 0x6c, 0x1a, 0x0f, 0x21, 0xf0, 0x7f, 0x51, - 0xcf, 0xc8, 0x8e, 0x69, 0x2a, 0x35, 0x9a, 0x0d, 0xf0, 0x45, 0x4e, 0x8a, 0xc3, 0xfa, 0x87, 0xd8, - 0x39, 0x5d, 0x49, 0x8f, 0x46, 0x77, 0x10, 0x6e, 0xed, 0xd0, 0x23, 0x5f, 0xe6, 0xa4, 0x58, 0xd5, - 0x7f, 0x25, 0x3b, 0xa5, 0x99, 0xf6, 0x20, 0x11, 0x9a, 0x6b, 0xe4, 0xff, 0x73, 0x52, 0x2c, 0xea, - 0xbd, 0xf8, 0x6e, 0xf5, 0x10, 0x1c, 0x68, 0xe4, 0x69, 0xcc, 0x66, 0xbc, 0xb9, 0x7b, 0x1f, 0x05, - 0xd9, 0x8d, 0x82, 0x7c, 0x8e, 0x82, 0xbc, 0x4e, 0x22, 0xd9, 0x4d, 0x22, 0xf9, 0x98, 0x44, 0xf2, - 0x50, 0x3e, 0x1a, 0x6c, 0x07, 0x55, 0x6a, 0xbb, 0xae, 0xd4, 0x16, 0x2e, 0x64, 0xe7, 0x5a, 0x89, - 0x20, 0x23, 0x55, 0xcf, 0xd5, 0x7e, 0x17, 0x7c, 0x71, 0x10, 0x54, 0x1a, 0x47, 0xb9, 0xfa, 0x0a, - 0x00, 0x00, 0xff, 0xff, 0x4d, 0x37, 0xc3, 0xf1, 0x31, 0x01, 0x00, 0x00, + // 258 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x90, 0x41, 0x4a, 0xc4, 0x30, + 0x14, 0x86, 0x1b, 0x67, 0xac, 0x36, 0x30, 0x22, 0x59, 0x48, 0x5c, 0x18, 0x8a, 0x20, 0x74, 0x63, + 0x8b, 0x78, 0x02, 0x75, 0xe3, 0x52, 0xba, 0x74, 0x33, 0xa4, 0xe9, 0xc3, 0x06, 0x3b, 0x4d, 0x48, + 0x5e, 0x07, 0x9d, 0x53, 0x78, 0x15, 0x6f, 0xe1, 0x72, 0x96, 0x2e, 0xa5, 0xbd, 0x88, 0x4c, 0x98, + 0xea, 0xee, 0x7d, 0xdf, 0xff, 0xe0, 0x87, 0x9f, 0x9e, 0x2b, 0xa3, 0x3b, 0x74, 0x7d, 0xf7, 0x5a, + 0xd8, 0xbe, 0x6a, 0xb5, 0x6f, 0xc0, 0xe5, 0xd6, 0x19, 0x34, 0xec, 0xb4, 0xda, 0x40, 0xfe, 0x17, + 0xe7, 0xeb, 0x9b, 0xcb, 0x4f, 0x42, 0x93, 0xa7, 0xe9, 0x8b, 0x31, 0x3a, 0xef, 0xe4, 0x0a, 0x38, + 0x49, 0x49, 0x96, 0x94, 0xe1, 0x66, 0x9c, 0x1e, 0xc9, 0xba, 0x76, 0xe0, 0x3d, 0x3f, 0x08, 0x7a, + 0x42, 0x76, 0x46, 0x63, 0xa9, 0x50, 0xaf, 0x81, 0xcf, 0x52, 0x92, 0x1d, 0x97, 0x7b, 0x62, 0x57, + 0xf4, 0x44, 0x3a, 0xd4, 0xaa, 0x05, 0xbf, 0x54, 0xa6, 0xef, 0x90, 0xcf, 0x53, 0x92, 0x2d, 0xca, + 0xc5, 0x64, 0x1f, 0x76, 0x92, 0x5d, 0x50, 0xaa, 0x1c, 0x48, 0x84, 0x7a, 0x29, 0x91, 0x1f, 0xa6, + 0x24, 0x9b, 0x95, 0xc9, 0xde, 0xdc, 0xe1, 0xae, 0xd7, 0x81, 0xb7, 0xa0, 0x90, 0xc7, 0x21, 0x9b, + 0xf0, 0xfe, 0xf1, 0x6b, 0x10, 0x64, 0x3b, 0x08, 0xf2, 0x33, 0x08, 0xf2, 0x31, 0x8a, 0x68, 0x3b, + 0x8a, 0xe8, 0x7b, 0x14, 0xd1, 0x73, 0xfe, 0xa2, 0xb1, 0xe9, 0xab, 0x5c, 0x99, 0x55, 0x51, 0x6d, + 0xe0, 0x5a, 0xb6, 0xb6, 0x91, 0x08, 0x32, 0x50, 0xf1, 0x56, 0xfc, 0x2f, 0x83, 0xef, 0x16, 0x7c, + 0x15, 0x87, 0x59, 0x6e, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x01, 0xea, 0x19, 0x54, 0x33, 0x01, + 0x00, 0x00, } func (m *Publisher) Marshal() (dAtA []byte, err error) { diff --git a/x/cointrunk/types/tx.pb.go b/x/cointrunk/types/tx.pb.go index 3d847bce..b450b5e5 100644 --- a/x/cointrunk/types/tx.pb.go +++ b/x/cointrunk/types/tx.pb.go @@ -192,9 +192,9 @@ func (m *MsgPayPublisherRespect) GetAmount() string { } type MsgPayPublisherRespectResponse struct { - RespectPaid uint64 `protobuf:"varint,1,opt,name=respectPaid,proto3" json:"respectPaid,omitempty"` - PublisherReward uint64 `protobuf:"varint,2,opt,name=publisherReward,proto3" json:"publisherReward,omitempty"` - CommunityPoolFunds uint64 `protobuf:"varint,3,opt,name=communityPoolFunds,proto3" json:"communityPoolFunds,omitempty"` + RespectPaid uint64 `protobuf:"varint,1,opt,name=respect_paid,json=respectPaid,proto3" json:"respect_paid,omitempty"` + PublisherReward uint64 `protobuf:"varint,2,opt,name=publisher_reward,json=publisherReward,proto3" json:"publisher_reward,omitempty"` + CommunityPoolFunds uint64 `protobuf:"varint,3,opt,name=community_pool_funds,json=communityPoolFunds,proto3" json:"community_pool_funds,omitempty"` } func (m *MsgPayPublisherRespectResponse) Reset() { *m = MsgPayPublisherRespectResponse{} } @@ -261,31 +261,33 @@ func init() { func init() { proto.RegisterFile("cointrunk/tx.proto", fileDescriptor_776bb1586e9b1fcd) } var fileDescriptor_776bb1586e9b1fcd = []byte{ - // 382 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xbb, 0x8e, 0xd3, 0x40, - 0x14, 0x8d, 0x89, 0x09, 0xca, 0x45, 0x88, 0x68, 0x80, 0x60, 0x45, 0xc8, 0x44, 0x6e, 0x48, 0xc3, - 0x98, 0xc7, 0x17, 0x84, 0x02, 0xd1, 0x44, 0xb2, 0x5c, 0x50, 0xd0, 0x8d, 0x3d, 0x23, 0x67, 0x84, - 0xed, 0x31, 0xf3, 0x60, 0x93, 0x7c, 0xc5, 0x7e, 0xc0, 0x7e, 0xd0, 0x96, 0x29, 0xb7, 0x5c, 0x25, - 0x3f, 0xb2, 0xf2, 0x24, 0xce, 0x4b, 0x96, 0x76, 0x3b, 0x9f, 0x73, 0xee, 0xf5, 0x39, 0x73, 0xef, - 0x05, 0x94, 0x0a, 0x5e, 0x6a, 0x69, 0xca, 0xbf, 0xa1, 0x5e, 0xe0, 0x4a, 0x0a, 0x2d, 0xd0, 0x20, - 0x59, 0x31, 0x7c, 0xe0, 0xf1, 0xff, 0xaf, 0x81, 0x80, 0x57, 0x33, 0x95, 0x4d, 0x29, 0x9d, 0x4a, - 0xcd, 0xd3, 0x9c, 0xa1, 0x0f, 0xd0, 0xaf, 0x4c, 0x92, 0x73, 0x35, 0x67, 0xd2, 0x73, 0xc6, 0xce, - 0xa4, 0x1f, 0x1f, 0x09, 0xf4, 0x16, 0x9e, 0x6b, 0xae, 0x73, 0xe6, 0x3d, 0xb3, 0xca, 0x0e, 0xa0, - 0x01, 0x74, 0x8d, 0xcc, 0xbd, 0xae, 0xe5, 0xea, 0x4f, 0xe4, 0xc1, 0x8b, 0x8a, 0xa7, 0xda, 0x48, - 0xe6, 0xb9, 0x96, 0x6d, 0x60, 0xf0, 0x1e, 0xde, 0x9d, 0x19, 0xc6, 0x4c, 0x55, 0xa2, 0x54, 0x2c, - 0xa0, 0x30, 0x9c, 0xa9, 0x2c, 0x22, 0xcb, 0xa8, 0x71, 0xab, 0x25, 0x96, 0xea, 0xfa, 0x67, 0xa9, - 0x64, 0x44, 0x8b, 0x26, 0x50, 0x03, 0x6b, 0x85, 0x50, 0x2a, 0x99, 0x52, 0xfb, 0x40, 0x0d, 0x44, - 0x43, 0xe8, 0x91, 0x42, 0x98, 0x52, 0xef, 0x53, 0xed, 0x51, 0x70, 0xe3, 0x80, 0xdf, 0x6e, 0xd3, - 0x04, 0x41, 0x63, 0x78, 0x29, 0x77, 0x54, 0x44, 0x38, 0xb5, 0x96, 0x6e, 0x7c, 0x4a, 0xa1, 0x09, - 0xbc, 0xae, 0x8e, 0xdd, 0x57, 0x44, 0x52, 0x6b, 0xef, 0xc6, 0x97, 0x34, 0xc2, 0xf5, 0x1a, 0x8a, - 0xc2, 0x94, 0x5c, 0x2f, 0x23, 0x21, 0xf2, 0x9f, 0xa6, 0xa4, 0xca, 0x46, 0x72, 0xe3, 0x16, 0xe5, - 0xdb, 0xda, 0x81, 0xee, 0x4c, 0x65, 0xe8, 0x37, 0xc0, 0xc9, 0x4e, 0x3e, 0xe2, 0xcb, 0xbd, 0xe1, - 0xb3, 0x19, 0x8e, 0x3e, 0x3d, 0x52, 0x70, 0x78, 0xdb, 0x3f, 0x78, 0xd3, 0x36, 0xe1, 0x49, 0x6b, - 0x7f, 0x4b, 0xe5, 0xe8, 0xcb, 0x53, 0x2b, 0x1b, 0xcb, 0x1f, 0xbf, 0x6e, 0x37, 0xbe, 0xb3, 0xde, - 0xf8, 0xce, 0xfd, 0xc6, 0x77, 0xae, 0xb7, 0x7e, 0x67, 0xbd, 0xf5, 0x3b, 0x77, 0x5b, 0xbf, 0xf3, - 0x07, 0x67, 0x5c, 0xcf, 0x4d, 0x82, 0x53, 0x51, 0x84, 0xc9, 0x8a, 0x7d, 0x26, 0x79, 0x35, 0x27, - 0x9a, 0x11, 0x8b, 0xc2, 0x45, 0x78, 0x72, 0xc0, 0xcb, 0x8a, 0xa9, 0xa4, 0x67, 0x8f, 0xf8, 0xfb, - 0x43, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x9e, 0x2f, 0xf3, 0xda, 0x02, 0x00, 0x00, + // 401 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xbd, 0x8e, 0xd3, 0x40, + 0x10, 0x8e, 0x89, 0x39, 0x74, 0x03, 0x88, 0x68, 0x39, 0x0e, 0xeb, 0x84, 0x0c, 0xb8, 0xe1, 0x28, + 0xb0, 0x03, 0x3c, 0x41, 0x28, 0x10, 0x4d, 0x24, 0xcb, 0x05, 0x05, 0x8d, 0xb5, 0xf6, 0x2e, 0xce, + 0x0a, 0xdb, 0xbb, 0xec, 0x0f, 0x24, 0x79, 0x0a, 0x1e, 0x81, 0xc7, 0xa1, 0x4c, 0x49, 0x89, 0x92, + 0x17, 0x41, 0xde, 0xd8, 0x4e, 0x82, 0x2c, 0x71, 0x9d, 0xbf, 0xef, 0x1b, 0xcf, 0xf7, 0xed, 0xcc, + 0x00, 0xca, 0x39, 0xab, 0xb5, 0x34, 0xf5, 0x97, 0x48, 0x2f, 0x43, 0x21, 0xb9, 0xe6, 0x68, 0x92, + 0xad, 0x69, 0xd8, 0xf3, 0xe1, 0xb7, 0xd7, 0x01, 0x87, 0xfb, 0x73, 0x55, 0xcc, 0x08, 0x99, 0x49, + 0xcd, 0xf2, 0x92, 0xa2, 0x27, 0x70, 0x2e, 0x4c, 0x56, 0x32, 0xb5, 0xa0, 0xd2, 0x73, 0x9e, 0x39, + 0xd7, 0xe7, 0xc9, 0x81, 0x40, 0x17, 0x70, 0x5b, 0x33, 0x5d, 0x52, 0xef, 0x96, 0x55, 0xf6, 0x00, + 0x4d, 0x60, 0x6c, 0x64, 0xe9, 0x8d, 0x2d, 0xd7, 0x7c, 0x22, 0x0f, 0xee, 0x08, 0x96, 0x6b, 0x23, + 0xa9, 0xe7, 0x5a, 0xb6, 0x83, 0xc1, 0x63, 0x78, 0x74, 0x62, 0x98, 0x50, 0x25, 0x78, 0xad, 0x68, + 0x40, 0xe0, 0x72, 0xae, 0x8a, 0x18, 0xaf, 0xe2, 0xce, 0xad, 0x91, 0x68, 0xae, 0x9b, 0x66, 0xb9, + 0xa4, 0x58, 0xf3, 0x2e, 0x50, 0x07, 0x1b, 0x05, 0x13, 0x22, 0xa9, 0x52, 0x6d, 0xa0, 0x0e, 0xa2, + 0x4b, 0x38, 0xc3, 0x15, 0x37, 0xb5, 0x6e, 0x53, 0xb5, 0x28, 0xf8, 0xe9, 0x80, 0x3f, 0x6c, 0xd3, + 0x05, 0x41, 0xcf, 0xe1, 0x9e, 0xdc, 0x53, 0xa9, 0xc0, 0x8c, 0x58, 0x4f, 0x37, 0xb9, 0xdb, 0x72, + 0x31, 0x66, 0x04, 0xbd, 0x84, 0x49, 0x3f, 0x93, 0x54, 0xd2, 0xef, 0x58, 0x12, 0x1b, 0xc0, 0x4d, + 0x1e, 0x88, 0x43, 0xdb, 0x86, 0x46, 0x53, 0xb8, 0xc8, 0x79, 0x55, 0x99, 0x9a, 0xe9, 0x55, 0x2a, + 0x38, 0x2f, 0xd3, 0xcf, 0xa6, 0x26, 0xca, 0xc6, 0x72, 0x13, 0xd4, 0x6b, 0x31, 0xe7, 0xe5, 0xfb, + 0x46, 0x79, 0xb3, 0x71, 0x60, 0x3c, 0x57, 0x05, 0xfa, 0x08, 0x70, 0xb4, 0x97, 0xa7, 0xe1, 0xbf, + 0xbb, 0x0b, 0x4f, 0xe6, 0x78, 0xf5, 0xe2, 0x3f, 0x05, 0xfd, 0xfb, 0xbe, 0xc2, 0xc3, 0xa1, 0x29, + 0x5f, 0x0f, 0xfe, 0x3f, 0x50, 0x79, 0x35, 0xbd, 0x69, 0x65, 0x67, 0xf9, 0xee, 0xc3, 0xaf, 0xad, + 0xef, 0x6c, 0xb6, 0xbe, 0xf3, 0x67, 0xeb, 0x3b, 0x3f, 0x76, 0xfe, 0x68, 0xb3, 0xf3, 0x47, 0xbf, + 0x77, 0xfe, 0xe8, 0x53, 0x58, 0x30, 0xbd, 0x30, 0x59, 0x98, 0xf3, 0x2a, 0xca, 0xd6, 0xf4, 0x15, + 0x2e, 0xc5, 0x02, 0x6b, 0x8a, 0x2d, 0x8a, 0x96, 0xd1, 0xd1, 0x11, 0xaf, 0x04, 0x55, 0xd9, 0x99, + 0x3d, 0xe4, 0xb7, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x65, 0xc4, 0x6b, 0xde, 0x02, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. From c15afc852bfb6bb0f5d0eb2e73ca4fc8fd93697c Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Fri, 30 Dec 2022 21:24:42 +0200 Subject: [PATCH 52/54] fix default cointrunk params --- app/app.go | 2 +- app/upgrades/v600/upgrades.go | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/app.go b/app/app.go index d2b80feb..a8748d80 100644 --- a/app/app.go +++ b/app/app.go @@ -608,7 +608,7 @@ func (app *App) setupUpgradeHandlers() { app.UpgradeKeeper.SetUpgradeHandler( v600.UpgradeName, - v600.CreateUpgradeHandler(), + v600.CreateUpgradeHandler(&app.CointrunkKeeper), ) upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() diff --git a/app/upgrades/v600/upgrades.go b/app/upgrades/v600/upgrades.go index d304fe7c..57ab3881 100644 --- a/app/upgrades/v600/upgrades.go +++ b/app/upgrades/v600/upgrades.go @@ -1,6 +1,8 @@ package v600 import ( + cointrunkkeeper "github.com/bze-alphateam/bze/x/cointrunk/keeper" + cointrunktypes "github.com/bze-alphateam/bze/x/cointrunk/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" @@ -8,9 +10,10 @@ import ( const UpgradeName = "v6.0.0" -func CreateUpgradeHandler() upgradetypes.UpgradeHandler { +func CreateUpgradeHandler(k *cointrunkkeeper.Keeper) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, _plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - //do nothing on purpose + //set cointrunk module default params + k.SetParams(ctx, cointrunktypes.DefaultParams()) return vm, nil } } From b940e84d7ebb252ce846f7aa0a116fe22830e705 Mon Sep 17 00:00:00 2001 From: faneaatiku Date: Fri, 30 Dec 2022 21:37:48 +0200 Subject: [PATCH 53/54] removed duplicate setupUpgradeHandlers call --- app/app.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/app.go b/app/app.go index a8748d80..9cde68be 100644 --- a/app/app.go +++ b/app/app.go @@ -559,8 +559,6 @@ func New( app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) app.mm.RegisterServices(module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())) - app.setupUpgradeHandlers() - // initialize stores app.MountKVStores(keys) app.MountTransientStores(tkeys) From 170ba9b5704e3da4f8d61048c898b5673d39fbe1 Mon Sep 17 00:00:00 2001 From: StefanV Date: Wed, 1 Feb 2023 01:21:52 +0200 Subject: [PATCH 54/54] update workflow file --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9af04153..e9814d48 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0