Add Sum(bool) method to the type to get the sum from the trie
AI Summary
Summary generated by Reviewpad on 09 Jan 24 20:24 UTC
This pull request includes changes to the documentation files merkle-sum-trie.md and smt.md, as well as the test file root_test.go, the code file smst.go, and the types file types.go.
The changes to the documentation files add a new section called "Roots" that explains the root of the tree and provides helper functions for interacting with the root.
The changes to the test file add tests for the MerkleRoot type and the Sum() function.
The changes to the code file add a new method Root() that returns the root hash of the trie as a MerkleRoot type.
The changes to the types file add a new type MerkleRoot that is a byte slice representing the root hash, and a Sum() method for computing the sum of the root hash.
Issue
N/A
Type of change
Please mark the relevant option(s):
[x] New feature, functionality or library
[ ] Bug fix
[ ] Code health or cleanup
[ ] Documentation
[ ] Other (specify)
Testing
[x] Run all unit tests: make test_all
[ ] Run all/relevant benchmarks (if optimising): make benchmark_{all | suite name}
Required Checklist
[x] I have tested my changes using the available tooling
Summary
Human Summary
MerkleRoot
[]byte
aliasSum(bool)
method to the type to get the sum from the trieAI Summary
Summary generated by Reviewpad on 09 Jan 24 20:24 UTC
This pull request includes changes to the documentation files
merkle-sum-trie.md
andsmt.md
, as well as the test fileroot_test.go
, the code filesmst.go
, and the types filetypes.go
.The changes to the documentation files add a new section called "Roots" that explains the root of the tree and provides helper functions for interacting with the root.
The changes to the test file add tests for the
MerkleRoot
type and theSum()
function.The changes to the code file add a new method
Root()
that returns the root hash of the trie as aMerkleRoot
type.The changes to the types file add a new type
MerkleRoot
that is a byte slice representing the root hash, and aSum()
method for computing the sum of the root hash.Issue
N/A
Type of change
Please mark the relevant option(s):
Testing
make test_all
make benchmark_{all | suite name}
Required Checklist
godoc
format comments see: tip.golang.org/doc/comment)If Applicable Checklist