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

Restrict pagination on all-state-query #1619

Merged
merged 1 commit into from
Sep 14, 2023
Merged

Restrict pagination on all-state-query #1619

merged 1 commit into from
Sep 14, 2023

Conversation

alpe
Copy link
Member

@alpe alpe commented Sep 12, 2023

Iterating via key is the best performing option.

@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Merging #1619 (965e28c) into main (09b5008) will increase coverage by 0.02%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1619      +/-   ##
==========================================
+ Coverage   56.59%   56.62%   +0.02%     
==========================================
  Files          64       64              
  Lines        8755     8760       +5     
==========================================
+ Hits         4955     4960       +5     
- Misses       3414     3415       +1     
+ Partials      386      385       -1     
Files Changed Coverage Δ
x/wasm/client/cli/query.go 0.00% <0.00%> (ø)
x/wasm/keeper/querier.go 74.78% <100.00%> (+0.33%) ⬆️

... and 1 file with indirect coverage changes

@alpe alpe requested a review from pinosu September 13, 2023 12:18
@@ -368,7 +368,10 @@ func GetCmdGetContractStateAll() *cobra.Command {
SilenceUsage: true,
}
flags.AddQueryFlagsToCmd(cmd)
flags.AddPaginationFlagsToCmd(cmd, "contract state")
cmd.Flags().String(flags.FlagPageKey, "", "pagination page-key of contract state to query for")
cmd.Flags().Uint64(flags.FlagLimit, 100, "pagination limit of contract state to query for")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

},
"with pagination count": {
srcQuery: &types.QueryAllContractStateRequest{
Address: contractAddr.String(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice test 👍

Copy link
Contributor

@pinosu pinosu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@alpe alpe merged commit 42f3192 into main Sep 14, 2023
15 of 16 checks passed
@alpe alpe deleted the queries branch September 14, 2023 09:07
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

Successfully merging this pull request may close these issues.

2 participants