Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultHeight uint8 = 32
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FullTreer ¶
type FullTreer interface {
ReadTreer
LeafWriter
ReorganizeTreer
}
FullTreer = fully-capable tree (read, write, reorg)
type LeafWriter ¶
type LeafWriter interface {
PutLeaf(tx dbtypes.Txer, blockNum, blockPosition uint64, leaf Leaf) (common.Hash, error)
}
LeafWriter provides write access to a Merkle tree.
type Proof ¶
type Proof [DefaultHeight]common.Hash
func NewProof ¶
func NewProof(proofRaw [DefaultHeight][common.HashLength]byte) Proof
NewProof creates a proof from an array of hashes
type ReadTreer ¶
type ReadTreer interface {
GetRootByIndex(ctx context.Context, index uint32) (Root, error)
GetRootByHash(ctx context.Context, hash common.Hash) (*Root, error)
GetLastRoot(tx dbtypes.Querier) (Root, error)
GetLeaf(tx dbtypes.Querier, index uint32, root common.Hash) (common.Hash, error)
GetProof(ctx context.Context, index uint32, root common.Hash) (Proof, error)
}
ReadTreer provides read-only access to a Merkle tree.
type ReorganizeTreer ¶
ReorganizeTreer provides reorg handling for a Merkle tree.
Click to show internal directories.
Click to hide internal directories.