 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Variables
- func CalculateRoot(leafHash common.Hash, proof [types.DefaultHeight]common.Hash, index uint32) common.Hash
- type AppendOnlyTree
- type Tree
- func (t *Tree) GetLastRoot(tx db.Querier) (types.Root, error)
- func (t *Tree) GetLeaf(tx db.Querier, index uint32, root common.Hash) (common.Hash, error)
- func (t *Tree) GetProof(ctx context.Context, index uint32, root common.Hash) (types.Proof, error)
- func (t *Tree) GetRootByHash(ctx context.Context, hash common.Hash) (*types.Root, error)
- func (t *Tree) GetRootByIndex(ctx context.Context, index uint32) (types.Root, error)
- func (t *Tree) Reorg(tx db.Txer, firstReorgedBlock uint64) error
 
- type UpdatableTree
Constants ¶
This section is empty.
Variables ¶
      View Source
      
  
    var (
	EmptyProof = types.Proof{}
)
    
      View Source
      
  
var (
	ErrInvalidIndex = errors.New("invalid index")
)
    Functions ¶
Types ¶
type AppendOnlyTree ¶
type AppendOnlyTree struct {
	*Tree
	// contains filtered or unexported fields
}
    AppendOnlyTree is a tree where leaves are added sequentially (by index)
func NewAppendOnlyTree ¶
func NewAppendOnlyTree(db *sql.DB, dbPrefix string) *AppendOnlyTree
NewAppendOnlyTree creates a AppendOnlyTree
type Tree ¶
type Tree struct {
	// contains filtered or unexported fields
}
    func (*Tree) GetLastRoot ¶
GetLastRoot returns the last processed root
func (*Tree) GetRootByHash ¶
GetRootByHash returns the root associated to the hash
func (*Tree) GetRootByIndex ¶
GetRootByIndex returns the root associated to the index
type UpdatableTree ¶
type UpdatableTree struct {
	*Tree
}
    UpdatableTree is a tree that have updatable leaves, and doesn't need to have sequential inserts
func NewUpdatableTree ¶
func NewUpdatableTree(db *sql.DB, dbPrefix string) *UpdatableTree
NewUpdatableTree returns an UpdatableTree
 Click to show internal directories. 
   Click to hide internal directories.