Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
  • Loading branch information
rian committed Jun 2, 2024
1 parent c423e8e commit a6d8123
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions core/trie/proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,17 +586,17 @@ func TestBuildTrie(t *testing.T) {
require.NoError(t, err)

// Assert the structure is correct
require.Equal(t, rootKey, builtRootKey)
compareLeftRight(t, rootNode, builtRootNode)
compareLeftRight(t, leftNode, builtLeftNode)
compareLeftRight(t, rightNode, builtRightNode)
compareLeftRight(t, leftleftNode, builtLeftLeftNode)
compareLeftRight(t, leftrightNode, builtLeftRightNode)
require.Equal(t, rootKey, builtRootKey) // correct
compareLeftRight(t, rootNode, builtRootNode) // correct
compareLeftRight(t, leftNode, builtLeftNode) // correct
compareLeftRight(t, rightNode, builtRightNode) // correct
compareLeftRight(t, leftleftNode, builtLeftLeftNode) // correct
compareLeftRight(t, leftrightNode, builtLeftRightNode) // correct

// Assert the leaf nodes have the correct values
require.Equal(t, leftleftNode.Value.String(), builtLeftLeftNode.Value.String(), "should be 0x4") // correct
require.Equal(t, leftrightNode.Value.String(), builtLeftRightNode.Value.String(), "should be 0x5")
require.Equal(t, rightNode.Value.String(), builtRightNode.Value.String(), "should be 0x6") // correct
require.Equal(t, leftleftNode.Value.String(), builtLeftLeftNode.Value.String(), "should be 0x4") // correct
require.Equal(t, leftrightNode.Value.String(), builtLeftRightNode.Value.String(), "should be 0x5") // correct
require.Equal(t, rightNode.Value.String(), builtRightNode.Value.String(), "should be 0x6") // correct

// Given the above two asserts pass, we should be able to reconstruct the correct commitment
reconstructedRootCommitment, err := builtTrie.Root() // Todo: need to force rehashing all nodes (since all are modified)??
Expand Down

0 comments on commit a6d8123

Please sign in to comment.