From 2bc301749a5fa9207906099ccca9dba7a9ffec23 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Wed, 8 Nov 2023 13:00:41 -0800 Subject: [PATCH] [Session] Add support for `GetSession` via the CLI + deps (#163) - Update the CLI code flow to be able to call `GetSession` - Add make targets to trigger `GetSession` - Replace `[]` with `<>` in all CLI functions to differentiate required vs optional params - Made a couple changes to `SessionHydrator` (and added tests) to account additional error cases https://github.com/pokt-network/poktroll/assets/1892194/56425906-d06f-4c41-b8a5-d210d8a450cd --- Co-authored-by: Bryan White Co-authored-by: Daniel Olshansky Co-authored-by: Dima Kniazev --- Makefile | 59 +- app/app.go | 22 +- docs/static/openapi.yml | 1168 ++++++++--------- go.mod | 1 + go.sum | 5 + proto/pocket/shared/service.proto | 4 +- testutil/keeper/session.go | 35 +- testutil/network/network.go | 3 + x/application/client/cli/query_application.go | 2 +- .../client/cli/tx_delegate_to_gateway.go | 2 +- .../client/cli/tx_stake_application.go | 2 +- .../client/cli/tx_unstake_application.go | 2 +- x/gateway/client/cli/helpers_test.go | 14 +- x/gateway/client/cli/query_gateway.go | 2 +- x/gateway/client/cli/tx_stake_gateway.go | 6 +- x/gateway/client/cli/tx_unstake_gateway.go | 2 +- x/session/client/cli/helpers_test.go | 44 + x/session/client/cli/query_get_session.go | 36 +- .../client/cli/query_get_session_test.go | 197 +++ x/session/keeper/query_get_session.go | 15 + x/session/keeper/query_get_session_test.go | 55 +- x/session/keeper/session_hydrator.go | 35 +- x/session/keeper/session_hydrator_test.go | 132 +- x/session/types/errors.go | 10 +- x/session/types/query_get_session_request.go | 40 + x/shared/helpers/service.go | 7 +- x/shared/helpers/service_test.go | 107 +- x/supplier/client/cli/query_supplier.go | 2 +- x/supplier/client/cli/tx_create_claim.go | 5 +- x/supplier/client/cli/tx_stake_supplier.go | 2 +- x/supplier/client/cli/tx_submit_proof.go | 9 +- 31 files changed, 1293 insertions(+), 732 deletions(-) create mode 100644 x/session/client/cli/helpers_test.go create mode 100644 x/session/client/cli/query_get_session_test.go create mode 100644 x/session/types/query_get_session_request.go diff --git a/Makefile b/Makefile index de0c67cd2..1860b6156 100644 --- a/Makefile +++ b/Makefile @@ -312,15 +312,18 @@ app_delegate: ## Delegate trust to a gateway (must specify the APP and GATEWAY_A .PHONY: app1_delegate_gateway1 app1_delegate_gateway1: ## Delegate trust to gateway1 - APP=app1 GATEWAY_ADDR=pokt15vzxjqklzjtlz7lahe8z2dfe9nm5vxwwmscne4 make app_delegate + GATEWAY1=$$(make poktrolld_addr ACC_NAME=gateway1) && \ + APP=app1 GATEWAY_ADDR=$$GATEWAY1 make app_delegate .PHONY: app2_delegate_gateway2 app2_delegate_gateway2: ## Delegate trust to gateway2 - APP=app2 GATEWAY_ADDR=pokt15w3fhfyc0lttv7r585e2ncpf6t2kl9uh8rsnyz make app_delegate + GATEWAY2=$$(make poktrolld_addr ACC_NAME=gateway2) && \ + APP=app2 GATEWAY_ADDR=$$GATEWAY2 make app_delegate .PHONY: app3_delegate_gateway3 app3_delegate_gateway3: ## Delegate trust to gateway3 - APP=app3 GATEWAY_ADDR=pokt1zhmkkd0rh788mc9prfq0m2h88t9ge0j83gnxya make app_delegate + GATEWAY3=$$(make poktrolld_addr ACC_NAME=gateway3) && \ + APP=app3 GATEWAY_ADDR=$$GATEWAY3 make app_delegate .PHONY: app_undelegate app_undelegate: ## Undelegate trust to a gateway (must specify the APP and GATEWAY_ADDR env vars). Requires the app to be staked @@ -328,15 +331,18 @@ app_undelegate: ## Undelegate trust to a gateway (must specify the APP and GATEW .PHONY: app1_undelegate_gateway1 app1_undelegate_gateway1: ## Undelegate trust to gateway1 - APP=app1 GATEWAY_ADDR=pokt15vzxjqklzjtlz7lahe8z2dfe9nm5vxwwmscne4 make app_undelegate + GATEWAY1=$$(make poktrolld_addr ACC_NAME=gateway1) && \ + APP=app1 GATEWAY_ADDR=$$GATEWAY1 make app_undelegate .PHONY: app2_undelegate_gateway2 app2_undelegate_gateway2: ## Undelegate trust to gateway2 - APP=app2 GATEWAY_ADDR=pokt15w3fhfyc0lttv7r585e2ncpf6t2kl9uh8rsnyz make app_undelegate + GATEWAY2=$$(make poktrolld_addr ACC_NAME=gateway2) && \ + APP=app2 GATEWAY_ADDR=$$GATEWAY2 make app_undelegate .PHONY: app3_undelegate_gateway3 app3_undelegate_gateway3: ## Undelegate trust to gateway3 - APP=app3 GATEWAY_ADDR=pokt1zhmkkd0rh788mc9prfq0m2h88t9ge0j83gnxya make app_undelegate + GATEWAY3=$$(make poktrolld_addr ACC_NAME=gateway3) && \ + APP=app3 GATEWAY_ADDR=$$GATEWAY3 make app_undelegate ################# ### Suppliers ### @@ -380,6 +386,29 @@ supplier2_unstake: ## Unstake supplier2 supplier3_unstake: ## Unstake supplier3 SUPPLIER=supplier3 make supplier_unstake +############### +### Session ### +############### + +.PHONY: get_session +get_session: ## Retrieve the session given the following env vars: (APP_ADDR, SVC, HEIGHT) + pocketd --home=$(POCKETD_HOME) q session get-session $(APP) $(SVC) $(HEIGHT) --node $(POCKET_NODE) + +.PHONY: get_session_app1_anvil +get_session_app1_anvil: ## Retrieve the session for (app1, anvil, latest_height) + APP1=$$(make poktrolld_addr ACC_NAME=app1) && \ + APP=$$APP1 SVC=anvil HEIGHT=0 make get_session + +.PHONY: get_session_app2_anvil +get_session_app2_anvil: ## Retrieve the session for (app2, anvil, latest_height) + APP2=$$(make poktrolld_addr ACC_NAME=app2) && \ + APP=$$APP2 SVC=anvil HEIGHT=0 make get_session + +.PHONY: get_session_app3_anvil +get_session_app3_anvil: ## Retrieve the session for (app3, anvil, latest_height) + APP3=$$(make poktrolld_addr ACC_NAME=app3) && \ + APP=$$APP3 SVC=anvil HEIGHT=0 make get_session + ################ ### Accounts ### ################ @@ -398,11 +427,13 @@ acc_balance_query_module_app: ## Query the balance of the network level "applica .PHONY: acc_balance_query_module_supplier acc_balance_query_module_supplier: ## Query the balance of the network level "supplier" module - make acc_balance_query ACC=pokt1j40dzzmn6cn9kxku7a5tjnud6hv37vesr5ccaa + SUPPLIER1=$(make poktrolld_addr ACC_NAME=supplier1) + make acc_balance_query ACC=SUPPLIER1 .PHONY: acc_balance_query_app1 acc_balance_query_app1: ## Query the balance of app1 - make acc_balance_query ACC=pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4 + APP1=$$(make poktrolld_addr ACC_NAME=app1) && \ + make acc_balance_query ACC=$$APP1 .PHONY: acc_balance_total_supply acc_balance_total_supply: ## Query the total supply of the network @@ -428,8 +459,20 @@ trigger_ci: ## Trigger the CI pipeline by submitting an empty commit; See https: ##################### ### Documentation ### ##################### + .PHONY: go_docs go_docs: check_godoc ## Generate documentation for the project echo "Visit http://localhost:6060/pkg/pocket/" godoc -http=:6060 +.PHONY: openapi_gen +openapi_gen: ## Generate the OpenAPI spec for the Ignite API + ignite generate openapi --yes + +###################### +### Ignite Helpers ### +###################### + +.PHONY: poktrolld_addr +poktrolld_addr: ## Retrieve the address for an account by ACC_NAME + @echo $(shell poktrolld keys show -a $(ACC_NAME)) diff --git a/app/app.go b/app/app.go index c6a48ee69..b34d4db68 100644 --- a/app/app.go +++ b/app/app.go @@ -575,17 +575,6 @@ func New( ) serviceModule := servicemodule.NewAppModule(appCodec, app.ServiceKeeper, app.AccountKeeper, app.BankKeeper) - app.SessionKeeper = *sessionmodulekeeper.NewKeeper( - appCodec, - keys[sessionmoduletypes.StoreKey], - keys[sessionmoduletypes.MemStoreKey], - app.GetSubspace(sessionmoduletypes.ModuleName), - - app.ApplicationKeeper, - app.SupplierKeeper, - ) - sessionModule := sessionmodule.NewAppModule(appCodec, app.SessionKeeper, app.AccountKeeper, app.BankKeeper) - app.SupplierKeeper = *suppliermodulekeeper.NewKeeper( appCodec, keys[suppliermoduletypes.StoreKey], @@ -618,6 +607,17 @@ func New( ) applicationModule := applicationmodule.NewAppModule(appCodec, app.ApplicationKeeper, app.AccountKeeper, app.BankKeeper) + app.SessionKeeper = *sessionmodulekeeper.NewKeeper( + appCodec, + keys[sessionmoduletypes.StoreKey], + keys[sessionmoduletypes.MemStoreKey], + app.GetSubspace(sessionmoduletypes.ModuleName), + + app.ApplicationKeeper, + app.SupplierKeeper, + ) + sessionModule := sessionmodule.NewAppModule(appCodec, app.SessionKeeper, app.AccountKeeper, app.BankKeeper) + // this line is used by starport scaffolding # stargate/app/keeperDefinition /**** IBC Routing ****/ diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 2d5050b2f..f55a851f2 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -1,16 +1,16 @@ -swagger: "2.0" +swagger: '2.0' info: title: HTTP API Console - name: "" - description: "" + name: '' + description: '' paths: /cosmos/auth/v1beta1/account_info/{address}: get: summary: AccountInfo queries account info which is common to all account types. - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' operationId: CosmosAuthV1Beta1AccountInfo responses: - "200": + '200': description: A successful response. schema: type: object @@ -24,7 +24,7 @@ paths: pub_key: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type @@ -219,7 +219,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -410,7 +410,7 @@ paths: Since: cosmos-sdk 0.43 operationId: CosmosAuthV1Beta1Accounts responses: - "200": + '200': description: A successful response. schema: type: object @@ -420,7 +420,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -631,7 +631,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -865,7 +865,7 @@ paths: summary: Account returns account details based on address. operationId: CosmosAuthV1Beta1Account responses: - "200": + '200': description: A successful response. schema: type: object @@ -873,7 +873,7 @@ paths: account: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -1057,7 +1057,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -1238,17 +1238,17 @@ paths: /cosmos/auth/v1beta1/address_by_id/{id}: get: summary: AccountAddressByID returns account address based on account number. - description: "Since: cosmos-sdk 0.46.2" + description: 'Since: cosmos-sdk 0.46.2' operationId: CosmosAuthV1Beta1AccountAddressByID responses: - "200": + '200': description: A successful response. schema: type: object properties: account_address: type: string - description: "Since: cosmos-sdk 0.46.2" + description: 'Since: cosmos-sdk 0.46.2' title: >- QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method @@ -1267,7 +1267,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -1463,10 +1463,10 @@ paths: /cosmos/auth/v1beta1/bech32: get: summary: Bech32Prefix queries bech32Prefix - description: "Since: cosmos-sdk 0.46" + description: 'Since: cosmos-sdk 0.46' operationId: CosmosAuthV1Beta1Bech32Prefix responses: - "200": + '200': description: A successful response. schema: type: object @@ -1494,7 +1494,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -1669,10 +1669,10 @@ paths: /cosmos/auth/v1beta1/bech32/{address_bytes}: get: summary: AddressBytesToString converts Account Address bytes to string - description: "Since: cosmos-sdk 0.46" + description: 'Since: cosmos-sdk 0.46' operationId: CosmosAuthV1Beta1AddressBytesToString responses: - "200": + '200': description: A successful response. schema: type: object @@ -1700,7 +1700,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -1881,10 +1881,10 @@ paths: /cosmos/auth/v1beta1/bech32/{address_string}: get: summary: AddressStringToBytes converts Address string to bytes - description: "Since: cosmos-sdk 0.46" + description: 'Since: cosmos-sdk 0.46' operationId: CosmosAuthV1Beta1AddressStringToBytes responses: - "200": + '200': description: A successful response. schema: type: object @@ -1913,7 +1913,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -2093,10 +2093,10 @@ paths: /cosmos/auth/v1beta1/module_accounts: get: summary: ModuleAccounts returns all the existing module accounts. - description: "Since: cosmos-sdk 0.46" + description: 'Since: cosmos-sdk 0.46' operationId: CosmosAuthV1Beta1ModuleAccounts responses: - "200": + '200': description: A successful response. schema: type: object @@ -2106,7 +2106,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -2297,7 +2297,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -2474,7 +2474,7 @@ paths: summary: ModuleAccountByName returns the module account info by module name operationId: CosmosAuthV1Beta1ModuleAccountByName responses: - "200": + '200': description: A successful response. schema: type: object @@ -2482,7 +2482,7 @@ paths: account: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -2666,7 +2666,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -2848,7 +2848,7 @@ paths: summary: Params queries all parameters. operationId: CosmosAuthV1Beta1Params responses: - "200": + '200': description: A successful response. schema: type: object @@ -2890,7 +2890,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -3067,7 +3067,7 @@ paths: summary: Returns list of `Authorization`, granted to the grantee by the granter. operationId: CosmosAuthzV1Beta1Grants responses: - "200": + '200': description: A successful response. schema: type: object @@ -3080,7 +3080,7 @@ paths: authorization: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -3306,7 +3306,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -3553,10 +3553,10 @@ paths: /cosmos/authz/v1beta1/grants/grantee/{grantee}: get: summary: GranteeGrants returns a list of `GrantAuthorization` by grantee. - description: "Since: cosmos-sdk 0.46" + description: 'Since: cosmos-sdk 0.46' operationId: CosmosAuthzV1Beta1GranteeGrants responses: - "200": + '200': description: A successful response. schema: type: object @@ -3573,7 +3573,7 @@ paths: authorization: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -3791,7 +3791,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -4027,10 +4027,10 @@ paths: /cosmos/authz/v1beta1/grants/granter/{granter}: get: summary: GranterGrants returns list of `GrantAuthorization`, granted by granter. - description: "Since: cosmos-sdk 0.46" + description: 'Since: cosmos-sdk 0.46' operationId: CosmosAuthzV1Beta1GranterGrants responses: - "200": + '200': description: A successful response. schema: type: object @@ -4047,7 +4047,7 @@ paths: authorization: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -4265,7 +4265,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -4508,7 +4508,7 @@ paths: gas if the pagination field is incorrectly set. operationId: CosmosBankV1Beta1AllBalances responses: - "200": + '200': description: A successful response. schema: type: object @@ -4570,7 +4570,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -4642,7 +4642,7 @@ paths: summary: Balance queries the balance of a single coin for a single account. operationId: CosmosBankV1Beta1Balance responses: - "200": + '200': description: A successful response. schema: type: object @@ -4673,7 +4673,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -4706,7 +4706,7 @@ paths: Since: cosmos-sdk 0.46 operationId: CosmosBankV1Beta1DenomOwners responses: - "200": + '200': description: A successful response. schema: type: object @@ -4782,7 +4782,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -4858,7 +4858,7 @@ paths: denominations. operationId: CosmosBankV1Beta1DenomsMetadata responses: - "200": + '200': description: A successful response. schema: type: object @@ -4921,8 +4921,8 @@ paths: displayed in clients. name: type: string - description: "Since: cosmos-sdk 0.43" - title: "name defines the name of the token (eg: Cosmos Atom)" + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' symbol: type: string description: >- @@ -4996,7 +4996,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -5063,7 +5063,7 @@ paths: summary: DenomsMetadata queries the client metadata of a given coin denomination. operationId: CosmosBankV1Beta1DenomMetadata responses: - "200": + '200': description: A successful response. schema: type: object @@ -5127,8 +5127,8 @@ paths: displayed in clients. name: type: string - description: "Since: cosmos-sdk 0.43" - title: "name defines the name of the token (eg: Cosmos Atom)" + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' symbol: type: string description: >- @@ -5177,7 +5177,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -5193,7 +5193,7 @@ paths: summary: Params queries the parameters of x/bank module. operationId: CosmosBankV1Beta1Params responses: - "200": + '200': description: A successful response. schema: type: object @@ -5248,7 +5248,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -5269,7 +5269,7 @@ paths: Since: cosmos-sdk 0.47 operationId: CosmosBankV1Beta1SendEnabled responses: - "200": + '200': description: A successful response. schema: type: object @@ -5332,7 +5332,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -5421,7 +5421,7 @@ paths: Since: cosmos-sdk 0.46 operationId: CosmosBankV1Beta1SpendableBalances responses: - "200": + '200': description: A successful response. schema: type: object @@ -5486,7 +5486,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -5570,7 +5570,7 @@ paths: Since: cosmos-sdk 0.47 operationId: CosmosBankV1Beta1SpendableBalanceByDenom responses: - "200": + '200': description: A successful response. schema: type: object @@ -5606,7 +5606,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -5632,7 +5632,7 @@ paths: gas if the pagination field is incorrectly set. operationId: CosmosBankV1Beta1TotalSupply responses: - "200": + '200': description: A successful response. schema: type: object @@ -5697,7 +5697,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -5769,7 +5769,7 @@ paths: gas if the pagination field is incorrectly set. operationId: CosmosBankV1Beta1SupplyOf responses: - "200": + '200': description: A successful response. schema: type: object @@ -5800,7 +5800,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -5816,7 +5816,7 @@ paths: summary: Config queries for the operator configuration. operationId: CosmosBaseNodeV1Beta1Config responses: - "200": + '200': description: A successful response. schema: type: object @@ -5841,7 +5841,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -5856,10 +5856,10 @@ paths: contain a valid and supported path, including app, custom, p2p, and store. - description: "Since: cosmos-sdk 0.46" + description: 'Since: cosmos-sdk 0.46' operationId: CosmosBaseTendermintV1Beta1ABCIQuery responses: - "200": + '200': description: A successful response. schema: type: object @@ -5945,7 +5945,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -6141,7 +6141,7 @@ paths: summary: GetLatestBlock returns the latest block. operationId: CosmosBaseTendermintV1Beta1GetLatestBlock responses: - "200": + '200': description: A successful response. schema: type: object @@ -6164,7 +6164,7 @@ paths: title: PartsetHeader title: BlockID block: - title: "Deprecated: please use `sdk_block` instead" + title: 'Deprecated: please use `sdk_block` instead' type: object properties: header: @@ -6728,7 +6728,7 @@ paths: Commit contains the evidence that a block was committed by a set of validators. sdk_block: - title: "Since: cosmos-sdk 0.47" + title: 'Since: cosmos-sdk 0.47' type: object properties: header: @@ -7323,7 +7323,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -7500,7 +7500,7 @@ paths: summary: GetBlockByHeight queries block for given height. operationId: CosmosBaseTendermintV1Beta1GetBlockByHeight responses: - "200": + '200': description: A successful response. schema: type: object @@ -7523,7 +7523,7 @@ paths: title: PartsetHeader title: BlockID block: - title: "Deprecated: please use `sdk_block` instead" + title: 'Deprecated: please use `sdk_block` instead' type: object properties: header: @@ -8087,7 +8087,7 @@ paths: Commit contains the evidence that a block was committed by a set of validators. sdk_block: - title: "Since: cosmos-sdk 0.47" + title: 'Since: cosmos-sdk 0.47' type: object properties: header: @@ -8682,7 +8682,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -8865,7 +8865,7 @@ paths: summary: GetNodeInfo queries the current node info. operationId: CosmosBaseTendermintV1Beta1GetNodeInfo responses: - "200": + '200': description: A successful response. schema: type: object @@ -8937,7 +8937,7 @@ paths: title: Module is the type for VersionInfo cosmos_sdk_version: type: string - title: "Since: cosmos-sdk 0.43" + title: 'Since: cosmos-sdk 0.43' description: VersionInfo is the type for the GetNodeInfoResponse message. description: >- GetNodeInfoResponse is the response type for the Query/GetNodeInfo @@ -8957,7 +8957,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -9134,7 +9134,7 @@ paths: summary: GetSyncing queries node syncing. operationId: CosmosBaseTendermintV1Beta1GetSyncing responses: - "200": + '200': description: A successful response. schema: type: object @@ -9159,7 +9159,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -9336,7 +9336,7 @@ paths: summary: GetLatestValidatorSet queries latest validator-set. operationId: CosmosBaseTendermintV1Beta1GetLatestValidatorSet responses: - "200": + '200': description: A successful response. schema: type: object @@ -9354,7 +9354,7 @@ paths: pub_key: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -9570,7 +9570,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -9804,7 +9804,7 @@ paths: summary: GetValidatorSetByHeight queries validator-set at a given height. operationId: CosmosBaseTendermintV1Beta1GetValidatorSetByHeight responses: - "200": + '200': description: A successful response. schema: type: object @@ -9822,7 +9822,7 @@ paths: pub_key: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -10038,7 +10038,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -10277,7 +10277,7 @@ paths: summary: Params queries the parameters of x/consensus_param module. operationId: CosmosConsensusV1Params responses: - "200": + '200': description: A successful response. schema: type: object @@ -10385,7 +10385,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -10395,7 +10395,7 @@ paths: summary: CommunityPool queries the community pool coins. operationId: CosmosDistributionV1Beta1CommunityPool responses: - "200": + '200': description: A successful response. schema: type: object @@ -10439,7 +10439,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -10451,7 +10451,7 @@ paths: validator. operationId: CosmosDistributionV1Beta1DelegationTotalRewards responses: - "200": + '200': description: A successful response. schema: type: object @@ -10522,7 +10522,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -10538,7 +10538,7 @@ paths: summary: DelegationRewards queries the total rewards accrued by a delegation. operationId: CosmosDistributionV1Beta1DelegationRewards responses: - "200": + '200': description: A successful response. schema: type: object @@ -10580,7 +10580,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -10601,7 +10601,7 @@ paths: summary: DelegatorValidators queries the validators of a delegator. operationId: CosmosDistributionV1Beta1DelegatorValidators responses: - "200": + '200': description: A successful response. schema: type: object @@ -10631,7 +10631,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -10647,7 +10647,7 @@ paths: summary: DelegatorWithdrawAddress queries withdraw address of a delegator. operationId: CosmosDistributionV1Beta1DelegatorWithdrawAddress responses: - "200": + '200': description: A successful response. schema: type: object @@ -10673,7 +10673,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -10689,7 +10689,7 @@ paths: summary: Params queries params of the distribution module. operationId: CosmosDistributionV1Beta1Params responses: - "200": + '200': description: A successful response. schema: type: object @@ -10734,7 +10734,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -10746,7 +10746,7 @@ paths: self-delegation rewards for validator operationId: CosmosDistributionV1Beta1ValidatorDistributionInfo responses: - "200": + '200': description: A successful response. schema: type: object @@ -10810,7 +10810,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -10826,7 +10826,7 @@ paths: summary: ValidatorCommission queries accumulated commission for a validator. operationId: CosmosDistributionV1Beta1ValidatorCommission responses: - "200": + '200': description: A successful response. schema: type: object @@ -10871,7 +10871,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -10887,7 +10887,7 @@ paths: summary: ValidatorOutstandingRewards queries rewards of a validator address. operationId: CosmosDistributionV1Beta1ValidatorOutstandingRewards responses: - "200": + '200': description: A successful response. schema: type: object @@ -10939,7 +10939,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -10955,7 +10955,7 @@ paths: summary: ValidatorSlashes queries slash events of a validator. operationId: CosmosDistributionV1Beta1ValidatorSlashes responses: - "200": + '200': description: A successful response. schema: type: object @@ -11018,7 +11018,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -11106,7 +11106,7 @@ paths: summary: AllEvidence queries all evidence. operationId: CosmosEvidenceV1Beta1AllEvidence responses: - "200": + '200': description: A successful response. schema: type: object @@ -11116,7 +11116,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -11326,7 +11326,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -11560,7 +11560,7 @@ paths: summary: Evidence queries evidence based on evidence hash. operationId: CosmosEvidenceV1Beta1Evidence responses: - "200": + '200': description: A successful response. schema: type: object @@ -11569,7 +11569,7 @@ paths: description: evidence returns the requested evidence. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -11645,7 +11645,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -11839,7 +11839,7 @@ paths: summary: Allowance returns fee granted to the grantee by the granter. operationId: CosmosFeegrantV1Beta1Allowance responses: - "200": + '200': description: A successful response. schema: type: object @@ -11864,7 +11864,7 @@ paths: allowance. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type @@ -11944,7 +11944,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -12136,7 +12136,7 @@ paths: summary: Allowances returns all the grants for address. operationId: CosmosFeegrantV1Beta1Allowances responses: - "200": + '200': description: A successful response. schema: type: object @@ -12162,7 +12162,7 @@ paths: allowance. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -12262,7 +12262,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -12498,10 +12498,10 @@ paths: /cosmos/feegrant/v1beta1/issued/{granter}: get: summary: AllowancesByGranter returns all the grants given by an address - description: "Since: cosmos-sdk 0.46" + description: 'Since: cosmos-sdk 0.46' operationId: CosmosFeegrantV1Beta1AllowancesByGranter responses: - "200": + '200': description: A successful response. schema: type: object @@ -12527,7 +12527,7 @@ paths: allowance. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -12630,7 +12630,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -12868,7 +12868,7 @@ paths: summary: Params queries all parameters of the gov module. operationId: CosmosGovV1Params responses: - "200": + '200': description: A successful response. schema: type: object @@ -13022,7 +13022,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -13209,7 +13209,7 @@ paths: summary: Proposals queries all proposals based on given status. operationId: CosmosGovV1Proposals responses: - "200": + '200': description: A successful response. schema: type: object @@ -13228,7 +13228,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -13485,15 +13485,15 @@ paths: proposal. title: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: title is the title of the proposal summary: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: summary is a short summary of the proposal proposer: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: Proposer is the address of the proposal sumbitter description: >- Proposal defines the core field members of a governance @@ -13538,7 +13538,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -13808,7 +13808,7 @@ paths: summary: Proposal queries proposal details based on ProposalID. operationId: CosmosGovV1Proposal responses: - "200": + '200': description: A successful response. schema: type: object @@ -13826,7 +13826,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -14082,15 +14082,15 @@ paths: proposal. title: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: title is the title of the proposal summary: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: summary is a short summary of the proposal proposer: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: Proposer is the address of the proposal sumbitter description: >- QueryProposalResponse is the response type for the Query/Proposal @@ -14110,7 +14110,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -14294,7 +14294,7 @@ paths: summary: Deposits queries all deposits of a single proposal. operationId: CosmosGovV1Deposits responses: - "200": + '200': description: A successful response. schema: type: object @@ -14375,7 +14375,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -14617,7 +14617,7 @@ paths: depositAddr. operationId: CosmosGovV1Deposit responses: - "200": + '200': description: A successful response. schema: type: object @@ -14671,7 +14671,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -14860,7 +14860,7 @@ paths: summary: TallyResult queries the tally of a proposal vote. operationId: CosmosGovV1TallyResult responses: - "200": + '200': description: A successful response. schema: type: object @@ -14903,7 +14903,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -15087,7 +15087,7 @@ paths: summary: Votes queries votes of a given proposal. operationId: CosmosGovV1Votes responses: - "200": + '200': description: A successful response. schema: type: object @@ -15178,7 +15178,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -15418,7 +15418,7 @@ paths: summary: Vote queries voted information based on proposalID, voterAddr. operationId: CosmosGovV1Vote responses: - "200": + '200': description: A successful response. schema: type: object @@ -15483,7 +15483,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -15672,7 +15672,7 @@ paths: summary: Params queries all parameters of the gov module. operationId: CosmosGovV1Beta1Params responses: - "200": + '200': description: A successful response. schema: type: object @@ -15757,7 +15757,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -15944,7 +15944,7 @@ paths: summary: Proposals queries all proposals based on given status. operationId: CosmosGovV1Beta1Proposals responses: - "200": + '200': description: A successful response. schema: type: object @@ -15962,7 +15962,7 @@ paths: description: content is the proposal's content. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -16043,7 +16043,7 @@ paths: proposal's voting period has ended. type: object properties: - "yes": + 'yes': type: string description: yes is the number of yes votes on a proposal. abstain: @@ -16051,7 +16051,7 @@ paths: description: >- abstain is the number of abstain votes on a proposal. - "no": + 'no': type: string description: no is the number of no votes on a proposal. no_with_veto: @@ -16139,7 +16139,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -16409,7 +16409,7 @@ paths: summary: Proposal queries proposal details based on ProposalID. operationId: CosmosGovV1Beta1Proposal responses: - "200": + '200': description: A successful response. schema: type: object @@ -16425,7 +16425,7 @@ paths: description: content is the proposal's content. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type @@ -16506,13 +16506,13 @@ paths: proposal's voting period has ended. type: object properties: - "yes": + 'yes': type: string description: yes is the number of yes votes on a proposal. abstain: type: string description: abstain is the number of abstain votes on a proposal. - "no": + 'no': type: string description: no is the number of no votes on a proposal. no_with_veto: @@ -16577,7 +16577,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -16761,7 +16761,7 @@ paths: summary: Deposits queries all deposits of a single proposal. operationId: CosmosGovV1Beta1Deposits responses: - "200": + '200': description: A successful response. schema: type: object @@ -16842,7 +16842,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -17084,7 +17084,7 @@ paths: depositAddr. operationId: CosmosGovV1Beta1Deposit responses: - "200": + '200': description: A successful response. schema: type: object @@ -17138,7 +17138,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -17327,7 +17327,7 @@ paths: summary: TallyResult queries the tally of a proposal vote. operationId: CosmosGovV1Beta1TallyResult responses: - "200": + '200': description: A successful response. schema: type: object @@ -17336,13 +17336,13 @@ paths: description: tally defines the requested tally. type: object properties: - "yes": + 'yes': type: string description: yes is the number of yes votes on a proposal. abstain: type: string description: abstain is the number of abstain votes on a proposal. - "no": + 'no': type: string description: no is the number of no votes on a proposal. no_with_veto: @@ -17368,7 +17368,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -17552,7 +17552,7 @@ paths: summary: Votes queries votes of a given proposal. operationId: CosmosGovV1Beta1Votes responses: - "200": + '200': description: A successful response. schema: type: object @@ -17662,7 +17662,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -17902,7 +17902,7 @@ paths: summary: Vote queries voted information based on proposalID, voterAddr. operationId: CosmosGovV1Beta1Vote responses: - "200": + '200': description: A successful response. schema: type: object @@ -17986,7 +17986,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -18175,7 +18175,7 @@ paths: summary: GroupInfo queries group info based on group id. operationId: CosmosGroupV1GroupInfo responses: - "200": + '200': description: A successful response. schema: type: object @@ -18236,7 +18236,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -18420,7 +18420,7 @@ paths: summary: GroupMembers queries members of a group by group id. operationId: CosmosGroupV1GroupMembers responses: - "200": + '200': description: A successful response. schema: type: object @@ -18498,7 +18498,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -18738,7 +18738,7 @@ paths: summary: GroupPoliciesByAdmin queries group policies by admin address. operationId: CosmosGroupV1GroupPoliciesByAdmin responses: - "200": + '200': description: A successful response. schema: type: object @@ -18782,7 +18782,7 @@ paths: policy. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -18890,7 +18890,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -19129,7 +19129,7 @@ paths: summary: GroupPoliciesByGroup queries group policies by group id. operationId: CosmosGroupV1GroupPoliciesByGroup responses: - "200": + '200': description: A successful response. schema: type: object @@ -19173,7 +19173,7 @@ paths: policy. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -19281,7 +19281,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -19523,7 +19523,7 @@ paths: group policy. operationId: CosmosGroupV1GroupPolicyInfo responses: - "200": + '200': description: A successful response. schema: type: object @@ -19566,7 +19566,7 @@ paths: policy. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type @@ -19649,7 +19649,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -19830,10 +19830,10 @@ paths: /cosmos/group/v1/groups: get: summary: Groups queries all groups in state. - description: "Since: cosmos-sdk 0.47.1" + description: 'Since: cosmos-sdk 0.47.1' operationId: CosmosGroupV1Groups responses: - "200": + '200': description: A successful response. schema: type: object @@ -19882,7 +19882,7 @@ paths: description: >- GroupInfo represents the high-level on-chain information for a group. - description: "`groups` is all the groups present in state." + description: '`groups` is all the groups present in state.' pagination: description: pagination defines the pagination in the response. type: object @@ -19921,7 +19921,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -20155,7 +20155,7 @@ paths: summary: GroupsByAdmin queries groups by admin address. operationId: CosmosGroupV1GroupsByAdmin responses: - "200": + '200': description: A successful response. schema: type: object @@ -20242,7 +20242,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -20481,7 +20481,7 @@ paths: summary: GroupsByMember queries groups by member address. operationId: CosmosGroupV1GroupsByMember responses: - "200": + '200': description: A successful response. schema: type: object @@ -20568,7 +20568,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -20807,7 +20807,7 @@ paths: summary: Proposal queries a proposal based on proposal id. operationId: CosmosGroupV1Proposal responses: - "200": + '200': description: A successful response. schema: type: object @@ -20939,7 +20939,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -21116,11 +21116,11 @@ paths: the proposal passes. title: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: title is the title of the proposal summary: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: summary is a short summary of the proposal description: QueryProposalResponse is the Query/Proposal response type. default: @@ -21138,7 +21138,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -21332,7 +21332,7 @@ paths: proposal itself. operationId: CosmosGroupV1TallyResult responses: - "200": + '200': description: A successful response. schema: type: object @@ -21369,7 +21369,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -21555,7 +21555,7 @@ paths: group policy. operationId: CosmosGroupV1ProposalsByGroupPolicy responses: - "200": + '200': description: A successful response. schema: type: object @@ -21688,7 +21688,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -21865,11 +21865,11 @@ paths: if the proposal passes. title: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: title is the title of the proposal summary: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: summary is a short summary of the proposal description: >- Proposal defines a group proposal. Any member of a group can @@ -21920,7 +21920,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -22161,7 +22161,7 @@ paths: summary: VoteByProposalVoter queries a vote by proposal id and voter. operationId: CosmosGroupV1VoteByProposalVoter responses: - "200": + '200': description: A successful response. schema: type: object @@ -22212,7 +22212,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -22401,7 +22401,7 @@ paths: summary: VotesByProposal queries a vote by proposal id. operationId: CosmosGroupV1VotesByProposal responses: - "200": + '200': description: A successful response. schema: type: object @@ -22476,7 +22476,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -22716,7 +22716,7 @@ paths: summary: VotesByVoter queries a vote by voter. operationId: CosmosGroupV1VotesByVoter responses: - "200": + '200': description: A successful response. schema: type: object @@ -22789,7 +22789,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -23028,7 +23028,7 @@ paths: summary: AnnualProvisions current minting annual provisions value. operationId: CosmosMintV1Beta1AnnualProvisions responses: - "200": + '200': description: A successful response. schema: type: object @@ -23057,7 +23057,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -23067,7 +23067,7 @@ paths: summary: Inflation returns the current minting inflation value. operationId: CosmosMintV1Beta1Inflation responses: - "200": + '200': description: A successful response. schema: type: object @@ -23096,7 +23096,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -23106,7 +23106,7 @@ paths: summary: Params returns the total set of minting parameters. operationId: CosmosMintV1Beta1Params responses: - "200": + '200': description: A successful response. schema: type: object @@ -23152,7 +23152,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -23164,7 +23164,7 @@ paths: same as balanceOf in ERC721 operationId: CosmosNftV1Beta1Balance responses: - "200": + '200': description: A successful response. schema: type: object @@ -23193,7 +23193,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -23381,7 +23381,7 @@ paths: summary: Classes queries all NFT classes operationId: CosmosNftV1Beta1Classes responses: - "200": + '200': description: A successful response. schema: type: object @@ -23429,7 +23429,7 @@ paths: Optional type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -23640,7 +23640,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -23874,7 +23874,7 @@ paths: summary: Class queries an NFT class based on its id operationId: CosmosNftV1Beta1Class responses: - "200": + '200': description: A successful response. schema: type: object @@ -23919,7 +23919,7 @@ paths: Optional type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type @@ -24107,7 +24107,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -24294,7 +24294,7 @@ paths: ERC721Enumerable operationId: CosmosNftV1Beta1NFTs responses: - "200": + '200': description: A successful response. schema: type: object @@ -24322,7 +24322,7 @@ paths: title: data is an app specific data of the NFT. Optional type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -24533,7 +24533,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -24777,7 +24777,7 @@ paths: summary: NFT queries an NFT based on its class and id. operationId: CosmosNftV1Beta1NFT responses: - "200": + '200': description: A successful response. schema: type: object @@ -24804,7 +24804,7 @@ paths: title: data is an app specific data of the NFT. Optional type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type @@ -24991,7 +24991,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -25181,7 +25181,7 @@ paths: ownerOf in ERC721 operationId: CosmosNftV1Beta1Owner responses: - "200": + '200': description: A successful response. schema: type: object @@ -25207,7 +25207,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -25397,7 +25397,7 @@ paths: totalSupply of ERC721. operationId: CosmosNftV1Beta1Supply responses: - "200": + '200': description: A successful response. schema: type: object @@ -25424,7 +25424,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -25609,7 +25609,7 @@ paths: key. operationId: CosmosParamsV1Beta1Params responses: - "200": + '200': description: A successful response. schema: type: object @@ -25642,7 +25642,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -25663,10 +25663,10 @@ paths: summary: >- Subspaces queries for all registered subspaces and all keys for a subspace. - description: "Since: cosmos-sdk 0.46" + description: 'Since: cosmos-sdk 0.46' operationId: CosmosParamsV1Beta1Subspaces responses: - "200": + '200': description: A successful response. schema: type: object @@ -25713,7 +25713,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -25723,7 +25723,7 @@ paths: summary: Params queries the parameters of slashing module operationId: CosmosSlashingV1Beta1Params responses: - "200": + '200': description: A successful response. schema: type: object @@ -25766,7 +25766,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -25776,7 +25776,7 @@ paths: summary: SigningInfos queries signing info of all validators operationId: CosmosSlashingV1Beta1SigningInfos responses: - "200": + '200': description: A successful response. schema: type: object @@ -25882,7 +25882,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -25949,7 +25949,7 @@ paths: summary: SigningInfo queries the signing info of given cons address operationId: CosmosSlashingV1Beta1SigningInfo responses: - "200": + '200': description: A successful response. schema: type: object @@ -26027,7 +26027,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -26050,7 +26050,7 @@ paths: gas if the pagination field is incorrectly set. operationId: CosmosStakingV1Beta1DelegatorDelegations responses: - "200": + '200': description: A successful response. schema: type: object @@ -26145,7 +26145,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -26389,7 +26389,7 @@ paths: gas if the pagination field is incorrectly set. operationId: CosmosStakingV1Beta1Redelegations responses: - "200": + '200': description: A successful response. schema: type: object @@ -26573,7 +26573,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -26831,7 +26831,7 @@ paths: gas if the pagination field is incorrectly set. operationId: CosmosStakingV1Beta1DelegatorUnbondingDelegations responses: - "200": + '200': description: A successful response. schema: type: object @@ -26941,7 +26941,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -27187,7 +27187,7 @@ paths: gas if the pagination field is incorrectly set. operationId: CosmosStakingV1Beta1DelegatorValidators responses: - "200": + '200': description: A successful response. schema: type: object @@ -27208,7 +27208,7 @@ paths: validator, as a Protobuf Any. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -27447,7 +27447,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -27688,7 +27688,7 @@ paths: pair. operationId: CosmosStakingV1Beta1DelegatorValidator responses: - "200": + '200': description: A successful response. schema: type: object @@ -27708,7 +27708,7 @@ paths: validator, as a Protobuf Any. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type @@ -27903,7 +27903,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -28091,7 +28091,7 @@ paths: summary: HistoricalInfo queries the historical info for given height. operationId: CosmosStakingV1Beta1HistoricalInfo responses: - "200": + '200': description: A successful response. schema: type: object @@ -28204,7 +28204,7 @@ paths: validator, as a Protobuf Any. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -28426,7 +28426,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -28610,7 +28610,7 @@ paths: summary: Parameters queries the staking parameters. operationId: CosmosStakingV1Beta1Params responses: - "200": + '200': description: A successful response. schema: type: object @@ -28664,7 +28664,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -28841,7 +28841,7 @@ paths: summary: Pool queries the pool info. operationId: CosmosStakingV1Beta1Pool responses: - "200": + '200': description: A successful response. schema: type: object @@ -28870,7 +28870,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -29052,7 +29052,7 @@ paths: gas if the pagination field is incorrectly set. operationId: CosmosStakingV1Beta1Validators responses: - "200": + '200': description: A successful response. schema: type: object @@ -29073,7 +29073,7 @@ paths: validator, as a Protobuf Any. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -29312,7 +29312,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -29551,7 +29551,7 @@ paths: summary: Validator queries validator info for given validator address. operationId: CosmosStakingV1Beta1Validator responses: - "200": + '200': description: A successful response. schema: type: object @@ -29571,7 +29571,7 @@ paths: validator, as a Protobuf Any. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type @@ -29766,7 +29766,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -29954,7 +29954,7 @@ paths: gas if the pagination field is incorrectly set. operationId: CosmosStakingV1Beta1ValidatorDelegations responses: - "200": + '200': description: A successful response. schema: type: object @@ -30046,7 +30046,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -30285,7 +30285,7 @@ paths: summary: Delegation queries delegate info for given validator delegator pair. operationId: CosmosStakingV1Beta1Delegation responses: - "200": + '200': description: A successful response. schema: type: object @@ -30353,7 +30353,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -30543,7 +30543,7 @@ paths: pair. operationId: CosmosStakingV1Beta1UnbondingDelegation responses: - "200": + '200': description: A successful response. schema: type: object @@ -30624,7 +30624,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -30819,7 +30819,7 @@ paths: gas if the pagination field is incorrectly set. operationId: CosmosStakingV1Beta1ValidatorUnbondingDelegations responses: - "200": + '200': description: A successful response. schema: type: object @@ -30929,7 +30929,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -31166,13 +31166,13 @@ paths: /cosmos/tx/v1beta1/decode: post: summary: TxDecode decodes the transaction. - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' operationId: CosmosTxV1Beta1TxDecode responses: - "200": + '200': description: A successful response. schema: - $ref: "#/definitions/cosmos.tx.v1beta1.TxDecodeResponse" + $ref: '#/definitions/cosmos.tx.v1beta1.TxDecodeResponse' default: description: An unexpected error response. schema: @@ -31188,7 +31188,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -31384,10 +31384,10 @@ paths: /cosmos/tx/v1beta1/decode/amino: post: summary: TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' operationId: CosmosTxV1Beta1TxDecodeAmino responses: - "200": + '200': description: A successful response. schema: type: object @@ -31417,7 +31417,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -31618,10 +31618,10 @@ paths: /cosmos/tx/v1beta1/encode: post: summary: TxEncode encodes the transaction. - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' operationId: CosmosTxV1Beta1TxEncode responses: - "200": + '200': description: A successful response. schema: type: object @@ -31650,7 +31650,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -31830,16 +31830,16 @@ paths: in: body required: true schema: - $ref: "#/definitions/cosmos.tx.v1beta1.TxEncodeRequest" + $ref: '#/definitions/cosmos.tx.v1beta1.TxEncodeRequest' tags: - Service /cosmos/tx/v1beta1/encode/amino: post: summary: TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' operationId: CosmosTxV1Beta1TxEncodeAmino responses: - "200": + '200': description: A successful response. schema: type: object @@ -31870,7 +31870,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -32072,7 +32072,7 @@ paths: summary: Simulate simulates executing a transaction for estimating gas usage. operationId: CosmosTxV1Beta1Simulate responses: - "200": + '200': description: A successful response. schema: type: object @@ -32154,7 +32154,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -32350,7 +32350,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -32528,7 +32528,7 @@ paths: in: body required: true schema: - $ref: "#/definitions/cosmos.tx.v1beta1.SimulateRequest" + $ref: '#/definitions/cosmos.tx.v1beta1.SimulateRequest' tags: - Service /cosmos/tx/v1beta1/txs: @@ -32536,10 +32536,10 @@ paths: summary: GetTxsEvent fetches txs by event. operationId: CosmosTxV1Beta1GetTxsEvent responses: - "200": + '200': description: A successful response. schema: - $ref: "#/definitions/cosmos.tx.v1beta1.GetTxsEventResponse" + $ref: '#/definitions/cosmos.tx.v1beta1.GetTxsEventResponse' default: description: An unexpected error response. schema: @@ -32555,7 +32555,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -32827,7 +32827,7 @@ paths: summary: BroadcastTx broadcast transaction. operationId: CosmosTxV1Beta1BroadcastTx responses: - "200": + '200': description: A successful response. schema: type: object @@ -32923,7 +32923,7 @@ paths: description: The request transaction bytes. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type @@ -33055,7 +33055,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -33271,13 +33271,13 @@ paths: /cosmos/tx/v1beta1/txs/block/{height}: get: summary: GetBlockWithTxs fetches a block with decoded txs. - description: "Since: cosmos-sdk 0.45.2" + description: 'Since: cosmos-sdk 0.45.2' operationId: CosmosTxV1Beta1GetBlockWithTxs responses: - "200": + '200': description: A successful response. schema: - $ref: "#/definitions/cosmos.tx.v1beta1.GetBlockWithTxsResponse" + $ref: '#/definitions/cosmos.tx.v1beta1.GetBlockWithTxsResponse' default: description: An unexpected error response. schema: @@ -33293,7 +33293,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -33533,10 +33533,10 @@ paths: summary: GetTx fetches a tx by hash. operationId: CosmosTxV1Beta1GetTx responses: - "200": + '200': description: A successful response. schema: - $ref: "#/definitions/cosmos.tx.v1beta1.GetTxResponse" + $ref: '#/definitions/cosmos.tx.v1beta1.GetTxResponse' default: description: An unexpected error response. schema: @@ -33552,7 +33552,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -33735,7 +33735,7 @@ paths: summary: AppliedPlan queries a previously applied upgrade plan by its name. operationId: CosmosUpgradeV1Beta1AppliedPlan responses: - "200": + '200': description: A successful response. schema: type: object @@ -33764,7 +33764,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -33945,17 +33945,17 @@ paths: /cosmos/upgrade/v1beta1/authority: get: summary: Returns the account with authority to conduct upgrades - description: "Since: cosmos-sdk 0.46" + description: 'Since: cosmos-sdk 0.46' operationId: CosmosUpgradeV1Beta1Authority responses: - "200": + '200': description: A successful response. schema: type: object properties: address: type: string - description: "Since: cosmos-sdk 0.46" + description: 'Since: cosmos-sdk 0.46' title: QueryAuthorityResponse is the response type for Query/Authority default: description: An unexpected error response. @@ -33972,7 +33972,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -34149,7 +34149,7 @@ paths: summary: CurrentPlan queries the current upgrade plan. operationId: CosmosUpgradeV1Beta1CurrentPlan responses: - "200": + '200': description: A successful response. schema: type: object @@ -34212,7 +34212,7 @@ paths: If this field is not empty, an error will be thrown. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type @@ -34291,7 +34291,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -34466,10 +34466,10 @@ paths: /cosmos/upgrade/v1beta1/module_versions: get: summary: ModuleVersions queries the list of module versions from state. - description: "Since: cosmos-sdk 0.43" + description: 'Since: cosmos-sdk 0.43' operationId: CosmosUpgradeV1Beta1ModuleVersions responses: - "200": + '200': description: A successful response. schema: type: object @@ -34516,7 +34516,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -34713,7 +34713,7 @@ paths: (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) operationId: CosmosUpgradeV1Beta1UpgradedConsensusState responses: - "200": + '200': description: A successful response. schema: type: object @@ -34721,7 +34721,7 @@ paths: upgraded_consensus_state: type: string format: byte - title: "Since: cosmos-sdk 0.43" + title: 'Since: cosmos-sdk 0.43' description: >- QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState @@ -34742,7 +34742,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -34930,7 +34930,7 @@ paths: owner address on a given connection operationId: IbcApplicationsInterchainAccountsControllerV1InterchainAccount responses: - "200": + '200': description: A successful response. schema: type: object @@ -34955,7 +34955,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -35141,7 +35141,7 @@ paths: summary: Params queries all parameters of the ICA controller submodule. operationId: IbcApplicationsInterchainAccountsControllerV1Params responses: - "200": + '200': description: A successful response. schema: type: object @@ -35173,7 +35173,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -35350,7 +35350,7 @@ paths: summary: Params queries all parameters of the ICA host submodule. operationId: IbcApplicationsInterchainAccountsHostV1Params responses: - "200": + '200': description: A successful response. schema: type: object @@ -35387,7 +35387,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -35399,7 +35399,7 @@ paths: channel id. operationId: IbcApplicationsTransferV1EscrowAddress responses: - "200": + '200': description: A successful response. schema: type: object @@ -35425,7 +35425,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -35613,7 +35613,7 @@ paths: summary: DenomHash queries a denomination hash information. operationId: IbcApplicationsTransferV1DenomHash responses: - "200": + '200': description: A successful response. schema: type: object @@ -35641,7 +35641,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -35825,7 +35825,7 @@ paths: summary: DenomTraces queries all denomination traces. operationId: IbcApplicationsTransferV1DenomTraces responses: - "200": + '200': description: A successful response. schema: type: object @@ -35890,7 +35890,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -36124,7 +36124,7 @@ paths: summary: DenomTrace queries a denomination trace information. operationId: IbcApplicationsTransferV1DenomTrace responses: - "200": + '200': description: A successful response. schema: type: object @@ -36165,7 +36165,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -36353,7 +36353,7 @@ paths: on the denom. operationId: IbcApplicationsTransferV1TotalEscrowForDenom responses: - "200": + '200': description: A successful response. schema: type: object @@ -36391,7 +36391,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -36574,7 +36574,7 @@ paths: summary: Params queries all parameters of the ibc-transfer module. operationId: IbcApplicationsTransferV1Params responses: - "200": + '200': description: A successful response. schema: type: object @@ -36615,7 +36615,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -36792,7 +36792,7 @@ paths: summary: Channels queries all the IBC channels of a chain. operationId: IbcCoreChannelV1Channels responses: - "200": + '200': description: A successful response. schema: type: object @@ -36953,7 +36953,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -37187,7 +37187,7 @@ paths: summary: Channel queries an IBC Channel. operationId: IbcCoreChannelV1Channel responses: - "200": + '200': description: A successful response. schema: type: object @@ -37322,7 +37322,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -37514,7 +37514,7 @@ paths: with the provided channel identifiers. operationId: IbcCoreChannelV1ChannelClientState responses: - "200": + '200': description: A successful response. schema: type: object @@ -37530,7 +37530,7 @@ paths: title: client state type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type @@ -37756,7 +37756,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -37946,7 +37946,7 @@ paths: associated with the provided channel identifiers. operationId: IbcCoreChannelV1ChannelConsensusState responses: - "200": + '200': description: A successful response. schema: type: object @@ -37955,7 +37955,7 @@ paths: title: consensus state associated with the channel type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -38175,7 +38175,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -38377,7 +38377,7 @@ paths: channel. operationId: IbcCoreChannelV1NextSequenceReceive responses: - "200": + '200': description: A successful response. schema: type: object @@ -38437,7 +38437,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -38629,7 +38629,7 @@ paths: with a channel. operationId: IbcCoreChannelV1PacketAcknowledgements responses: - "200": + '200': description: A successful response. schema: type: object @@ -38739,7 +38739,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -38992,7 +38992,7 @@ paths: summary: PacketAcknowledgement queries a stored packet acknowledgement hash. operationId: IbcCoreChannelV1PacketAcknowledgement responses: - "200": + '200': description: A successful response. schema: type: object @@ -39056,7 +39056,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -39252,7 +39252,7 @@ paths: with a channel. operationId: IbcCoreChannelV1PacketCommitments responses: - "200": + '200': description: A successful response. schema: type: object @@ -39362,7 +39362,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -39610,7 +39610,7 @@ paths: with a channel and sequences. operationId: IbcCoreChannelV1UnreceivedAcks responses: - "200": + '200': description: A successful response. schema: type: object @@ -39668,7 +39668,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -39870,7 +39870,7 @@ paths: channel and sequences. operationId: IbcCoreChannelV1UnreceivedPackets responses: - "200": + '200': description: A successful response. schema: type: object @@ -39928,7 +39928,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -40126,7 +40126,7 @@ paths: summary: PacketCommitment queries a stored packet commitment hash. operationId: IbcCoreChannelV1PacketCommitment responses: - "200": + '200': description: A successful response. schema: type: object @@ -40191,7 +40191,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -40389,7 +40389,7 @@ paths: queried chain operationId: IbcCoreChannelV1PacketReceipt responses: - "200": + '200': description: A successful response. schema: type: object @@ -40453,7 +40453,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -40649,7 +40649,7 @@ paths: end. operationId: IbcCoreChannelV1ConnectionChannels responses: - "200": + '200': description: A successful response. schema: type: object @@ -40810,7 +40810,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -41049,7 +41049,7 @@ paths: summary: ClientStates queries all the IBC light clients of a chain. operationId: IbcCoreClientV1ClientStates responses: - "200": + '200': description: A successful response. schema: type: object @@ -41066,7 +41066,7 @@ paths: title: client state type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -41293,7 +41293,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -41527,7 +41527,7 @@ paths: summary: ClientState queries an IBC light client. operationId: IbcCoreClientV1ClientState responses: - "200": + '200': description: A successful response. schema: type: object @@ -41536,7 +41536,7 @@ paths: title: client state associated with the request identifier type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -41758,7 +41758,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -41941,7 +41941,7 @@ paths: summary: Status queries the status of an IBC client. operationId: IbcCoreClientV1ClientStatus responses: - "200": + '200': description: A successful response. schema: type: object @@ -41968,7 +41968,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -42153,7 +42153,7 @@ paths: client. operationId: IbcCoreClientV1ConsensusStates responses: - "200": + '200': description: A successful response. schema: type: object @@ -42196,7 +42196,7 @@ paths: title: consensus state type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the @@ -42421,7 +42421,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -42662,7 +42662,7 @@ paths: associated with a given client. operationId: IbcCoreClientV1ConsensusStateHeights responses: - "200": + '200': description: A successful response. schema: type: object @@ -42752,7 +42752,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -42995,7 +42995,7 @@ paths: a given height. operationId: IbcCoreClientV1ConsensusState responses: - "200": + '200': description: A successful response. schema: type: object @@ -43006,7 +43006,7 @@ paths: given height type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -43225,7 +43225,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -43429,7 +43429,7 @@ paths: summary: ClientParams queries all parameters of the ibc client submodule. operationId: IbcCoreClientV1ClientParams responses: - "200": + '200': description: A successful response. schema: type: object @@ -43471,7 +43471,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -43648,7 +43648,7 @@ paths: summary: UpgradedClientState queries an Upgraded IBC light client. operationId: IbcCoreClientV1UpgradedClientState responses: - "200": + '200': description: A successful response. schema: type: object @@ -43657,7 +43657,7 @@ paths: title: client state associated with the request identifier type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -43841,7 +43841,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -44018,7 +44018,7 @@ paths: summary: UpgradedConsensusState queries an Upgraded IBC consensus state. operationId: IbcCoreClientV1UpgradedConsensusState responses: - "200": + '200': description: A successful response. schema: type: object @@ -44027,7 +44027,7 @@ paths: title: Consensus state associated with the request identifier type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -44211,7 +44211,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -44390,7 +44390,7 @@ paths: state. operationId: IbcCoreConnectionV1ClientConnections responses: - "200": + '200': description: A successful response. schema: type: object @@ -44451,7 +44451,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -44634,7 +44634,7 @@ paths: summary: Connections queries all the IBC connections of a chain. operationId: IbcCoreConnectionV1Connections responses: - "200": + '200': description: A successful response. schema: type: object @@ -44804,7 +44804,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -45038,7 +45038,7 @@ paths: summary: Connection queries an IBC connection end. operationId: IbcCoreConnectionV1Connection responses: - "200": + '200': description: A successful response. schema: type: object @@ -45192,7 +45192,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -45377,7 +45377,7 @@ paths: connection. operationId: IbcCoreConnectionV1ConnectionClientState responses: - "200": + '200': description: A successful response. schema: type: object @@ -45393,7 +45393,7 @@ paths: title: client state type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type @@ -45619,7 +45619,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -45804,7 +45804,7 @@ paths: connection. operationId: IbcCoreConnectionV1ConnectionConsensusState responses: - "200": + '200': description: A successful response. schema: type: object @@ -45813,7 +45813,7 @@ paths: title: consensus state associated with the channel type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -46033,7 +46033,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -46226,7 +46226,7 @@ paths: summary: ConnectionParams queries all parameters of the ibc connection submodule. operationId: IbcCoreConnectionV1ConnectionParams responses: - "200": + '200': description: A successful response. schema: type: object @@ -46265,7 +46265,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -46441,7 +46441,7 @@ paths: get: operationId: PocketApplicationApplicationAll responses: - "200": + '200': description: A successful response. schema: type: object @@ -46558,7 +46558,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -46625,7 +46625,7 @@ paths: summary: Queries a list of Application items. operationId: PocketApplicationApplication responses: - "200": + '200': description: A successful response. schema: type: object @@ -46712,7 +46712,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -46727,7 +46727,7 @@ paths: summary: Parameters queries the parameters of the module. operationId: PocketApplicationParams responses: - "200": + '200': description: A successful response. schema: type: object @@ -46760,7 +46760,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -46769,7 +46769,7 @@ paths: get: operationId: PocketGatewayGatewayAll responses: - "200": + '200': description: A successful response. schema: type: object @@ -46841,7 +46841,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -46908,7 +46908,7 @@ paths: summary: Queries a list of Gateway items. operationId: PocketGatewayGateway responses: - "200": + '200': description: A successful response. schema: type: object @@ -46950,7 +46950,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -46965,7 +46965,7 @@ paths: summary: Parameters queries the parameters of the module. operationId: PocketGatewayParams responses: - "200": + '200': description: A successful response. schema: type: object @@ -46991,7 +46991,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -47001,7 +47001,7 @@ paths: summary: Parameters queries the parameters of the module. operationId: PocketPocketParams responses: - "200": + '200': description: A successful response. schema: type: object @@ -47027,7 +47027,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -47037,7 +47037,7 @@ paths: summary: Parameters queries the parameters of the module. operationId: PocketServiceParams responses: - "200": + '200': description: A successful response. schema: type: object @@ -47063,7 +47063,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -47073,7 +47073,7 @@ paths: summary: Queries a list of GetSession items. operationId: PocketSessionGetSession responses: - "200": + '200': description: A successful response. schema: type: object @@ -47352,7 +47352,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -47396,7 +47396,7 @@ paths: summary: Parameters queries the parameters of the module. operationId: PocketSessionParams responses: - "200": + '200': description: A successful response. schema: type: object @@ -47422,7 +47422,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -47431,7 +47431,7 @@ paths: get: operationId: PocketSupplierAllClaims responses: - "200": + '200': description: A successful response. schema: type: object @@ -47497,7 +47497,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -47564,7 +47564,7 @@ paths: summary: Queries a list of Claim items. operationId: PocketSupplierClaim responses: - "200": + '200': description: A successful response. schema: type: object @@ -47600,7 +47600,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -47615,7 +47615,7 @@ paths: summary: Parameters queries the parameters of the module. operationId: PocketSupplierParams responses: - "200": + '200': description: A successful response. schema: type: object @@ -47641,7 +47641,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} tags: @@ -47650,7 +47650,7 @@ paths: get: operationId: PocketSupplierSupplierAll responses: - "200": + '200': description: A successful response. schema: type: object @@ -47687,9 +47687,7 @@ paths: type: object properties: service: - title: >- - The Service for which the supplier is configured - for + title: The Service for which the supplier is configured type: object properties: id: @@ -47815,7 +47813,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -47882,7 +47880,7 @@ paths: summary: Queries a list of Supplier items. operationId: PocketSupplierSupplier responses: - "200": + '200': description: A successful response. schema: type: object @@ -47917,7 +47915,7 @@ paths: type: object properties: service: - title: The Service for which the supplier is configured for + title: The Service for which the supplier is configured type: object properties: id: @@ -48015,7 +48013,7 @@ paths: items: type: object properties: - "@type": + '@type': type: string additionalProperties: {} parameters: @@ -48057,7 +48055,7 @@ definitions: pub_key: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -48265,7 +48263,7 @@ definitions: properties: account_address: type: string - description: "Since: cosmos-sdk 0.46.2" + description: 'Since: cosmos-sdk 0.46.2' title: >- QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method @@ -48281,7 +48279,7 @@ definitions: pub_key: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -48457,7 +48455,7 @@ definitions: account: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -48622,7 +48620,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -48811,7 +48809,7 @@ definitions: account: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -48976,7 +48974,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -49242,7 +49240,7 @@ definitions: google.protobuf.Any: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -49405,7 +49403,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -49568,7 +49566,7 @@ definitions: authorization: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -49745,7 +49743,7 @@ definitions: authorization: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -49937,7 +49935,7 @@ definitions: authorization: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -50147,7 +50145,7 @@ definitions: authorization: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -50353,7 +50351,7 @@ definitions: authorization: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -50673,8 +50671,8 @@ definitions: displayed in clients. name: type: string - description: "Since: cosmos-sdk 0.43" - title: "name defines the name of the token (eg: Cosmos Atom)" + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' symbol: type: string description: >- @@ -50890,8 +50888,8 @@ definitions: displayed in clients. name: type: string - description: "Since: cosmos-sdk 0.43" - title: "name defines the name of the token (eg: Cosmos Atom)" + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' symbol: type: string description: >- @@ -51036,8 +51034,8 @@ definitions: displayed in clients. name: type: string - description: "Since: cosmos-sdk 0.43" - title: "name defines the name of the token (eg: Cosmos Atom)" + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' symbol: type: string description: >- @@ -51975,7 +51973,7 @@ definitions: title: PartsetHeader title: BlockID block: - title: "Deprecated: please use `sdk_block` instead" + title: 'Deprecated: please use `sdk_block` instead' type: object properties: header: @@ -52528,7 +52526,7 @@ definitions: Commit contains the evidence that a block was committed by a set of validators. sdk_block: - title: "Since: cosmos-sdk 0.47" + title: 'Since: cosmos-sdk 0.47' type: object properties: header: @@ -53116,7 +53114,7 @@ definitions: title: PartsetHeader title: BlockID block: - title: "Deprecated: please use `sdk_block` instead" + title: 'Deprecated: please use `sdk_block` instead' type: object properties: header: @@ -53669,7 +53667,7 @@ definitions: Commit contains the evidence that a block was committed by a set of validators. sdk_block: - title: "Since: cosmos-sdk 0.47" + title: 'Since: cosmos-sdk 0.47' type: object properties: header: @@ -54252,7 +54250,7 @@ definitions: pub_key: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -54515,7 +54513,7 @@ definitions: title: Module is the type for VersionInfo cosmos_sdk_version: type: string - title: "Since: cosmos-sdk 0.43" + title: 'Since: cosmos-sdk 0.43' description: VersionInfo is the type for the GetNodeInfoResponse message. description: >- GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC @@ -54544,7 +54542,7 @@ definitions: pub_key: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -54910,7 +54908,7 @@ definitions: pub_key: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -55103,7 +55101,7 @@ definitions: title: Module is the type for VersionInfo cosmos_sdk_version: type: string - title: "Since: cosmos-sdk 0.43" + title: 'Since: cosmos-sdk 0.43' description: VersionInfo is the type for the GetNodeInfoResponse message. tendermint.crypto.PublicKey: type: object @@ -57887,7 +57885,7 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. - title: "Since: cosmos-sdk 0.46" + title: 'Since: cosmos-sdk 0.46' description: |- MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. @@ -57908,7 +57906,7 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. - title: "Since: cosmos-sdk 0.46" + title: 'Since: cosmos-sdk 0.46' description: |- MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. @@ -58283,7 +58281,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -58472,7 +58470,7 @@ definitions: description: evidence returns the requested evidence. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -58545,7 +58543,7 @@ definitions: description: allowance can be any of basic, periodic, allowed fee allowance. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -58630,7 +58628,7 @@ definitions: description: allowance can be any of basic, periodic, allowed fee allowance. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -58712,7 +58710,7 @@ definitions: description: allowance can be any of basic, periodic, allowed fee allowance. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -58819,7 +58817,7 @@ definitions: description: allowance can be any of basic, periodic, allowed fee allowance. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -59057,7 +59055,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -59285,15 +59283,15 @@ definitions: description: metadata is any arbitrary metadata attached to the proposal. title: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: title is the title of the proposal summary: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: summary is a short summary of the proposal proposer: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: Proposer is the address of the proposal sumbitter description: Proposal defines the core field members of a governance proposal. cosmos.gov.v1.ProposalStatus: @@ -59567,7 +59565,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -59808,15 +59806,15 @@ definitions: description: metadata is any arbitrary metadata attached to the proposal. title: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: title is the title of the proposal summary: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: summary is a short summary of the proposal proposer: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: Proposer is the address of the proposal sumbitter description: >- QueryProposalResponse is the response type for the Query/Proposal RPC @@ -59838,7 +59836,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -60082,15 +60080,15 @@ definitions: description: metadata is any arbitrary metadata attached to the proposal. title: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: title is the title of the proposal summary: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: summary is a short summary of the proposal proposer: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: Proposer is the address of the proposal sumbitter description: Proposal defines the core field members of a governance proposal. description: proposals defines all the requested governance proposals. @@ -60446,7 +60444,7 @@ definitions: description: content is the proposal's content. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -60517,13 +60515,13 @@ definitions: proposal's voting period has ended. type: object properties: - "yes": + 'yes': type: string description: yes is the number of yes votes on a proposal. abstain: type: string description: abstain is the number of abstain votes on a proposal. - "no": + 'no': type: string description: no is the number of no votes on a proposal. no_with_veto: @@ -60761,7 +60759,7 @@ definitions: description: content is the proposal's content. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -60838,13 +60836,13 @@ definitions: proposal's voting period has ended. type: object properties: - "yes": + 'yes': type: string description: yes is the number of yes votes on a proposal. abstain: type: string description: abstain is the number of abstain votes on a proposal. - "no": + 'no': type: string description: no is the number of no votes on a proposal. no_with_veto: @@ -60906,7 +60904,7 @@ definitions: description: content is the proposal's content. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -60986,13 +60984,13 @@ definitions: proposal's voting period has ended. type: object properties: - "yes": + 'yes': type: string description: yes is the number of yes votes on a proposal. abstain: type: string description: abstain is the number of abstain votes on a proposal. - "no": + 'no': type: string description: no is the number of no votes on a proposal. no_with_veto: @@ -61065,13 +61063,13 @@ definitions: description: tally defines the requested tally. type: object properties: - "yes": + 'yes': type: string description: yes is the number of yes votes on a proposal. abstain: type: string description: abstain is the number of abstain votes on a proposal. - "no": + 'no': type: string description: no is the number of no votes on a proposal. no_with_veto: @@ -61249,13 +61247,13 @@ definitions: cosmos.gov.v1beta1.TallyResult: type: object properties: - "yes": + 'yes': type: string description: yes is the number of yes votes on a proposal. abstain: type: string description: abstain is the number of abstain votes on a proposal. - "no": + 'no': type: string description: no is the number of no votes on a proposal. no_with_veto: @@ -61474,7 +61472,7 @@ definitions: description: decision_policy specifies the group policy's decision policy. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -61767,7 +61765,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -61929,11 +61927,11 @@ definitions: passes. title: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: title is the title of the proposal summary: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: summary is a short summary of the proposal description: >- Proposal defines a group proposal. Any member of a group can submit a @@ -62115,7 +62113,7 @@ definitions: description: decision_policy specifies the group policy's decision policy. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -62243,7 +62241,7 @@ definitions: description: decision_policy specifies the group policy's decision policy. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -62370,7 +62368,7 @@ definitions: description: decision_policy specifies the group policy's decision policy. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -62603,7 +62601,7 @@ definitions: description: >- GroupInfo represents the high-level on-chain information for a group. - description: "`groups` is all the groups present in state." + description: '`groups` is all the groups present in state.' pagination: description: pagination defines the pagination in the response. type: object @@ -62750,7 +62748,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -62919,11 +62917,11 @@ definitions: proposal passes. title: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: title is the title of the proposal summary: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: summary is a short summary of the proposal description: QueryProposalResponse is the Query/Proposal response type. cosmos.group.v1.QueryProposalsByGroupPolicyResponse: @@ -63051,7 +63049,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -63222,11 +63220,11 @@ definitions: proposal passes. title: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: title is the title of the proposal summary: type: string - description: "Since: cosmos-sdk 0.47" + description: 'Since: cosmos-sdk 0.47' title: summary is a short summary of the proposal description: >- Proposal defines a group proposal. Any member of a group can submit @@ -63594,7 +63592,7 @@ definitions: title: data is the app specific metadata of the NFT class. Optional type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -63773,7 +63771,7 @@ definitions: title: data is an app specific data of the NFT. Optional type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -63971,7 +63969,7 @@ definitions: title: data is the app specific metadata of the NFT class. Optional type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -64170,7 +64168,7 @@ definitions: title: data is the app specific metadata of the NFT class. Optional type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -64381,7 +64379,7 @@ definitions: title: data is an app specific data of the NFT. Optional type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -64569,7 +64567,7 @@ definitions: title: data is an app specific data of the NFT. Optional type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -65313,7 +65311,7 @@ definitions: as a Protobuf Any. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -65521,7 +65519,7 @@ definitions: description: MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse: type: object - description: "Since: cosmos-sdk 0.46" + description: 'Since: cosmos-sdk 0.46' title: MsgCancelUnbondingDelegationResponse cosmos.staking.v1beta1.MsgCreateValidatorResponse: type: object @@ -65813,7 +65811,7 @@ definitions: a Protobuf Any. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -65999,7 +65997,7 @@ definitions: as a Protobuf Any. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -66320,7 +66318,7 @@ definitions: validator, as a Protobuf Any. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of @@ -66872,7 +66870,7 @@ definitions: a Protobuf Any. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -67141,7 +67139,7 @@ definitions: as a Protobuf Any. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -67721,7 +67719,7 @@ definitions: Protobuf Any. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -68020,7 +68018,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -68289,7 +68287,7 @@ definitions: description: The request transaction bytes. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -68466,7 +68464,7 @@ definitions: type: array items: type: object - $ref: "#/definitions/cosmos.tx.v1beta1.SignerInfo" + $ref: '#/definitions/cosmos.tx.v1beta1.SignerInfo' description: >- signer_infos defines the signing modes for the required signers. The number @@ -68717,7 +68715,7 @@ definitions: description: The request transaction bytes. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -68890,7 +68888,7 @@ definitions: type: array items: type: object - $ref: "#/definitions/cosmos.tx.v1beta1.Tx" + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' description: txs are the transactions in the block. block_id: type: object @@ -69490,7 +69488,7 @@ definitions: type: object properties: tx: - $ref: "#/definitions/cosmos.tx.v1beta1.Tx" + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' description: tx is the queried transaction. tx_response: description: tx_response is the queried TxResponses. @@ -69581,7 +69579,7 @@ definitions: description: The request transaction bytes. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -69698,7 +69696,7 @@ definitions: type: array items: type: object - $ref: "#/definitions/cosmos.tx.v1beta1.Tx" + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' description: txs is the list of queried transactions. tx_responses: type: array @@ -69790,7 +69788,7 @@ definitions: description: The request transaction bytes. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -70012,7 +70010,7 @@ definitions: Since: cosmos-sdk 0.45.2 multi: - $ref: "#/definitions/cosmos.tx.v1beta1.ModeInfo.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: @@ -70041,7 +70039,7 @@ definitions: type: array items: type: object - $ref: "#/definitions/cosmos.tx.v1beta1.ModeInfo" + $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 @@ -70146,7 +70144,7 @@ definitions: signer address for this position and lookup the public key. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -70200,7 +70198,7 @@ definitions: used with implementation specific semantics. additionalProperties: {} mode_info: - $ref: "#/definitions/cosmos.tx.v1beta1.ModeInfo" + $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 @@ -70221,7 +70219,7 @@ definitions: type: object properties: tx: - $ref: "#/definitions/cosmos.tx.v1beta1.Tx" + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' description: |- tx is the transaction to simulate. Deprecated. Send raw tx bytes instead. @@ -70315,7 +70313,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -70525,7 +70523,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -70729,7 +70727,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -70906,7 +70904,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -71080,7 +71078,7 @@ definitions: 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" + $ref: '#/definitions/cosmos.tx.v1beta1.AuthInfo' title: |- auth_info is the authorization related content of the transaction, specifically signers, signer modes and fee @@ -71106,7 +71104,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -71300,7 +71298,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -71469,7 +71467,7 @@ definitions: items: type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -71671,7 +71669,7 @@ definitions: type: object properties: tx: - $ref: "#/definitions/cosmos.tx.v1beta1.Tx" + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' description: tx is the decoded transaction. description: |- TxDecodeResponse is the response type for the @@ -71703,7 +71701,7 @@ definitions: type: object properties: tx: - $ref: "#/definitions/cosmos.tx.v1beta1.Tx" + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' description: tx is the transaction to encode. description: |- TxEncodeRequest is the request type for the Service.TxEncode @@ -71836,7 +71834,7 @@ definitions: If this field is not empty, an error will be thrown. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -71909,7 +71907,7 @@ definitions: properties: address: type: string - description: "Since: cosmos-sdk 0.46" + description: 'Since: cosmos-sdk 0.46' title: QueryAuthorityResponse is the response type for Query/Authority cosmos.upgrade.v1beta1.QueryCurrentPlanResponse: type: object @@ -71971,7 +71969,7 @@ definitions: If this field is not empty, an error will be thrown. type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -72068,7 +72066,7 @@ definitions: upgraded_consensus_state: type: string format: byte - title: "Since: cosmos-sdk 0.43" + title: 'Since: cosmos-sdk 0.43' description: >- QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState @@ -72804,7 +72802,7 @@ definitions: title: client state type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -73009,7 +73007,7 @@ definitions: title: consensus state associated with the channel type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -74062,7 +74060,7 @@ definitions: title: client state type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -74254,7 +74252,7 @@ definitions: title: consensus state type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -74475,7 +74473,7 @@ definitions: title: client state associated with the request identifier type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -74683,7 +74681,7 @@ definitions: title: client state type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -74975,7 +74973,7 @@ definitions: height type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -75207,7 +75205,7 @@ definitions: title: consensus state type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -75414,7 +75412,7 @@ definitions: title: client state associated with the request identifier type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -75578,7 +75576,7 @@ definitions: title: Consensus state associated with the request identifier type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -76036,7 +76034,7 @@ definitions: title: client state type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -76241,7 +76239,7 @@ definitions: title: consensus state associated with the channel type: object properties: - "@type": + '@type': type: string description: >- A URL/resource name that uniquely identifies the type of the @@ -78127,7 +78125,7 @@ definitions: type: object properties: service: - title: The Service for which the supplier is configured for + title: The Service for which the supplier is configured type: object properties: id: @@ -78286,7 +78284,7 @@ definitions: type: object properties: service: - title: The Service for which the supplier is configured for + title: The Service for which the supplier is configured type: object properties: id: diff --git a/go.mod b/go.mod index b4658dfb1..51aa32938 100644 --- a/go.mod +++ b/go.mod @@ -13,6 +13,7 @@ require ( github.com/cosmos/cosmos-sdk v0.47.3 github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/ibc-go/v7 v7.1.0 + github.com/gogo/status v1.1.1 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 github.com/gorilla/mux v1.8.0 diff --git a/go.sum b/go.sum index 64f7566f0..b554afc3b 100644 --- a/go.sum +++ b/go.sum @@ -688,10 +688,13 @@ github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.3.1+incompatible h1:0/KbAdpx3UXAx1kEOWHJeOkpbgRFGHVgv+CFIY7dBJI= github.com/gofrs/uuid v4.3.1+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= +github.com/gogo/status v1.1.1 h1:DuHXlSFHNKqTQ+/ACf5Vs6r4X/dH2EgIzR9Vr+H65kg= +github.com/gogo/status v1.1.1/go.mod h1:jpG3dM5QPcqu19Hg8lkUhBFBa3TcLs1DG7+2Jqci7oU= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= @@ -2610,6 +2613,7 @@ google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -2735,6 +2739,7 @@ google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnp google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= diff --git a/proto/pocket/shared/service.proto b/proto/pocket/shared/service.proto index 8d6927515..4700035ce 100644 --- a/proto/pocket/shared/service.proto +++ b/proto/pocket/shared/service.proto @@ -19,7 +19,7 @@ message Service { // ApplicationServiceConfig holds the service configuration the application stakes for message ApplicationServiceConfig { - Service service = 1; // The Service for which the application is configured for + Service service = 1; // The Service for which the application is configured // TODO_RESEARCH: There is an opportunity for applications to advertise the max // they're willing to pay for a certain configuration/price, but this is outside of scope. @@ -28,7 +28,7 @@ message ApplicationServiceConfig { // SupplierServiceConfig holds the service configuration the supplier stakes for message SupplierServiceConfig { - Service service = 1; // The Service for which the supplier is configured for + Service service = 1; // The Service for which the supplier is configured repeated SupplierEndpoint endpoints = 2; // List of endpoints for the service // TODO_RESEARCH: There is an opportunity for supplier to advertise the min // they're willing to earn for a certain configuration/price, but this is outside of scope. diff --git a/testutil/keeper/session.go b/testutil/keeper/session.go index ab0eb277c..8b57ec0c4 100644 --- a/testutil/keeper/session.go +++ b/testutil/keeper/session.go @@ -27,10 +27,15 @@ import ( type option[V any] func(k *keeper.Keeper) var ( - TestServiceId1 = "svc1" - TestServiceId2 = "svc2" + TestServiceId1 = "svc1" // staked for by app1 & supplier1 + TestServiceId11 = "svc11" // staked for by app1 - TestApp1Address = "pokt106grzmkmep67pdfrm6ccl9snynryjqus6l3vct" // Generated via sample.AccAddress() + TestServiceId2 = "svc2" // staked for by app2 & supplier1 + TestServiceId22 = "svc22" // staked for by app2 + + TestServiceId12 = "svc12" // staked for by app1, app2 & supplier1 + + TestApp1Address = "pokt1mdccn4u38eyjdxkk4h0jaddw4n3c72u82m5m9e" // Generated via sample.AccAddress() TestApp1 = apptypes.Application{ Address: TestApp1Address, Stake: &sdk.Coin{Denom: "upokt", Amount: sdk.NewInt(100)}, @@ -39,21 +44,27 @@ var ( Service: &sharedtypes.Service{Id: TestServiceId1}, }, { - Service: &sharedtypes.Service{Id: TestServiceId2}, + Service: &sharedtypes.Service{Id: TestServiceId11}, + }, + { + Service: &sharedtypes.Service{Id: TestServiceId12}, }, }, } - TestApp2Address = "pokt1dm7tr0a99ja232gzt5rjtrl7hj6z6h40669fwh" // Generated via sample.AccAddress() + TestApp2Address = "pokt133amv5suh75zwkxxcq896azvmmwszg99grvk9f" // Generated via sample.AccAddress() TestApp2 = apptypes.Application{ Address: TestApp1Address, Stake: &sdk.Coin{Denom: "upokt", Amount: sdk.NewInt(100)}, ServiceConfigs: []*sharedtypes.ApplicationServiceConfig{ { - Service: &sharedtypes.Service{Id: TestServiceId1}, + Service: &sharedtypes.Service{Id: TestServiceId2}, }, { - Service: &sharedtypes.Service{Id: TestServiceId2}, + Service: &sharedtypes.Service{Id: TestServiceId22}, + }, + { + Service: &sharedtypes.Service{Id: TestServiceId12}, }, }, } @@ -84,6 +95,16 @@ var ( }, }, }, + { + Service: &sharedtypes.Service{Id: TestServiceId12}, + Endpoints: []*sharedtypes.SupplierEndpoint{ + { + Url: TestSupplierUrl, + RpcType: sharedtypes.RPCType_GRPC, + Configs: make([]*sharedtypes.ConfigOption, 0), + }, + }, + }, }, } ) diff --git a/testutil/network/network.go b/testutil/network/network.go index c39983ca6..28f4eaa2f 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -113,6 +113,9 @@ func DefaultApplicationModuleGenesisState(t *testing.T, n int) *apptypes.Genesis { Service: &sharedtypes.Service{Id: fmt.Sprintf("svc%d", i)}, }, + { + Service: &sharedtypes.Service{Id: fmt.Sprintf("svc%d%d", i, i)}, + }, }, } // TODO_CONSIDERATION: Evaluate whether we need `nullify.Fill` or if we should enforce `(gogoproto.nullable) = false` everywhere diff --git a/x/application/client/cli/query_application.go b/x/application/client/cli/query_application.go index 61a5eb35b..4fbf32228 100644 --- a/x/application/client/cli/query_application.go +++ b/x/application/client/cli/query_application.go @@ -46,7 +46,7 @@ func CmdListApplication() *cobra.Command { func CmdShowApplication() *cobra.Command { cmd := &cobra.Command{ - Use: "show-application [address]", + Use: "show-application ", Short: "shows a application", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) (err error) { diff --git a/x/application/client/cli/tx_delegate_to_gateway.go b/x/application/client/cli/tx_delegate_to_gateway.go index b27562215..f1363e6db 100644 --- a/x/application/client/cli/tx_delegate_to_gateway.go +++ b/x/application/client/cli/tx_delegate_to_gateway.go @@ -15,7 +15,7 @@ var _ = strconv.Itoa(0) func CmdDelegateToGateway() *cobra.Command { cmd := &cobra.Command{ - Use: "delegate-to-gateway [gateway address]", + Use: "delegate-to-gateway ", Short: "Delegate an application to a gateway", Long: `Delegate an application to the gateway with the provided address. This is a broadcast operation that delegates authority to the gateway specified to sign relays requests for the application, allowing the gateway diff --git a/x/application/client/cli/tx_stake_application.go b/x/application/client/cli/tx_stake_application.go index 86ba62893..2909eaf8e 100644 --- a/x/application/client/cli/tx_stake_application.go +++ b/x/application/client/cli/tx_stake_application.go @@ -21,7 +21,7 @@ func CmdStakeApplication() *cobra.Command { // TODO_HACK: For now we are only specifying the service IDs as a list of of strings separated by commas. // This needs to be expand to specify the full ApplicationServiceConfig. Furthermore, providing a flag to // a file where ApplicationServiceConfig specifying full service configurations in the CLI by providing a flag that accepts a JSON string - Use: "stake-application [amount] [svcId1,svcId2,...,svcIdN]", + Use: "stake-application ", Short: "Stake an application", Long: `Stake an application with the provided parameters. This is a broadcast operation that will stake the tokens and serviceIds and associate them with the application specified by the 'from' address. diff --git a/x/application/client/cli/tx_unstake_application.go b/x/application/client/cli/tx_unstake_application.go index 81011d0e0..c602def16 100644 --- a/x/application/client/cli/tx_unstake_application.go +++ b/x/application/client/cli/tx_unstake_application.go @@ -16,7 +16,7 @@ var _ = strconv.Itoa(0) func CmdUnstakeApplication() *cobra.Command { // fromAddress & signature is retrieved via `flags.FlagFrom` in the `clientCtx` cmd := &cobra.Command{ - Use: "unstake-application [amount]", + Use: "unstake-application", Short: "Unstake an application", Long: `Unstake an application. This is a broadcast operation that will unstake the application specified by the 'from' address. diff --git a/x/gateway/client/cli/helpers_test.go b/x/gateway/client/cli/helpers_test.go index 927212a46..cf2ccf899 100644 --- a/x/gateway/client/cli/helpers_test.go +++ b/x/gateway/client/cli/helpers_test.go @@ -1,14 +1,24 @@ package cli_test import ( + "strconv" "testing" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/cmd/pocketd/cmd" "github.com/pokt-network/poktroll/testutil/network" "github.com/pokt-network/poktroll/x/gateway/types" - - "github.com/stretchr/testify/require" ) +// Dummy variable to avoid unused import error. +var _ = strconv.IntSize + +// init initializes the SDK configuration. +func init() { + cmd.InitSDKConfig() +} + // networkWithGatewayObjects creates a network with a populated gateway state of n gateway objects func networkWithGatewayObjects(t *testing.T, n int) (*network.Network, []types.Gateway) { t.Helper() diff --git a/x/gateway/client/cli/query_gateway.go b/x/gateway/client/cli/query_gateway.go index 30076ed22..124c515c8 100644 --- a/x/gateway/client/cli/query_gateway.go +++ b/x/gateway/client/cli/query_gateway.go @@ -46,7 +46,7 @@ func CmdListGateway() *cobra.Command { func CmdShowGateway() *cobra.Command { cmd := &cobra.Command{ - Use: "show-gateway [address]", + Use: "show-gateway ", Short: "shows a gateway", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) (err error) { diff --git a/x/gateway/client/cli/tx_stake_gateway.go b/x/gateway/client/cli/tx_stake_gateway.go index 97e93c812..3c4d29a30 100644 --- a/x/gateway/client/cli/tx_stake_gateway.go +++ b/x/gateway/client/cli/tx_stake_gateway.go @@ -3,20 +3,20 @@ package cli import ( "strconv" - "github.com/pokt-network/poktroll/x/gateway/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" + + "github.com/pokt-network/poktroll/x/gateway/types" ) var _ = strconv.Itoa(0) func CmdStakeGateway() *cobra.Command { cmd := &cobra.Command{ - Use: "stake-gateway [amount]", + Use: "stake-gateway ", Short: "Stake a gateway", Long: `Stake a gateway with the provided parameters. This is a broadcast operation that will stake the tokens and associate them with the gateway specified by the 'from' address. diff --git a/x/gateway/client/cli/tx_unstake_gateway.go b/x/gateway/client/cli/tx_unstake_gateway.go index bd2d38ebe..e97406495 100644 --- a/x/gateway/client/cli/tx_unstake_gateway.go +++ b/x/gateway/client/cli/tx_unstake_gateway.go @@ -16,7 +16,7 @@ var _ = strconv.Itoa(0) func CmdUnstakeGateway() *cobra.Command { // fromAddress & signature is retrieved via `flags.FlagFrom` in the `clientCtx` cmd := &cobra.Command{ - Use: "unstake-gateway [amount]", + Use: "unstake-gateway ", Short: "Unstake a gateway", Long: `Unstake a gateway. This is a broadcast operation that will unstake the gateway specified by the 'from' address. diff --git a/x/session/client/cli/helpers_test.go b/x/session/client/cli/helpers_test.go new file mode 100644 index 000000000..484bca4db --- /dev/null +++ b/x/session/client/cli/helpers_test.go @@ -0,0 +1,44 @@ +// Package cli_test provides unit tests for the CLI functionality. +package cli_test + +import ( + "strconv" + "testing" + + "github.com/pokt-network/poktroll/cmd/pocketd/cmd" + "github.com/pokt-network/poktroll/testutil/network" + apptypes "github.com/pokt-network/poktroll/x/application/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" + suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" + "github.com/stretchr/testify/require" +) + +// Dummy variable to avoid unused import error. +var _ = strconv.IntSize + +// init initializes the SDK configuration. +func init() { + cmd.InitSDKConfig() +} + +// networkWithApplicationsAndSupplier creates a new network with a given number of supplier & application objects. +// It returns the network and a slice of the created supplier & application objects. +func networkWithApplicationsAndSupplier(t *testing.T, n int) (*network.Network, []sharedtypes.Supplier, []apptypes.Application) { + t.Helper() + cfg := network.DefaultConfig() + + // Prepare the application genesis state + applicationGenesisState := network.DefaultApplicationModuleGenesisState(t, n) + buf, err := cfg.Codec.MarshalJSON(applicationGenesisState) + require.NoError(t, err) + cfg.GenesisState[apptypes.ModuleName] = buf + + // Prepare the supplier genesis state + supplierGenesisState := network.DefaultSupplierModuleGenesisState(t, n) + buf, err = cfg.Codec.MarshalJSON(supplierGenesisState) + require.NoError(t, err) + cfg.GenesisState[suppliertypes.ModuleName] = buf + + // Start the network + return network.New(t, cfg), supplierGenesisState.SupplierList, applicationGenesisState.ApplicationList +} diff --git a/x/session/client/cli/query_get_session.go b/x/session/client/cli/query_get_session.go index 1c21aa881..41b441de7 100644 --- a/x/session/client/cli/query_get_session.go +++ b/x/session/client/cli/query_get_session.go @@ -1,6 +1,7 @@ package cli import ( + "fmt" "strconv" "github.com/cosmos/cosmos-sdk/client" @@ -12,26 +13,49 @@ import ( var _ = strconv.Itoa(0) -// TODO(@Olshansk): Implement the CLI component of `GetSession`. func CmdGetSession() *cobra.Command { cmd := &cobra.Command{ - Use: "get-session", + Use: "get-session [block_height]", Short: "Query get-session", - Args: cobra.ExactArgs(0), + Long: `Query the session data for a specific (app, service, height) tuple. + +[block_height] is optional. If unspecified, or set to 0, it defaults to the latest height of the node being queried. + +This is a query operation that will not result in a state transition but simply gives a view into the chain state. + +Example: +$ pocketd --home=$(POCKETD_HOME) q session get-session pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4 svc1 42 --node $(POCKET_NODE)`, + Args: cobra.RangeArgs(2, 3), RunE: func(cmd *cobra.Command, args []string) (err error) { + appAddressString := args[0] + serviceIdString := args[1] + blockHeightString := "0" // 0 will default to latest height + if len(args) == 3 { + blockHeightString = args[2] + } + + blockHeight, err := strconv.ParseInt(blockHeightString, 10, 64) + if err != nil { + return fmt.Errorf("couldn't convert block height to int: %s; (%v)", blockHeightString, err) + } + + getSessionReq := types.NewQueryGetSessionRequest(appAddressString, serviceIdString, blockHeight) + if err := getSessionReq.ValidateBasic(); err != nil { + return err + } + clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err } queryClient := types.NewQueryClient(clientCtx) - req := &types.QueryGetSessionRequest{} - res, err := queryClient.GetSession(cmd.Context(), req) + getSessionRes, err := queryClient.GetSession(cmd.Context(), getSessionReq) if err != nil { return err } - return clientCtx.PrintProto(res) + return clientCtx.PrintProto(getSessionRes) }, } diff --git a/x/session/client/cli/query_get_session_test.go b/x/session/client/cli/query_get_session_test.go new file mode 100644 index 000000000..480bafa48 --- /dev/null +++ b/x/session/client/cli/query_get_session_test.go @@ -0,0 +1,197 @@ +package cli_test + +import ( + "fmt" + "testing" + + sdkerrors "cosmossdk.io/errors" + tmcli "github.com/cometbft/cometbft/libs/cli" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/gogo/status" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/x/session/client/cli" + sessiontypes "github.com/pokt-network/poktroll/x/session/types" +) + +func TestCLI_GetSession(t *testing.T) { + // Prepare the network + net, suppliers, applications := networkWithApplicationsAndSupplier(t, 2) + _, err := net.WaitForHeight(10) // Wait for a sufficiently high block height to ensure the staking transactions have been processed + require.NoError(t, err) + val := net.Validators[0] + ctx := val.ClientCtx + + // Sanity check the application configs are what we expect them to be + appSvc0 := applications[0] + appSvc1 := applications[1] + + require.Len(t, appSvc0.ServiceConfigs, 2) + require.Len(t, appSvc1.ServiceConfigs, 2) + + require.Equal(t, appSvc0.ServiceConfigs[0].Service.Id, "svc0") // svc0 has a supplier + require.Equal(t, appSvc0.ServiceConfigs[1].Service.Id, "svc00") // svc00 doesn't have a supplier + require.Equal(t, appSvc1.ServiceConfigs[0].Service.Id, "svc1") // svc1 has a supplier + require.Equal(t, appSvc1.ServiceConfigs[1].Service.Id, "svc11") // svc11 doesn't have a supplier + + // Sanity check the supplier configs are what we expect them to be + supplierSvc0 := suppliers[0] // supplier for svc0 + supplierSvc1 := suppliers[1] // supplier for svc1 + + require.Len(t, supplierSvc0.Services, 1) + require.Len(t, supplierSvc1.Services, 1) + + require.Equal(t, supplierSvc0.Services[0].Service.Id, "svc0") + require.Equal(t, supplierSvc1.Services[0].Service.Id, "svc1") + + // Prepare the test cases + tests := []struct { + desc string + + appAddress string + serviceId string + blockHeight int64 + + expectedErr *sdkerrors.Error + expectedNumSuppliers int + }{ + // Valid requests + { + desc: "valid - block height specified and is zero", + + appAddress: appSvc0.Address, + serviceId: "svc0", + blockHeight: 0, + + expectedErr: nil, + expectedNumSuppliers: 1, + }, + { + desc: "valid - block height specified and is greater than zero", + + appAddress: appSvc1.Address, + serviceId: "svc1", + blockHeight: 10, + + expectedErr: nil, + expectedNumSuppliers: 1, + }, + { + desc: "valid - block height unspecified and defaults to 0", + + appAddress: appSvc0.Address, + serviceId: "svc0", + // blockHeight: intentionally omitted, + + expectedErr: nil, + expectedNumSuppliers: 1, + }, + + // Invalid requests - incompatible state + { + desc: "invalid - app not staked for service", + + appAddress: appSvc0.Address, + serviceId: "svc9001", // appSvc0 is only staked for svc0 (has supplier) and svc00 (doesn't have supplier) and is not staked for service over 9000 + blockHeight: 0, + + expectedErr: sessiontypes.ErrSessionAppNotStakedForService, + }, + { + desc: "invalid - no suppliers staked for service", + + appAddress: appSvc0.Address, // dynamically getting address from applications + serviceId: "svc00", // appSvc0 is only staked for svc0 (has supplier) and svc00 (doesn't have supplier) + blockHeight: 0, + + expectedErr: sessiontypes.ErrSessionSuppliersNotFound, + }, + { + desc: "invalid - block height is in the future", + + appAddress: appSvc0.Address, // dynamically getting address from applications + serviceId: "svc0", + blockHeight: 9001, // block height over 9000 is greater than the context height of 10 + + expectedErr: sessiontypes.ErrSessionInvalidBlockHeight, + }, + + // Invalid requests - bad app address input + { + desc: "invalid - invalid appAddress", + + appAddress: "invalidAddress", // providing a deliberately invalid address + serviceId: "svc0", + blockHeight: 0, + + expectedErr: sessiontypes.ErrSessionInvalidAppAddress, + }, + { + desc: "invalid - missing appAddress", + // appAddress: intentionally omitted + serviceId: "svc0", + blockHeight: 0, + + expectedErr: sessiontypes.ErrSessionInvalidAppAddress, + }, + + // Invalid requests - bad serviceID input + { + desc: "invalid - invalid service ID", + appAddress: appSvc0.Address, // dynamically getting address from applications + serviceId: "invalidServiceId", + blockHeight: 0, + + expectedErr: sessiontypes.ErrSessionInvalidService, + }, + { + desc: "invalid - missing service ID", + appAddress: appSvc0.Address, // dynamically getting address from applications + // serviceId: intentionally omitted + blockHeight: 0, + + expectedErr: sessiontypes.ErrSessionInvalidService, + }, + } + + // We want to use the `--output=json` flag for all tests so it's easy to unmarshal below + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + + // Run the tests + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + // Prepare the arguments for the CLI command + args := []string{ + tt.appAddress, + tt.serviceId, + fmt.Sprintf("%d", tt.blockHeight), + } + args = append(args, common...) + + // Execute the command + getSessionOut, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdGetSession(), args) + if tt.expectedErr != nil { + stat, ok := status.FromError(tt.expectedErr) + require.True(t, ok) + require.Contains(t, stat.Message(), tt.expectedErr.Error()) + return + } + require.NoError(t, err) + + var getSessionRes sessiontypes.QueryGetSessionResponse + err = net.Config.Codec.UnmarshalJSON(getSessionOut.Bytes(), &getSessionRes) + require.NoError(t, err) + require.NotNil(t, getSessionRes) + + session := getSessionRes.Session + require.NotNil(t, session) + + // Verify some data about the session + require.Equal(t, tt.appAddress, session.Application.Address) + require.Equal(t, tt.serviceId, session.Header.Service.Id) + require.Len(t, session.Suppliers, tt.expectedNumSuppliers) + }) + } +} diff --git a/x/session/keeper/query_get_session.go b/x/session/keeper/query_get_session.go index 7a69e5a8c..e8931b343 100644 --- a/x/session/keeper/query_get_session.go +++ b/x/session/keeper/query_get_session.go @@ -15,8 +15,23 @@ func (k Keeper) GetSession(goCtx context.Context, req *types.QueryGetSessionRequ return nil, status.Error(codes.InvalidArgument, "invalid request") } + if err := req.ValidateBasic(); err != nil { + return nil, err + } + ctx := sdk.UnwrapSDKContext(goCtx) + // If block height is not specified, use the current (context's latest) block height + // Note that `GetSession` is called via the `Query` service rather than the `Msg` server. + // The former is stateful but does not lead to state transitions, while the latter one + // does. The request height depends on how much the node has synched and only acts as a read, + // while the `Msg` server handles the code flow of the validator/sequencer when a new block + // is being proposed. + blockHeight := req.BlockHeight + if blockHeight == 0 { + blockHeight = ctx.BlockHeight() + } + sessionHydrator := NewSessionHydrator(req.ApplicationAddress, req.Service.Id, req.BlockHeight) session, err := k.HydrateSession(ctx, sessionHydrator) if err != nil { diff --git a/x/session/keeper/query_get_session_test.go b/x/session/keeper/query_get_session_test.go index ebf80b9cf..a8b8ecedb 100644 --- a/x/session/keeper/query_get_session_test.go +++ b/x/session/keeper/query_get_session_test.go @@ -8,6 +8,7 @@ import ( "github.com/pokt-network/poktroll/cmd/pocketd/cmd" keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/testutil/sample" "github.com/pokt-network/poktroll/x/session/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -22,6 +23,7 @@ func init() { func TestSession_GetSession_Success(t *testing.T) { keeper, ctx := keepertest.SessionKeeper(t) + ctx = ctx.WithBlockHeight(100) // provide a sufficiently large block height to avoid errors wctx := sdk.WrapSDKContext(ctx) type test struct { @@ -45,7 +47,7 @@ func TestSession_GetSession_Success(t *testing.T) { blockHeight: 1, // Intentionally only checking a subset of the session metadata returned - expectedSessionId: "e1e51d087e447525d7beb648711eb3deaf016a8089938a158e6a0f600979370c", + expectedSessionId: "cf5bbdce56ee5a7c46c5d5482303907685a7e5dbb22703cd4a85df521b9ab6e9", expectedSessionNumber: 0, expectedNumSuppliers: 1, }, @@ -53,7 +55,6 @@ func TestSession_GetSession_Success(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - req := &types.QueryGetSessionRequest{ ApplicationAddress: tt.appAddr, Service: &sharedtypes.Service{ @@ -75,6 +76,7 @@ func TestSession_GetSession_Success(t *testing.T) { func TestSession_GetSession_Failure(t *testing.T) { keeper, ctx := keepertest.SessionKeeper(t) + ctx = ctx.WithBlockHeight(100) // provide a sufficiently large block height to avoid errors wctx := sdk.WrapSDKContext(ctx) type test struct { @@ -91,20 +93,56 @@ func TestSession_GetSession_Failure(t *testing.T) { { name: "application address does not reflected a staked application", - appAddr: "some string that is not a valid app address", + appAddr: sample.AccAddress(), // a random (valid) app address that's not staked serviceId: keepertest.TestServiceId1, blockHeight: 1, - expectedErrContains: types.ErrAppNotFound.Error(), + expectedErrContains: types.ErrSessionAppNotFound.Error(), + }, + { + name: "application staked for service that has no available suppliers", + + appAddr: keepertest.TestApp1Address, + serviceId: keepertest.TestServiceId11, + blockHeight: 1, + + expectedErrContains: types.ErrSessionSuppliersNotFound.Error(), }, { - name: "service ID does not reflect one with staked suppliers", + name: "application is valid but not staked for the specified service", appAddr: keepertest.TestApp1Address, - serviceId: "some string that is not a valid service Id", + serviceId: "svc9001", // App1 is not staked for service over 9000 blockHeight: 1, - expectedErrContains: types.ErrSuppliersNotFound.Error(), + expectedErrContains: types.ErrSessionAppNotStakedForService.Error(), + }, + { + name: "application address is invalid format", + + appAddr: "invalid_app_address", + serviceId: keepertest.TestServiceId1, + blockHeight: 1, + + expectedErrContains: types.ErrSessionInvalidAppAddress.Error(), + }, + { + name: "service ID is invalid", + + appAddr: keepertest.TestApp1Address, + serviceId: "service_id_is_too_long_to_be_valid", + blockHeight: 1, + + expectedErrContains: "invalid service in session", + }, + { + name: "negative block height", + + appAddr: keepertest.TestApp1Address, + serviceId: keepertest.TestServiceId1, + blockHeight: -1, + + expectedErrContains: "invalid block height for session being retrieved", }, } @@ -112,13 +150,12 @@ func TestSession_GetSession_Failure(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - req := &types.QueryGetSessionRequest{ ApplicationAddress: tt.appAddr, Service: &sharedtypes.Service{ Id: tt.serviceId, }, - BlockHeight: 1, + BlockHeight: tt.blockHeight, } res, err := keeper.GetSession(wctx, req) diff --git a/x/session/keeper/session_hydrator.go b/x/session/keeper/session_hydrator.go index 2b71143d1..38f9d529e 100644 --- a/x/session/keeper/session_hydrator.go +++ b/x/session/keeper/session_hydrator.go @@ -12,6 +12,7 @@ import ( _ "golang.org/x/crypto/sha3" "github.com/pokt-network/poktroll/x/session/types" + sharedhelpers "github.com/pokt-network/poktroll/x/shared/helpers" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -61,22 +62,22 @@ func (k Keeper) HydrateSession(ctx sdk.Context, sh *sessionHydrator) (*types.Ses logger := k.Logger(ctx).With("method", "hydrateSession") if err := k.hydrateSessionMetadata(ctx, sh); err != nil { - return nil, sdkerrors.Wrapf(types.ErrHydratingSession, "failed to hydrate the session metadata: %v", err) + return nil, sdkerrors.Wrapf(types.ErrSessionHydration, "failed to hydrate the session metadata: %v", err) } logger.Debug("Finished hydrating session metadata") if err := k.hydrateSessionID(ctx, sh); err != nil { - return nil, sdkerrors.Wrapf(types.ErrHydratingSession, "failed to hydrate the session ID: %v", err) + return nil, sdkerrors.Wrapf(types.ErrSessionHydration, "failed to hydrate the session ID: %v", err) } logger.Info("Finished hydrating session ID: %s", sh.sessionHeader.SessionId) if err := k.hydrateSessionApplication(ctx, sh); err != nil { - return nil, sdkerrors.Wrapf(types.ErrHydratingSession, "failed to hydrate application for session: %v", err) + return nil, sdkerrors.Wrapf(types.ErrSessionHydration, "failed to hydrate application for session: %v", err) } logger.Debug("Finished hydrating session application: %+v", sh.session.Application) if err := k.hydrateSessionSuppliers(ctx, sh); err != nil { - return nil, sdkerrors.Wrapf(types.ErrHydratingSession, "failed to hydrate suppliers for session: %v", err) + return nil, sdkerrors.Wrapf(types.ErrSessionHydration, "failed to hydrate suppliers for session: %v", err) } logger.Debug("Finished hydrating session suppliers: %+v") @@ -90,6 +91,10 @@ func (k Keeper) HydrateSession(ctx sdk.Context, sh *sessionHydrator) (*types.Ses func (k Keeper) hydrateSessionMetadata(ctx sdk.Context, sh *sessionHydrator) error { // TODO_TECHDEBT: Add a test if `blockHeight` is ahead of the current chain or what this node is aware of + if sh.blockHeight > ctx.BlockHeight() { + return sdkerrors.Wrapf(types.ErrSessionHydration, "block height %d is ahead of the current block height %d", sh.blockHeight, ctx.BlockHeight()) + } + sh.session.NumBlocksPerSession = NumBlocksPerSession sh.session.SessionNumber = int64(sh.blockHeight / NumBlocksPerSession) sh.sessionHeader.SessionStartBlockHeight = sh.blockHeight - (sh.blockHeight % NumBlocksPerSession) @@ -107,8 +112,11 @@ func (k Keeper) hydrateSessionID(ctx sdk.Context, sh *sessionHydrator) error { appPubKeyBz := []byte(sh.sessionHeader.ApplicationAddress) // TODO_TECHDEBT: In the future, we will need to valid that the Service is a valid service depending on whether - // or not its permissioned or permissionless - // TODO(@Olshansk): Add a check to make sure `IsValidServiceName(Service.Id)` returns True + // or not its permissioned or permissionless + + if !sharedhelpers.IsValidService(sh.sessionHeader.Service) { + return sdkerrors.Wrapf(types.ErrSessionHydration, "invalid service: %v", sh.sessionHeader.Service) + } serviceIdBz := []byte(sh.sessionHeader.Service.Id) sessionHeightBz := make([]byte, 8) @@ -124,10 +132,17 @@ func (k Keeper) hydrateSessionID(ctx sdk.Context, sh *sessionHydrator) error { func (k Keeper) hydrateSessionApplication(ctx sdk.Context, sh *sessionHydrator) error { app, appIsFound := k.appKeeper.GetApplication(ctx, sh.sessionHeader.ApplicationAddress) if !appIsFound { - return sdkerrors.Wrapf(types.ErrAppNotFound, "could not find app with address: %s at height %d", sh.sessionHeader.ApplicationAddress, sh.sessionHeader.SessionStartBlockHeight) + return sdkerrors.Wrapf(types.ErrSessionAppNotFound, "could not find app with address: %s at height %d", sh.sessionHeader.ApplicationAddress, sh.sessionHeader.SessionStartBlockHeight) } - sh.session.Application = &app - return nil + + for _, appServiceConfig := range app.ServiceConfigs { + if appServiceConfig.Service.Id == sh.sessionHeader.Service.Id { + sh.session.Application = &app + return nil + } + } + + return sdkerrors.Wrapf(types.ErrSessionAppNotStakedForService, "application %s not staked for service %s", sh.sessionHeader.ApplicationAddress, sh.sessionHeader.Service.Id) } // hydrateSessionSuppliers finds the suppliers that are staked at the session height and populates the session with them @@ -154,7 +169,7 @@ func (k Keeper) hydrateSessionSuppliers(ctx sdk.Context, sh *sessionHydrator) er if len(candidateSuppliers) == 0 { logger.Error("[ERROR] no suppliers found for session") - return sdkerrors.Wrapf(types.ErrSuppliersNotFound, "could not find suppliers for service %s at height %d", sh.sessionHeader.Service, sh.sessionHeader.SessionStartBlockHeight) + return sdkerrors.Wrapf(types.ErrSessionSuppliersNotFound, "could not find suppliers for service %s at height %d", sh.sessionHeader.Service, sh.sessionHeader.SessionStartBlockHeight) } if len(candidateSuppliers) < NumSupplierPerSession { diff --git a/x/session/keeper/session_hydrator_test.go b/x/session/keeper/session_hydrator_test.go index 61d591900..897dd8539 100644 --- a/x/session/keeper/session_hydrator_test.go +++ b/x/session/keeper/session_hydrator_test.go @@ -13,6 +13,7 @@ import ( func TestSession_HydrateSession_Success_BaseCase(t *testing.T) { sessionKeeper, ctx := keepertest.SessionKeeper(t) + ctx = ctx.WithBlockHeight(100) // provide a sufficiently large block height to avoid errors blockHeight := int64(10) sessionHydrator := keeper.NewSessionHydrator(keepertest.TestApp1Address, keepertest.TestServiceId1, blockHeight) @@ -26,86 +27,103 @@ func TestSession_HydrateSession_Success_BaseCase(t *testing.T) { require.Equal(t, "", sessionHeader.Service.Name) require.Equal(t, int64(8), sessionHeader.SessionStartBlockHeight) require.Equal(t, int64(12), sessionHeader.SessionEndBlockHeight) - require.Equal(t, "23f037a10f9d51d020d27763c42dd391d7e71765016d95d0d61f36c4a122efd0", sessionHeader.SessionId) + require.Equal(t, "5481d5ca2ddb15dc5edb792b8e20ba9c7d516a74475fc5feba6b6aeb95a26f58", sessionHeader.SessionId) // Check the session require.Equal(t, int64(4), session.NumBlocksPerSession) - require.Equal(t, "23f037a10f9d51d020d27763c42dd391d7e71765016d95d0d61f36c4a122efd0", session.SessionId) + require.Equal(t, "5481d5ca2ddb15dc5edb792b8e20ba9c7d516a74475fc5feba6b6aeb95a26f58", session.SessionId) require.Equal(t, int64(2), session.SessionNumber) // Check the application app := session.Application require.Equal(t, keepertest.TestApp1Address, app.Address) - require.Len(t, app.ServiceConfigs, 2) + require.Len(t, app.ServiceConfigs, 3) // Check the suppliers suppliers := session.Suppliers require.Len(t, suppliers, 1) supplier := suppliers[0] require.Equal(t, keepertest.TestSupplierAddress, supplier.Address) - require.Len(t, supplier.Services, 2) + require.Len(t, supplier.Services, 3) } func TestSession_HydrateSession_Metadata(t *testing.T) { type test struct { - name string + desc string blockHeight int64 expectedNumBlocksPerSession int64 expectedSessionNumber int64 expectedSessionStartBlock int64 expectedSessionEndBlock int64 + errExpected error } // TODO_TECHDEBT: Extend these tests once `NumBlocksPerSession` is configurable. // Currently assumes NumBlocksPerSession=4 tests := []test{ { - name: "blockHeight = 0", + desc: "blockHeight = 0", blockHeight: 0, expectedNumBlocksPerSession: 4, expectedSessionNumber: 0, expectedSessionStartBlock: 0, expectedSessionEndBlock: 4, + errExpected: nil, }, { - name: "blockHeight = 1", + desc: "blockHeight = 1", blockHeight: 1, expectedNumBlocksPerSession: 4, expectedSessionNumber: 0, expectedSessionStartBlock: 0, expectedSessionEndBlock: 4, + errExpected: nil, }, { - name: "blockHeight = sessionHeight", + desc: "blockHeight = sessionHeight", blockHeight: 4, expectedNumBlocksPerSession: 4, expectedSessionNumber: 1, expectedSessionStartBlock: 4, expectedSessionEndBlock: 8, + errExpected: nil, }, { - name: "blockHeight != sessionHeight", + desc: "blockHeight != sessionHeight", blockHeight: 5, expectedNumBlocksPerSession: 4, expectedSessionNumber: 1, expectedSessionStartBlock: 4, expectedSessionEndBlock: 8, + errExpected: nil, + }, + { + desc: "blockHeight > contextHeight", + blockHeight: 9001, // block height over 9000 is too height given that the context height is 100 + + errExpected: types.ErrSessionHydration, }, } appAddr := keepertest.TestApp1Address serviceId := keepertest.TestServiceId1 sessionKeeper, ctx := keepertest.SessionKeeper(t) + ctx = ctx.WithBlockHeight(100) // provide a sufficiently large block height to avoid errors for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { + t.Run(tt.desc, func(t *testing.T) { sessionHydrator := keeper.NewSessionHydrator(appAddr, serviceId, tt.blockHeight) session, err := sessionKeeper.HydrateSession(ctx, sessionHydrator) + + if tt.errExpected != nil { + require.ErrorIs(t, tt.errExpected, err) + return + } require.NoError(t, err) require.Equal(t, tt.expectedNumBlocksPerSession, session.NumBlocksPerSession) @@ -118,7 +136,7 @@ func TestSession_HydrateSession_Metadata(t *testing.T) { func TestSession_HydrateSession_SessionId(t *testing.T) { type test struct { - name string + desc string blockHeight1 int64 blockHeight2 int64 @@ -137,7 +155,7 @@ func TestSession_HydrateSession_SessionId(t *testing.T) { // Currently assumes NumBlocksPerSession=4 tests := []test{ { - name: "(app1, svc1): sessionId at first session block != sessionId at next session block", + desc: "(app1, svc1): sessionId at first session block != sessionId at next session block", blockHeight1: 4, blockHeight2: 8, @@ -148,11 +166,11 @@ func TestSession_HydrateSession_SessionId(t *testing.T) { serviceId1: keepertest.TestServiceId1, // svc1 serviceId2: keepertest.TestServiceId1, // svc1 - expectedSessionId1: "aabaa25668538f80395170be95ce1d1536d9228353ced71cc3b763171316fe39", - expectedSessionId2: "23f037a10f9d51d020d27763c42dd391d7e71765016d95d0d61f36c4a122efd0", + expectedSessionId1: "251665c7cf286a30fbd98acd983c63e9a34efc16496511373405e24eb02a8fb9", + expectedSessionId2: "5481d5ca2ddb15dc5edb792b8e20ba9c7d516a74475fc5feba6b6aeb95a26f58", }, { - name: "app1: sessionId for svc1 != sessionId for svc2", + desc: "app1: sessionId for svc1 != sessionId for svc12", blockHeight1: 4, blockHeight2: 4, @@ -160,14 +178,14 @@ func TestSession_HydrateSession_SessionId(t *testing.T) { appAddr1: keepertest.TestApp1Address, // app1 appAddr2: keepertest.TestApp1Address, // app1 - serviceId1: keepertest.TestServiceId1, // svc1 - serviceId2: keepertest.TestServiceId2, // svc2 + serviceId1: keepertest.TestServiceId1, // svc1 + serviceId2: keepertest.TestServiceId12, // svc12 - expectedSessionId1: "aabaa25668538f80395170be95ce1d1536d9228353ced71cc3b763171316fe39", - expectedSessionId2: "478d005769e5edf38d9bf2d8828a56d78b17348bb2c4796dd6d85b5d736a908a", + expectedSessionId1: "251665c7cf286a30fbd98acd983c63e9a34efc16496511373405e24eb02a8fb9", + expectedSessionId2: "44fce80205bece269429a5dc8b55f9d96e5bf7acdb9838f2ac9aa7216905a1cf", }, { - name: "svc1: sessionId for app1 != sessionId for app2", + desc: "svc12: sessionId for app1 != sessionId for app2", blockHeight1: 4, blockHeight2: 4, @@ -175,18 +193,19 @@ func TestSession_HydrateSession_SessionId(t *testing.T) { appAddr1: keepertest.TestApp1Address, // app1 appAddr2: keepertest.TestApp2Address, // app2 - serviceId1: keepertest.TestServiceId1, // svc1 - serviceId2: keepertest.TestServiceId1, // svc1 + serviceId1: keepertest.TestServiceId12, // svc12 + serviceId2: keepertest.TestServiceId12, // svc12 - expectedSessionId1: "aabaa25668538f80395170be95ce1d1536d9228353ced71cc3b763171316fe39", - expectedSessionId2: "b4b0d8747b1cf67050a7bfefd7e93ebbad80c534fa14fb3c69339886f2ed7061", + expectedSessionId1: "44fce80205bece269429a5dc8b55f9d96e5bf7acdb9838f2ac9aa7216905a1cf", + expectedSessionId2: "22328e12562532047c9d4200beaedc9be694cd99b38938ba64cf4cdca0a8ecba", }, } sessionKeeper, ctx := keepertest.SessionKeeper(t) + ctx = ctx.WithBlockHeight(100) // provide a sufficiently large block height to avoid errors for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { + t.Run(tt.desc, func(t *testing.T) { sessionHydrator1 := keeper.NewSessionHydrator(tt.appAddr1, tt.serviceId1, tt.blockHeight1) session1, err := sessionKeeper.HydrateSession(ctx, sessionHydrator1) require.NoError(t, err) @@ -205,30 +224,48 @@ func TestSession_HydrateSession_SessionId(t *testing.T) { // TODO_TECHDEBT: Expand these tests to account for application joining/leaving the network at different heights as well changing the services they support func TestSession_HydrateSession_Application(t *testing.T) { type test struct { - name string - appAddr string + // Description + desc string + // Inputs + appAddr string + serviceId string + // Outputs expectedErr error } tests := []test{ { - name: "app is found", - appAddr: keepertest.TestApp1Address, + desc: "app is found", + + appAddr: keepertest.TestApp1Address, + serviceId: keepertest.TestServiceId1, expectedErr: nil, }, { - name: "app is not found", - appAddr: sample.AccAddress(), // Generating a random address on the fly + desc: "app is not found", - expectedErr: types.ErrHydratingSession, + appAddr: sample.AccAddress(), // Generating a random address on the fly + serviceId: keepertest.TestServiceId1, + + expectedErr: types.ErrSessionHydration, }, { - name: "invalid app address", - appAddr: "invalid", + desc: "invalid app address", + + appAddr: "invalid", + serviceId: keepertest.TestServiceId1, - expectedErr: types.ErrHydratingSession, + expectedErr: types.ErrSessionHydration, + }, + { + desc: "invalid - app not staked for service", + + appAddr: keepertest.TestApp1Address, // app1 + serviceId: "svc9001", // app1 is only stake for svc1 and svc11 + + expectedErr: types.ErrSessionHydration, }, // TODO_TECHDEBT: Add tests for when: // - Application join/leaves (stakes/unstakes) altogether @@ -236,13 +273,13 @@ func TestSession_HydrateSession_Application(t *testing.T) { // - Application increases stakes mid-session } - serviceId := keepertest.TestServiceId1 blockHeight := int64(10) sessionKeeper, ctx := keepertest.SessionKeeper(t) + ctx = ctx.WithBlockHeight(100) // provide a sufficiently large block height to avoid errors for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - sessionHydrator := keeper.NewSessionHydrator(tt.appAddr, serviceId, blockHeight) + t.Run(tt.desc, func(t *testing.T) { + sessionHydrator := keeper.NewSessionHydrator(tt.appAddr, tt.serviceId, blockHeight) _, err := sessionKeeper.HydrateSession(ctx, sessionHydrator) if tt.expectedErr != nil { require.Error(t, err) @@ -256,10 +293,14 @@ func TestSession_HydrateSession_Application(t *testing.T) { // TODO_TECHDEBT: Expand these tests to account for supplier joining/leaving the network at different heights as well changing the services they support func TestSession_HydrateSession_Suppliers(t *testing.T) { type test struct { - name string + // Description + desc string + + // Inputs appAddr string serviceId string + // Outputs numExpectedSuppliers int expectedErr error } @@ -268,15 +309,17 @@ func TestSession_HydrateSession_Suppliers(t *testing.T) { // Currently assumes NumSupplierPerSession=15 tests := []test{ { - name: "num_suppliers_available = 0", + desc: "num_suppliers_available = 0", + appAddr: keepertest.TestApp1Address, // app1 - serviceId: "svc_unknown", + serviceId: keepertest.TestServiceId11, numExpectedSuppliers: 0, - expectedErr: types.ErrSuppliersNotFound, + expectedErr: types.ErrSessionSuppliersNotFound, }, { - name: "num_suppliers_available < num_suppliers_per_session_param", + desc: "num_suppliers_available < num_suppliers_per_session_param", + appAddr: keepertest.TestApp1Address, // app1 serviceId: keepertest.TestServiceId1, // svc1 @@ -295,9 +338,10 @@ func TestSession_HydrateSession_Suppliers(t *testing.T) { blockHeight := int64(10) sessionKeeper, ctx := keepertest.SessionKeeper(t) + ctx = ctx.WithBlockHeight(100) // provide a sufficiently large block height to avoid errors for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) {}) + t.Run(tt.desc, func(t *testing.T) {}) sessionHydrator := keeper.NewSessionHydrator(tt.appAddr, tt.serviceId, blockHeight) session, err := sessionKeeper.HydrateSession(ctx, sessionHydrator) diff --git a/x/session/types/errors.go b/x/session/types/errors.go index 3bf90eae7..dde73c1e6 100644 --- a/x/session/types/errors.go +++ b/x/session/types/errors.go @@ -8,7 +8,11 @@ import ( // x/session module sentinel errors var ( - ErrHydratingSession = sdkerrors.Register(ModuleName, 1, "error during session hydration") - ErrAppNotFound = sdkerrors.Register(ModuleName, 2, "application not found") - ErrSuppliersNotFound = sdkerrors.Register(ModuleName, 3, "suppliers not found") + ErrSessionHydration = sdkerrors.Register(ModuleName, 1, "error during session hydration") + ErrSessionAppNotFound = sdkerrors.Register(ModuleName, 2, "application for session not found not found ") + ErrSessionAppNotStakedForService = sdkerrors.Register(ModuleName, 3, "application in session not staked for requested service") + ErrSessionSuppliersNotFound = sdkerrors.Register(ModuleName, 4, "no suppliers not found for session") + ErrSessionInvalidAppAddress = sdkerrors.Register(ModuleName, 5, "invalid application address for session") + ErrSessionInvalidService = sdkerrors.Register(ModuleName, 6, "invalid service in session") + ErrSessionInvalidBlockHeight = sdkerrors.Register(ModuleName, 7, "invalid block height for session") ) diff --git a/x/session/types/query_get_session_request.go b/x/session/types/query_get_session_request.go new file mode 100644 index 000000000..31b705f8e --- /dev/null +++ b/x/session/types/query_get_session_request.go @@ -0,0 +1,40 @@ +package types + +import ( + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + + sharedhelpers "github.com/pokt-network/poktroll/x/shared/helpers" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" +) + +// NOTE: Please note that `QueryGetSessionRequest` is not a `sdk.Msg`, and is therefore not a message/request +// that will be signable or invoke a state transition. However, following a similar `ValidateBasic` pattern +// allows us to localize & reuse validation logic. +func NewQueryGetSessionRequest(appAddress, serviceId string, blockHeight int64) *QueryGetSessionRequest { + return &QueryGetSessionRequest{ + ApplicationAddress: appAddress, + Service: &sharedtypes.Service{ + Id: serviceId, + }, + BlockHeight: blockHeight, + } +} + +func (query *QueryGetSessionRequest) ValidateBasic() error { + // Validate the application address + if _, err := sdk.AccAddressFromBech32(query.ApplicationAddress); err != nil { + return sdkerrors.Wrapf(ErrSessionInvalidAppAddress, "invalid app address for session being retrieved %s; (%v)", query.ApplicationAddress, err) + } + + // Validate the Service ID + if !sharedhelpers.IsValidService(query.Service) { + return sdkerrors.Wrapf(ErrSessionInvalidService, "invalid service for session being retrieved %s;", query.Service) + } + + // Validate the height for which a session is being retrieved + if query.BlockHeight < 0 { // Note that `0` defaults to the latest height rather than genesis + return sdkerrors.Wrapf(ErrSessionInvalidBlockHeight, "invalid block height for session being retrieved %d;", query.BlockHeight) + } + return nil +} diff --git a/x/shared/helpers/service.go b/x/shared/helpers/service.go index 760ee0162..9825f26d4 100644 --- a/x/shared/helpers/service.go +++ b/x/shared/helpers/service.go @@ -27,9 +27,12 @@ func init() { } -// IsValidService checks if the input service is valid +// IsValidService checks if the provided ServiceId struct has valid fields func IsValidService(service *sharedtypes.Service) bool { - return service != nil && IsValidServiceId(service.Id) && IsValidServiceName(service.Name) + // Check if service Id and Name are valid using the provided helper functions + return service != nil && + IsValidServiceId(service.Id) && + IsValidServiceName(service.Name) } // IsValidServiceId checks if the input string is a valid serviceId diff --git a/x/shared/helpers/service_test.go b/x/shared/helpers/service_test.go index 63009cf28..d74b77afa 100644 --- a/x/shared/helpers/service_test.go +++ b/x/shared/helpers/service_test.go @@ -12,60 +12,119 @@ func TestIsValidService(t *testing.T) { tests := []struct { desc string - id string - name string - expected bool + serviceId string + serviceName string + + expectedIsValid bool }{ { desc: "Valid ID and Name", - id: "Service1", - name: "Valid Service Name", - expected: true, + serviceId: "Service1", + serviceName: "Valid Service Name", + + expectedIsValid: true, }, { desc: "Valid ID and empty Name", - id: "Srv", - name: "", // Valid because the service name can be empty - expected: true, + serviceId: "Srv", + serviceName: "", // Valid because the service name can be empty + + expectedIsValid: true, }, { desc: "ID exceeds max length", - id: "TooLongId123", // Exceeds maxServiceIdLength - name: "Valid Name", - expected: false, + serviceId: "TooLongId123", // Exceeds maxServiceIdLength + serviceName: "Valid Name", + + expectedIsValid: false, }, { - desc: "Name exceeds max length", - id: "ValidID", - name: "This service name is way too long to be considered valid since it exceeds the max length", - expected: false, + desc: "Name exceeds max length", + + serviceId: "ValidID", + serviceName: "This service name is way too long to be considered valid since it exceeds the max length", + + expectedIsValid: false, }, { desc: "Empty ID is invalid", - id: "", // Invalid because the service ID cannot be empty - name: "Valid Name", - expected: false, + serviceId: "", // Invalid because the service ID cannot be empty + serviceName: "Valid Name", + + expectedIsValid: false, }, { desc: "Invalid characters in ID", - id: "ID@Invalid", // Invalid character '@' - name: "Valid Name", - expected: false, + serviceId: "ID@Invalid", // Invalid character '@' + serviceName: "Valid Name", + + expectedIsValid: false, }, } for _, test := range tests { t.Run(test.desc, func(t *testing.T) { service := &sharedtypes.Service{ - Id: test.id, - Name: test.name, + Id: test.serviceId, + Name: test.serviceName, } result := IsValidService(service) + require.Equal(t, test.expectedIsValid, result) + }) + } +} + +func TestIsValidServiceName(t *testing.T) { + tests := []struct { + desc string + input string + expected bool + }{ + { + desc: "Valid with hyphen and number", + input: "ValidName-1", + expected: true, + }, + { + desc: "Valid with space and underscore", + input: "Valid Name_1", + expected: true, + }, + { + desc: "Valid name with spaces", + input: "valid name with spaces", + expected: true, + }, + { + desc: "Invalid character '@'", + input: "invalid@name", + expected: false, + }, + { + desc: "Invalid character '.'", + input: "Valid.Name", + expected: false, + }, + { + desc: "Empty string", + input: "", + expected: true, + }, + { + desc: "Exceeds maximum length", + input: "validnamebuttoolongvalidnamebuttoolongvalidnamebuttoolong", + expected: false, + }, + } + + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + result := IsValidServiceName(test.input) require.Equal(t, test.expected, result) }) } diff --git a/x/supplier/client/cli/query_supplier.go b/x/supplier/client/cli/query_supplier.go index cfbc6b4ec..604c1182f 100644 --- a/x/supplier/client/cli/query_supplier.go +++ b/x/supplier/client/cli/query_supplier.go @@ -46,7 +46,7 @@ func CmdListSupplier() *cobra.Command { func CmdShowSupplier() *cobra.Command { cmd := &cobra.Command{ - Use: "show-supplier [address]", + Use: "show-supplier ", Short: "shows a supplier", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) (err error) { diff --git a/x/supplier/client/cli/tx_create_claim.go b/x/supplier/client/cli/tx_create_claim.go index db951891f..2869ce95d 100644 --- a/x/supplier/client/cli/tx_create_claim.go +++ b/x/supplier/client/cli/tx_create_claim.go @@ -2,9 +2,8 @@ package cli import ( "encoding/base64" - "strconv" - "encoding/json" + "strconv" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -21,7 +20,7 @@ var _ = strconv.Itoa(0) func CmdCreateClaim() *cobra.Command { cmd := &cobra.Command{ - Use: "create-claim [session-header] [root-hash-base64]", + Use: "create-claim ", Short: "Broadcast message create-claim", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) (err error) { diff --git a/x/supplier/client/cli/tx_stake_supplier.go b/x/supplier/client/cli/tx_stake_supplier.go index f74a874fa..83a1413e2 100644 --- a/x/supplier/client/cli/tx_stake_supplier.go +++ b/x/supplier/client/cli/tx_stake_supplier.go @@ -23,7 +23,7 @@ func CmdStakeSupplier() *cobra.Command { // TODO_HACK: For now we are only specifying the service IDs as a list of of strings separated by commas. // This needs to be expand to specify the full SupplierServiceConfig. Furthermore, providing a flag to // a file where SupplierServiceConfig specifying full service configurations in the CLI by providing a flag that accepts a JSON string - Use: "stake-supplier [amount] [svcId1;url1,svcId2;url2,...,svcIdN;urlN]", + Use: "stake-supplier ", Short: "Stake a supplier", Long: `Stake an supplier with the provided parameters. This is a broadcast operation that will stake the tokens and associate them with the supplier specified by the 'from' address. diff --git a/x/supplier/client/cli/tx_submit_proof.go b/x/supplier/client/cli/tx_submit_proof.go index 64c498026..0c3ba758f 100644 --- a/x/supplier/client/cli/tx_submit_proof.go +++ b/x/supplier/client/cli/tx_submit_proof.go @@ -2,9 +2,8 @@ package cli import ( "encoding/base64" - "strconv" - "encoding/json" + "strconv" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -15,13 +14,13 @@ import ( "github.com/pokt-network/poktroll/x/supplier/types" ) -var _ = strconv.Itoa(0) - // TODO(@bryanchriswhite): Add unit tests for the CLI command when implementing the business logic. +var _ = strconv.Itoa(0) + func CmdSubmitProof() *cobra.Command { cmd := &cobra.Command{ - Use: "submit-proof [session-header] [proof-base64]", + Use: "submit-proof ", Short: "Broadcast message submit-proof", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) (err error) {