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

Streamline Stargate/gRPC querier interfaces #2093

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

webmaster128
Copy link
Member

This PR aims to improve readbility of the Stargate/gRPC querier interfaces and implementations. It helped me reason about what chains need to do to override defaults. Hope it helps someone.

x/wasm/keeper/query_plugins.go Outdated Show resolved Hide resolved
// RejectStargateQuerier is a querier that rejects all stargate queries.
//
// Use AcceptListStargateQuerier instead to create a list of accepted query types.
func RejectStargateQuerier(ctx sdk.Context, request *wasmvmtypes.StargateQuery) ([]byte, error) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I guess this is breaking since it changes the signature of a public function.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, that's breaking. I would assume that most people don't use the RejectStargateQuerier directly, since it's the default anyways, but not sure.

Copy link
Member Author

Choose a reason for hiding this comment

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

Github only finds copies, no usage: https://github.com/search?q=RejectStargateQuerier&type=code
So probably a good change to include in 0.55

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 42.99%. Comparing base (939a837) to head (4d27351).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
x/wasm/keeper/query_plugins.go 33.33% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2093      +/-   ##
==========================================
- Coverage   42.99%   42.99%   -0.01%     
==========================================
  Files          85       85              
  Lines       11601    11600       -1     
==========================================
- Hits         4988     4987       -1     
- Misses       6166     6167       +1     
+ Partials      447      446       -1     
Files with missing lines Coverage Δ
x/wasm/keeper/query_plugins.go 58.97% <33.33%> (-0.09%) ⬇️

Copy link
Collaborator

@chipshort chipshort left a comment

Choose a reason for hiding this comment

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

LGTM

}

var _ stargateQuerierFn = RejectStargateQuerier // just a type check
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice

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.

Nice! LGTM 👍

@webmaster128
Copy link
Member Author

Thanks for the reviews. Feel free to merge whenever you consider it useful for 0.55.

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.

3 participants