Documentation ¶
Index ¶
- type SparseMerkleTree
- func (smt *SparseMerkleTree) CreateDefaultNodes(depth int64) [][]byte
- func (smt *SparseMerkleTree) CreateMerkleProof(leafId uint64) []byte
- func (smt *SparseMerkleTree) CreateTree(orderedLeaves *ordered_map.OrderedMap, depth int64, defaultNodes [][]byte) []*ordered_map.OrderedMap
- func (smt *SparseMerkleTree) Depth() int64
- func (smt *SparseMerkleTree) Leaves() *ordered_map.OrderedMap
- func (smt *SparseMerkleTree) Root() []byte
- func (smt *SparseMerkleTree) Verify(leafId uint64, proof []byte) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SparseMerkleTree ¶
type SparseMerkleTree struct {
// contains filtered or unexported fields
}
func NewSparseMerkleTree ¶
func NewSparseMerkleTree(depth int64, leaves map[uint64][]byte) (*SparseMerkleTree, error)
func (*SparseMerkleTree) CreateDefaultNodes ¶
func (smt *SparseMerkleTree) CreateDefaultNodes(depth int64) [][]byte
func (*SparseMerkleTree) CreateMerkleProof ¶
func (smt *SparseMerkleTree) CreateMerkleProof(leafId uint64) []byte
CreateMerkleProof generates a merkle proof for a leaf.
func (*SparseMerkleTree) CreateTree ¶
func (smt *SparseMerkleTree) CreateTree(orderedLeaves *ordered_map.OrderedMap, depth int64, defaultNodes [][]byte) []*ordered_map.OrderedMap
func (*SparseMerkleTree) Depth ¶
func (smt *SparseMerkleTree) Depth() int64
func (*SparseMerkleTree) Leaves ¶
func (smt *SparseMerkleTree) Leaves() *ordered_map.OrderedMap
func (*SparseMerkleTree) Root ¶
func (smt *SparseMerkleTree) Root() []byte
Click to show internal directories.
Click to hide internal directories.