-
Notifications
You must be signed in to change notification settings - Fork 586
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
Address additional feedback from 08-wasm refactor pr #6176
Conversation
WalkthroughThe recent updates focus on refining the management and accessibility of query plugins within the Wasm light client modules. Functions related to query plugins have been renamed for internal use, and their accessibility in tests has been enhanced through wrapper functions. Additionally, there are updates to error handling in tests and variable renaming for clarity in the light client module logic. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@@ -142,32 +142,27 @@ func (k Keeper) storeWasmCode(ctx sdk.Context, code []byte, storeFn func(code wa | |||
// migrateContractCode migrates the contract for a given light client to one denoted by the given new checksum. The checksum we | |||
// are migrating to must first be stored using storeWasmCode and must not match the checksum currently stored for this light client. | |||
func (k Keeper) migrateContractCode(ctx sdk.Context, clientID string, newChecksum, migrateMsg []byte) error { | |||
wasmClientState, err := k.GetWasmClientState(ctx, clientID) |
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.
merging of two functions here resulted in this. In both cases we look up the same wasmClientState. Using ClientStore
+ GetClientState
(instead of GetWasmClientState
) is more efficient since we already need to grab a reference to the store to pass to WasmMigrate
(though see #6103 (comment))
} | ||
|
||
// SetQueryPlugins is a wrapper around k.setQueryPlugins to allow the method to be directly called in tests. | ||
func (k *Keeper) SetQueryPlugins(plugins QueryPlugins) { |
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.
Are these called directly in tests somewhere? 🤔 (don't see any diffs which use them in this PR)
If they're not needed, I'd be in favouring of deleting them - not the biggest fan of export_test
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.
yea, in options_test.go
atm (though options.go
is tiny and merging it in keeper.go
could be another option if we wanted!)
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.
def don't really like export_test.go
too
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.
Thanks, @DimitrisJim!
@@ -68,18 +68,18 @@ func (k Keeper) GetChecksums() collections.KeySet[[]byte] { | |||
return k.checksums | |||
} | |||
|
|||
// GetQueryPlugins returns the set query plugins. | |||
func (k Keeper) GetQueryPlugins() QueryPlugins { |
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.
This is API breaking for 08-wasm, right? I added this PR to the list of PRs to go through when updating the docs and migration docs, but should we at least reflect that is API breaking in the title of the PR?
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.
these were in internal
before so not exposed to api thankfully! This comment should apply for the other PR though (I unfortunately tend to be forgetful of adding these to the title)
Description
#6103 (comment) and #6103 (comment)
also made
GetQueryPlugins
andSetQueryPlugins
private. Others could also be made private and added toexport_test.go
(probably).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.Summary by CodeRabbit