Skip to content
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

merkledb -- make tests use time as randomness seed #2470

Merged
merged 6 commits into from
Dec 15, 2023
Merged

Conversation

danlaine
Copy link

Why this should be merged

Since we use Go 1.20 now, we can wrap errors.

How this works

Use time-based randomness in tests. Remove broken tests.

How this was tested

Run the tests.

@danlaine danlaine added testing This primarily focuses on testing merkledb labels Dec 11, 2023
@danlaine danlaine self-assigned this Dec 11, 2023
@@ -280,19 +276,7 @@ func TestGetRangeProof(t *testing.T) {
response.StartProof = proof.StartProof
response.EndProof = proof.EndProof
},
expectedErr: merkledb.ErrInvalidProof,
},
"removed last key in response": {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not guaranteed to error here. The proof might still be valid.

@@ -623,19 +603,7 @@ func TestGetChangeProof(t *testing.T) {
modifyChangeProofResponse: func(response *merkledb.ChangeProof) {
response.KeyChanges = response.KeyChanges[1:]
},
expectedErr: merkledb.ErrInvalidProof,
},
"removed last key in response": {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not guaranteed to error here. The proof might still be valid.

@danlaine danlaine enabled auto-merge December 14, 2023 21:20
@danlaine danlaine disabled auto-merge December 15, 2023 17:06
@danlaine danlaine merged commit 8c47e3f into dev Dec 15, 2023
17 checks passed
@danlaine danlaine deleted the merkledb-update-1.20 branch December 15, 2023 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merkledb testing This primarily focuses on testing
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants