wrapper

package
v0.8.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2022 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

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

Tree returns the underlying NamespacedMerkleTree

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL