Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

offset and count queries not supported #1759

Open
99Kies opened this issue Dec 14, 2023 · 5 comments
Open

offset and count queries not supported #1759

99Kies opened this issue Dec 14, 2023 · 5 comments

Comments

@99Kies
Copy link
Contributor

99Kies commented Dec 14, 2023

this is my cosmwasm version:

	github.com/CosmWasm/wasmd v0.43.0
	github.com/CosmWasm/wasmvm v1.5.0 // indirect
	github.com/cometbft/cometbft v0.37.2
	github.com/cometbft/cometbft-db v0.8.0
	github.com/cosmos/cosmos-sdk v0.47.5

url: https://vota-testnet-rest.dorafactory.org/cosmwasm/wasm/v1/code?pagination.limit=20&pagination.count_total=true

error log:

{
  "code": 3,
  "message": "offset and count queries not supported",
  "details": [
    
  ]
}
@99Kies
Copy link
Contributor Author

99Kies commented Dec 14, 2023

I found that I need to remove the pagination for the query to succeed, why is that? (This is not consistent with the parameter requirements of the other rest methods)

https://vota-testnet-rest.dorafactory.org/cosmwasm/wasm/v1/code?limit=20&count_total=true

@99Kies 99Kies closed this as completed Dec 14, 2023
@99Kies 99Kies reopened this Dec 14, 2023
@alpe
Copy link
Contributor

alpe commented Dec 17, 2023

The offset/ count implementations are very inefficient in the SDK. Just use the normal token pagination

@99Kies
Copy link
Contributor Author

99Kies commented Dec 18, 2023

image
@alpe But I found that this paging function is not working, why is that?

@alpe
Copy link
Contributor

alpe commented Dec 18, 2023

when the next key is null, then you have reached the last page.

@99Kies
Copy link
Contributor Author

99Kies commented Dec 22, 2023

@alpe But I set the limit, it still return all 6 records. and the total data also is wrong. right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants