-
Notifications
You must be signed in to change notification settings - Fork 591
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
imp: remove Route
method in favour of Verify(Non)Membership
on client keeper
#6760
Conversation
* chore: pull out get light client module to helper methods * another place to use getLightClientModuleRoute * use getLightClientModule in other 02-client functions * lint --------- Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
# Conflicts: # modules/core/03-connection/keeper/verify.go # modules/light-clients/09-localhost/client_state.go
@@ -16,7 +16,7 @@ type ClientKeeper interface { | |||
GetClientConsensusState(ctx sdk.Context, clientID string, height exported.Height) (exported.ConsensusState, bool) | |||
GetSelfConsensusState(ctx sdk.Context, height exported.Height) (exported.ConsensusState, error) | |||
ValidateSelfClient(ctx sdk.Context, clientState exported.ClientState) error | |||
VerifyMembershipp(ctx sdk.Context, clientID string, height exported.Height, delayTimePeriod uint64, delayBlockPeriod uint64, proof []byte, path exported.Path, value []byte) error | |||
VerifyMembershipProof(ctx sdk.Context, clientID string, height exported.Height, delayTimePeriod uint64, delayBlockPeriod uint64, proof []byte, path exported.Path, value []byte) error | |||
VerifyNonMembership(ctx sdk.Context, clientID string, height exported.Height, delayTimePeriod uint64, delayBlockPeriod uint64, proof []byte, path exported.Path) 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.
Should we call this VerifyNonMembershipProof
for now so that the names align?
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.
Since we will (hopefully) rename the other one back to VerifyMembership
before we release, I thought of keeping it just like this.
assigned ya too Damian, feel free to remove if no bandwidth |
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.
lgtm!
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 @crodriguezvega! 🙏🏻
if !k.GetParams(ctx).IsAllowedClient(clientType) { | ||
return nil, errorsmod.Wrapf( | ||
types.ErrInvalidClientType, | ||
"client (%s) type %s is not in the allowed client list", clientID, clientType, | ||
) | ||
} | ||
|
||
clientModule, found := k.router.GetRoute(clientID) | ||
if !found { | ||
return nil, errorsmod.Wrap(types.ErrRouteNotFound, 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.
I feel like this params check could be moved into router.GetRoute()
.
We already parse the clientID in there, so the changes would be to accept a context and return and error rather than a boolean. I'd be in favour of doing this in a following PR. I can create an issue if others are onboard
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.
how would this jive with registering them in app.go
? Wouldn't you need to run extra logic when updating params just to register the newly allowed light client module?
Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Quality Gate passed for 'ibc-go'Issues Measures |
Description
closes: #6019
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.