game-of-nfts / gon-evidence

This repo records GoN participants' info and evidence.
25 stars 311 forks source link

BUG: `query nft denoms` #194

Open taitruong opened 1 year ago

taitruong commented 1 year ago

Summary of Bug

Not all denoms are shown. Problem is either in CLI/client or nft module.

Environment

Steps to Reproduce

This query tells me there are 100 collections:

$ iris query nft denoms --page 0 | grep "id:" | wc -l
100 # 100 collections found

Now create a new collection:

$ iris tx nft issue arkprotocol004 --symbol "arkprotocol_symbol" --name "Ark Protocol - building multichain utilities" --uri "https://arkprotocol.io" --mint-restricted=true --update-restricted=true --from iaa183e7ccwsnngj2q8lfxnmekunspnfxs6qxd4v3f --fees 2000uiris -b sync --yes --output json

Query shows collection is, but the number of collections is still 100:

$ iris query nft denoms | grep "arkprotocol004"
  id: arkprotocol004

$ iris query nft denoms | grep "id:" | wc -l
100

Queries are paginated and there's --page with default value 1, however no matter what page is given it always currents the latest 100 collections:

$ iris query nft denoms | grep "arkprotocol004"
  id: arkprotocol004
$ iris query nft denoms | grep "id:" | wc -l
100
$ iris query nft denoms --page 100 | grep "id:" | wc -l
100
$ iris query nft denoms --page 1 | grep "id:" | wc -l
100
$ iris query nft denoms --page 2 | grep "id:" | wc -l
100
$ iris query nft denoms --page 3 | grep "id:" | wc -l
100
$ iris query nft denoms --page 4 | grep "id:" | wc -l
100
$ iris query nft denoms --page 10000 | grep "id:" | wc -l
100

Here is another example from ibc module where queries work properly:

$ iris query ibc channel channels --page 1 | grep '\- channel_id' | wc -l
39
$ iris query ibc channel channels --page 2 | grep '\- channel_id' | wc -l
0

Expected and Actual Behavior

Return collections based on pagination.

taitruong commented 1 year ago

result output has pagination.next_key. The --page flag is not used here and should be removed.

taramakage commented 1 year ago

This is not a bug. Iris has forbidden the use of --page, and you can only use --page-key.

taitruong commented 1 year ago

This is not a bug. Iris has forbidden the use of --page, and you can only use --page-key.

Agree, but it then should show an error, like this:

$ iris query block --page 132
Error: unknown flag: --page

--page-key is at a couple of places: like iris query nft denoms and iris query nft collection. If you enter iris query nft denoms --help it shows --page uint pagination page of all denoms to query for. This sets offset to a multiple of limit (default 1).

For devs it might be not a bug, since it just ignores - for users it is, since --page is passed and provides some output and user wonders why it always outputs the same results for different pages :).

taitruong commented 1 year ago

As discussed with @taramakage, technically it seems to be irrelevant to ICS721. But here also from a business perspective: if a misleading command like iris query nft collection --page XYZ is not providing all tokens, then as a result, not all tokens can be transferred using ICS721.

We are all techies, but we sometimes need to see what business requirements there are in 1st place 😎!