pokt-network / smt

A Go library that implements a Sparse Merkle Trie for a key-value map.
https://pkg.go.dev/github.com/pokt-network/smt
Other
16 stars 4 forks source link

[Enhancement] Add MerkleRoot type alias for []byte with Sum method #37

Closed h5law closed 8 months ago

h5law commented 8 months ago

Summary

Human Summary

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):

Testing

Required Checklist

If Applicable Checklist