CosmWasm/wasmd

offset and count queries not supported

99Kies opened this issue · 5 comments

99Kies commented

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 commented

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

alpe commented

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

99Kies commented

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

alpe commented

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

99Kies commented

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