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

Format code according to go1.19rc2 #38

Merged
merged 1 commit into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions compact/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import "math/bits"
// from 0, which corresponds to the tree leaves. Within each level, nodes are
// numbered with consecutive indices starting from 0.
//
// L4: ┌───────0───────┐ ...
// L3: ┌───0───┐ ┌───1───┐ ┌─── ...
// L2: ┌─0─┐ ┌─1─┐ ┌─2─┐ ┌─3─┐ ┌─4─┐ ...
// L1: ┌0┐ ┌1┐ ┌2┐ ┌3┐ ┌4┐ ┌5┐ ┌6┐ ┌7┐ ┌8┐ ┌9┐ ...
// L0: 0 1 2 3 4 5 6 7 8 9 ... ... ... ... ... ...
// L4: ┌───────0───────┐ ...
// L3: ┌───0───┐ ┌───1───┐ ┌─── ...
// L2: ┌─0─┐ ┌─1─┐ ┌─2─┐ ┌─3─┐ ┌─4─┐ ...
// L1: ┌0┐ ┌1┐ ┌2┐ ┌3┐ ┌4┐ ┌5┐ ┌6┐ ┌7┐ ┌8┐ ┌9┐ ...
// L0: 0 1 2 3 4 5 6 7 8 9 ... ... ... ... ... ...
//
// When the tree is not perfect, the nodes that would complement it to perfect
// are called ephemeral. Algorithms that operate with ephemeral nodes still map
Expand Down
6 changes: 3 additions & 3 deletions compact/range.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ func getMergePath(begin, mid, end uint64) (uint, uint) {
// some integers m, k >= 0.
//
// The sequence of sizes is returned encoded as bitmasks left and right, where:
// - a 1 bit in a bitmask denotes a sub-range of the corresponding size 2^k
// - left mask bits in LSB-to-MSB order encode the left part of the sequence
// - right mask bits in MSB-to-LSB order encode the right part
// - a 1 bit in a bitmask denotes a sub-range of the corresponding size 2^k
// - left mask bits in LSB-to-MSB order encode the left part of the sequence
// - right mask bits in MSB-to-LSB order encode the right part
//
// The corresponding values of m are not returned (they can be calculated from
// begin and the sub-range sizes).
Expand Down
60 changes: 30 additions & 30 deletions proof/proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ import (
// TestInclusion contains inclusion proof tests. For reference, consider the
// following example of a tree from RFC 6962:
//
// hash <== Level 3
// / \
// / \
// / \
// / \
// / \
// k l <== Level 2
// / \ / \
// / \ / \
// / \ / \
// g h i [ ] <== Level 1
// / \ / \ / \ /
// a b c d e f j <== Level 0
// | | | | | | |
// d0 d1 d2 d3 d4 d5 d6
// hash <== Level 3
// / \
// / \
// / \
// / \
// / \
// k l <== Level 2
// / \ / \
// / \ / \
// / \ / \
// g h i [ ] <== Level 1
// / \ / \ / \ /
// a b c d e f j <== Level 0
// | | | | | | |
// d0 d1 d2 d3 d4 d5 d6
//
// Our storage node layers are always populated from the bottom up, hence the
// gap at level 1, index 3 in the above picture.
Expand Down Expand Up @@ -133,21 +133,21 @@ func TestInclusion(t *testing.T) {
// TestConsistency contains consistency proof tests. For reference, consider
// the following example:
//
// hash5 hash7
// / \ / \
// / \ / \
// / \ / \
// / \ / \
// / \ / \
// k [ ] --> k l
// / \ / / \ / \
// / \ / / \ / \
// / \ / / \ / \
// g h [ ] g h i [ ]
// / \ / \ / / \ / \ / \ /
// a b c d e a b c d e f j
// | | | | | | | | | | | |
// d0 d1 d2 d3 d4 d0 d1 d2 d3 d4 d5 d6
// hash5 hash7
// / \ / \
// / \ / \
// / \ / \
// / \ / \
// / \ / \
// k [ ] --> k l
// / \ / / \ / \
// / \ / / \ / \
// / \ / / \ / \
// g h [ ] g h i [ ]
// / \ / \ / / \ / \ / \ /
// a b c d e a b c d e f j
// | | | | | | | | | | | |
// d0 d1 d2 d3 d4 d0 d1 d2 d3 d4 d5 d6
//
// The consistency proof between tree size 5 and 7 consists of nodes e, f, j,
// and k. The node j is taken instead of its missing parent.
Expand Down