-
Notifications
You must be signed in to change notification settings - Fork 67
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
TreeFromProof test hardening #356
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.
Thanks for looking at that. Indeed a lot of stuff has fossilized and should be cleaned up. I will change the interface to MakeVerkleMultiProof
proof_test.go
Outdated
droot, err := TreeFromProof(dproof, root.Commit()) | ||
if err != nil { | ||
t.Fatal(err) | ||
func TestStatelessDeserializeMissingChildNode(t *testing.T) { |
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.
that's nice, but there should be another one in which oneKeyTest
is the missing key, so that we can check this use case is also working.
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.
Done, it's named TestStatelessDeserializeAbsentValueInExistingLeafNode(...)
.
@jsign right, the reason |
51b2d20
to
3e84a42
Compare
Signed-off-by: Ignacio Hagopian <[email protected]>
3e84a42
to
c681457
Compare
Signed-off-by: Ignacio Hagopian <[email protected]>
4da9baa
to
3814a09
Compare
Signed-off-by: Ignacio Hagopian <[email protected]>
3814a09
to
fbb0559
Compare
Signed-off-by: Ignacio Hagopian <[email protected]>
Signed-off-by: Ignacio Hagopian <[email protected]>
} | ||
} | ||
|
||
func TestProofOfPresenceWithEmptyValue(t *testing.T) { |
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 now TestStatelessDeserializeAbsentValueInExistingLeafNode(...)
@@ -729,125 +729,211 @@ func TestVerkleProofMarshalUnmarshalJSON(t *testing.T) { | |||
func TestStatelessDeserialize(t *testing.T) { |
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.
Most of the tests now use shared code which allows them to be described more shortly.
} | ||
|
||
func TestStatelessDeserializeMissingChildNode(t *testing.T) { |
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.
Renamed to TestStatelessDeserializeMissingLeafNode
} | ||
|
||
func TestStatelessDeserializeDepth2(t *testing.T) { |
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.
Not lost, the test is still here but the diff is confusing.
@@ -988,87 +1074,6 @@ func TestProofVerificationWithPostState(t *testing.T) { // skipcq: GO-R1005 | |||
}) | |||
} | |||
} | |||
func TestProofOfAbsenceBorderCase(t *testing.T) { |
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.
Not deleted, it's now in L813.
} | ||
} | ||
|
||
func TestProofOfAbsenceBorderCaseReversed(t *testing.T) { |
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.
Not deleted, it's now in L826.
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. Thanks for rebasing.
This PR adds more test coverage for
PreStateTreeFromProof(...)
.The diff is very messy, so I recommend some "split view" maybe.