Documentation ¶
Index ¶
- type ErasuredNamespacedMerkleTree
- func (w ErasuredNamespacedMerkleTree) Constructor() rsmt2d.Tree
- func (w *ErasuredNamespacedMerkleTree) Prove(ind int) (nmt.Proof, error)
- func (w *ErasuredNamespacedMerkleTree) Push(data []byte, idx rsmt2d.SquareIndex)
- func (w *ErasuredNamespacedMerkleTree) Root() []byte
- func (w *ErasuredNamespacedMerkleTree) Tree() *nmt.NamespacedMerkleTree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErasuredNamespacedMerkleTree ¶
type ErasuredNamespacedMerkleTree struct {
// contains filtered or unexported fields
}
ErasuredNamespacedMerkleTree wraps NamespaceMerkleTree to conform to the rsmt2d.Tree interface while also providing the correct namespaces to the underlying NamespaceMerkleTree. It does this by adding the already included namespace to the first half of the tree, and then uses the parity namespace ID for each share pushed to the second half of the tree. This allows for the namespaces to be included in the erasure data, while also keeping the nmt library sufficiently general
func NewErasuredNamespacedMerkleTree ¶
func NewErasuredNamespacedMerkleTree(squareSize uint64, setters ...nmt.Option) ErasuredNamespacedMerkleTree
NewErasuredNamespacedMerkleTree issues a new ErasuredNamespacedMerkleTree. squareSize must be greater than zero
func (ErasuredNamespacedMerkleTree) Constructor ¶
func (w ErasuredNamespacedMerkleTree) Constructor() rsmt2d.Tree
Constructor acts as the rsmt2d.TreeConstructorFn for ErasuredNamespacedMerkleTree
func (*ErasuredNamespacedMerkleTree) Prove ¶
func (w *ErasuredNamespacedMerkleTree) Prove(ind int) (nmt.Proof, error)
func (*ErasuredNamespacedMerkleTree) Push ¶
func (w *ErasuredNamespacedMerkleTree) Push(data []byte, idx rsmt2d.SquareIndex)
Push adds the provided data to the underlying NamespaceMerkleTree, and automatically uses the first DefaultNamespaceIDLen number of bytes as the namespace unless the data pushed to the second half of the tree. Fulfills the rsmt.Tree interface. NOTE: panics if an error is encountered while pushing or if the tree size is exceeded.
func (*ErasuredNamespacedMerkleTree) Root ¶
func (w *ErasuredNamespacedMerkleTree) Root() []byte
Root fulfills the rsmt.Tree interface by generating and returning the underlying NamespaceMerkleTree Root.
func (*ErasuredNamespacedMerkleTree) Tree ¶
func (w *ErasuredNamespacedMerkleTree) Tree() *nmt.NamespacedMerkleTree
Tree returns the underlying NamespacedMerkleTree