-
Notifications
You must be signed in to change notification settings - Fork 646
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
chore: use context.Context and appmodule.Environment in 08-wasm #7880
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This mostly looks good to me. Left a couple of comments and I also think we can safely change the sdk.Context uses in querier as well, as that is just a callback interface for wasmvm, so no wasmd usage there.
|
||
func moduleLogger(ctx sdk.Context) log.Logger { | ||
return ctx.Logger().With("module", "x/"+exported.ModuleName+"-"+types.ModuleName) | ||
func (k Keeper) Logger(_ context.Context) log.Logger { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the context still there due to some interface that needs to be satisifed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops. i should have removed it. done in remove context argument from logger method
updated the queriers! |
Quality Gate passed for 'ibc-go'Issues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking very good! I was wondering about the functions (BeginBlocker, etc) in Simapp, are they supposed to still be using sdk.Context?
@@ -146,7 +149,7 @@ func AcceptListStargateQuerier(acceptedQueries []string, queryRouter types.Query | |||
return nil, wasmvmtypes.UnsupportedRequest{Kind: fmt.Sprintf("No route to query '%s'", request.Path)} | |||
} | |||
|
|||
res, err := route(ctx, &abci.QueryRequest{ | |||
res, err := route(sdk.UnwrapSDKContext(ctx), &abci.QueryRequest{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why is GRPCQueryHandler still taking an sdk context?
@@ -99,7 +99,7 @@ func (ws *WasmSnapshotter) RestoreExtension(height uint64, format uint32, payloa | |||
return errorsmod.Wrapf(snapshot.ErrUnknownFormat, "expected %d, got %d", ws.SnapshotFormat(), format) | |||
} | |||
|
|||
func restoreV1(ctx sdk.Context, k *Keeper, compressedCode []byte) error { | |||
func restoreV1(_ sdk.Context, k *Keeper, compressedCode []byte) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we remove the sdk.Context entierly here?
Description
stacked PR of #7866
supercedes: #7836
Closes: #7712
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.