Versions in this module Expand all Collapse all v0 v0.7.4 Jun 25, 2019 Changes in this version + var ErrDuplicateLeaf = errors.New("leaf already exists in dag") + var ErrNilDag = errors.New("dag has no root") + var ErrNilLeafContents = errors.New("nil leaf contents") + var ErrNoCommonLeaf = errors.New("no common leaf exists") + var ErrNoMatchingLeaf = errors.New("no matching leaf") + var ErrNoOnlyChild = errors.New("leaf has no only child") + var ErrNoParents = errors.New("leaf has no parents") + type Dag struct + Root *Leaf + func ImportBlockmesh(dbPath string, inflationRate float64, networkID uint) (*Dag, error) + func NewDag() *Dag + func NewDagWithRoot(root *Leaf) *Dag + func ReadDagFromMemory(network string) (*Dag, error) + func UnflattenDag(flattened *Flattened) (*Dag, error) + func (dag *Dag) AddLeaf(leaf *Leaf) error + func (dag *Dag) AddTransaction(transaction *types.Transaction) error + func (dag *Dag) Flatten() (*Flattened, error) + func (dag *Dag) MakeGenesis(config *config.ChainConfig) error + func (dag *Dag) QueryLeafWithHash(hash common.Hash) (*Leaf, error) + func (dag *Dag) QueryNextCommonLeaf(lastCommonLeaf *Leaf) (*Leaf, error) + func (dag *Dag) QueryTransactionWithHash(hash common.Hash) (*types.Transaction, error) + func (dag *Dag) QueryTransactionsWithRecipient(recipient common.Address) ([]*types.Transaction, error) + func (dag *Dag) QueryTransactionsWithSender(sender common.Address) ([]*types.Transaction, error) + func (dag *Dag) WriteToMemory(network string) error + type Flattened struct + Transactions []*types.Transaction + type Leaf struct + Children []*Leaf + Hash common.Hash + Parents []*Leaf + Transaction *types.Transaction + func NewLeaf(transaction *types.Transaction, parent *Leaf) (*Leaf, error) + func (leaf *Leaf) GetChildByHash(hash common.Hash) (*Leaf, error) + func (leaf *Leaf) GetChildren() ([]*Leaf, error) + func (leaf *Leaf) GetChildrenByRecipient(recipient common.Address) ([]*Leaf, error) + func (leaf *Leaf) GetChildrenBySender(sender common.Address) ([]*Leaf, error) + func (leaf *Leaf) GetDirectChildByHash(hash common.Hash) (*Leaf, error) + func (leaf *Leaf) GetDirectChildrenByRecipient(recipient common.Address) ([]*Leaf, error) + func (leaf *Leaf) GetDirectChildrenBySender(sender common.Address) ([]*Leaf, error) + func (leaf *Leaf) GetNextCommonLeaf() (*Leaf, error) + func (leaf *Leaf) GetOnlyChild() (*Leaf, error) + func (leaf *Leaf) IsOnlyChild() bool