Skip to content

Commit

Permalink
feat(x/bank): adding DenomOwnersByQuery for denom owners for token (b…
Browse files Browse the repository at this point in the history
…ackport #18956) (#19007)

Co-authored-by: gsai967 <[email protected]>
Co-authored-by: Julien Robert <[email protected]>
  • Loading branch information
3 people authored Jan 10, 2024
1 parent fe4b58b commit 2a199f5
Show file tree
Hide file tree
Showing 10 changed files with 2,615 additions and 333 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Improvements

* (x/bank) [#18956](https://github.com/cosmos/cosmos-sdk/pull/18956) Introduced a new `DenomOwnersByQuery` query method for `DenomOwners`, which accepts the denom value as a query string parameter, resolving issues with denoms containing slashes.
* (x/gov) [#18707](https://github.com/cosmos/cosmos-sdk/pull/18707) Improve genesis validation.
* (x/auth/tx) [#18772](https://github.com/cosmos/cosmos-sdk/pull/18772) Remove misleading gas wanted from tx simulation failure log.
* (client/tx) [#18852](https://github.com/cosmos/cosmos-sdk/pull/18852) Add `WithFromName` to tx factory.
Expand Down
1,675 changes: 1,453 additions & 222 deletions api/cosmos/bank/v1beta1/query.pulsar.go

Large diffs are not rendered by default.

53 changes: 49 additions & 4 deletions api/cosmos/bank/v1beta1/query_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

232 changes: 230 additions & 2 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3568,6 +3568,170 @@ paths:
descending order.


Since: cosmos-sdk 0.43
in: query
required: false
type: boolean
tags:
- Query
/cosmos/bank/v1beta1/denom_owners_by_query:
get:
summary: >-
DenomOwnersByQuery queries for all account addresses that own a
particular token

denomination.
description: 'Since: cosmos-sdk 0.50.3'
operationId: DenomOwnersByQuery
responses:
'200':
description: A successful response.
schema:
type: object
properties:
denom_owners:
type: array
items:
type: object
properties:
address:
type: string
description: >-
address defines the address that owns a particular
denomination.
balance:
type: object
properties:
denom:
type: string
amount:
type: string
description: >-
Coin defines a token with a denomination and an amount.


NOTE: The amount field is an Int which implements the
custom method

signatures required by gogoproto.
description: >-
DenomOwner defines structure representing an account that
owns or holds a

particular denominated token. It contains the account
address and account

balance of the denominated token.


Since: cosmos-sdk 0.46
pagination:
description: pagination defines the pagination in the response.
type: object
properties:
next_key:
type: string
format: byte
description: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently. It will be empty if
there are no more results.
total:
type: string
format: uint64
title: >-
total is total number of results available if
PageRequest.count_total

was set, its value is undefined otherwise
description: >-
QueryDenomOwnersByQueryResponse defines the RPC response of a
DenomOwnersByQuery RPC query.


Since: cosmos-sdk 0.50.3
default:
description: An unexpected error response.
schema:
type: object
properties:
error:
type: string
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
type_url:
type: string
value:
type: string
format: byte
parameters:
- name: denom
description: >-
denom defines the coin denomination to query all account holders
for.
in: query
required: false
type: string
- name: pagination.key
description: |-
key is a value returned in PageResponse.next_key to begin
querying the next page most efficiently. Only one of offset or key
should be set.
in: query
required: false
type: string
format: byte
- name: pagination.offset
description: >-
offset is a numeric offset that can be used when key is unavailable.

It is less efficient than using key. Only one of offset or key
should

be set.
in: query
required: false
type: string
format: uint64
- name: pagination.limit
description: >-
limit is the total number of results to be returned in the result
page.

If left empty it will default to a value to be set by each app.
in: query
required: false
type: string
format: uint64
- name: pagination.count_total
description: >-
count_total is set to true to indicate that the result set should
include

a count of the total number of items available for pagination in
UIs.

count_total is only respected when offset is used. It is ignored
when key

is set.
in: query
required: false
type: boolean
- name: pagination.reverse
description: >-
reverse is set to true if results are to be returned in the
descending order.


Since: cosmos-sdk 0.43
in: query
required: false
Expand Down Expand Up @@ -3787,7 +3951,7 @@ paths:
- Query
/cosmos/bank/v1beta1/denoms_metadata/{denom}:
get:
summary: DenomsMetadata queries the client metadata of a given coin denomination.
summary: DenomMetadata queries the client metadata of a given coin denomination.
operationId: DenomMetadata
responses:
'200':
Expand Down Expand Up @@ -3921,7 +4085,9 @@ paths:
- Query
/cosmos/bank/v1beta1/denoms_metadata_by_query_string:
get:
summary: DenomsMetadata queries the client metadata of a given coin denomination.
summary: >-
DenomMetadataByQueryString queries the client metadata of a given coin
denomination.
operationId: DenomMetadataByQueryString
responses:
'200':
Expand Down Expand Up @@ -40496,6 +40662,68 @@ definitions:
Query/DenomMetadata RPC

method.
cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse:
type: object
properties:
denom_owners:
type: array
items:
type: object
properties:
address:
type: string
description: address defines the address that owns a particular denomination.
balance:
type: object
properties:
denom:
type: string
amount:
type: string
description: >-
Coin defines a token with a denomination and an amount.


NOTE: The amount field is an Int which implements the custom
method

signatures required by gogoproto.
description: >-
DenomOwner defines structure representing an account that owns or
holds a

particular denominated token. It contains the account address and
account

balance of the denominated token.


Since: cosmos-sdk 0.46
pagination:
description: pagination defines the pagination in the response.
type: object
properties:
next_key:
type: string
format: byte
description: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently. It will be empty if
there are no more results.
total:
type: string
format: uint64
title: >-
total is total number of results available if
PageRequest.count_total

was set, its value is undefined otherwise
description: >-
QueryDenomOwnersByQueryResponse defines the RPC response of a
DenomOwnersByQuery RPC query.


Since: cosmos-sdk 0.50.3
cosmos.bank.v1beta1.QueryDenomOwnersResponse:
type: object
properties:
Expand Down
Loading

0 comments on commit 2a199f5

Please sign in to comment.