-
Notifications
You must be signed in to change notification settings - Fork 593
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: cleanup verifcation arg code for 23-commitment #7493
Conversation
@@ -234,16 +226,8 @@ func (proof *MerkleProof) Empty() bool { | |||
return proof == nil || proto.Equal(proof, blankMerkleProof) || proto.Equal(proof, blankProofOps) |
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.
blankProofOps
check? This can be deleted right?? I don't understand the context of when one could provide that type as MerkleProof
?
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.
Agree, doesn't seem to make sense to me
// validateVerificationArgs verifies the proof arguments are valid | ||
func (proof MerkleProof) validateVerificationArgs(specs []*ics23.ProofSpec, root exported.Root) error { | ||
func validateVerificationArgs(proof MerkleProof, path v2.MerklePath, specs []*ics23.ProofSpec, root exported.Root) error { | ||
if proof.Empty() { |
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.
maybe this should be if proof == nil || proof.GetProofs() == nil
. I don't feel like the proof.Empty()
is very effective and creates extra space in this file
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.
Support this 👍🏻
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 also just call this Validate(specs)
as method on merkle proof and move root nil checks to where its being used.
This is also totally fine, and happy to move along with it! 🙏🏻
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.
made the change, but left off the Validate(specs)
suggestion. Happy to approve a followup, but wasn't exactly sure what changes you had in mind
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.
Nice clean up!
@@ -234,16 +226,8 @@ func (proof *MerkleProof) Empty() bool { | |||
return proof == nil || proto.Equal(proof, blankMerkleProof) || proto.Equal(proof, blankProofOps) |
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.
Agree, doesn't seem to make sense to me
// validateVerificationArgs verifies the proof arguments are valid | ||
func (proof MerkleProof) validateVerificationArgs(specs []*ics23.ProofSpec, root exported.Root) error { | ||
func validateVerificationArgs(proof MerkleProof, path v2.MerklePath, specs []*ics23.ProofSpec, root exported.Root) error { | ||
if proof.Empty() { |
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.
Support this 👍🏻
// validateVerificationArgs verifies the proof arguments are valid | ||
func (proof MerkleProof) validateVerificationArgs(specs []*ics23.ProofSpec, root exported.Root) error { | ||
func validateVerificationArgs(proof MerkleProof, path v2.MerklePath, specs []*ics23.ProofSpec, root exported.Root) error { | ||
if proof.Empty() { |
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 also just call this Validate(specs)
as method on merkle proof and move root nil checks to where its being used.
This is also totally fine, and happy to move along with it! 🙏🏻
…o into colin/23-commitment-cleanup
Quality Gate passed for 'ibc-go'Issues Measures |
Description
couldn't help myself 😄
closes: #XXXX
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.