func buildTestDag(r io.Reader, ds merkledag.DAGService, spl chunk.BlockSplitter) (*merkledag.Node, error) { // Start the splitter blkch := spl.Split(r) dbp := h.DagBuilderParams{ Dagserv: ds, Maxlinks: h.DefaultLinksPerBlock, } return BalancedLayout(dbp.New(blkch)) }
func BuildTrickleDagFromReader(r io.Reader, ds dag.DAGService, spl chunk.BlockSplitter, ncb h.NodeCB) (*dag.Node, error) { // Start the splitter blkch := spl.Split(r) dbp := h.DagBuilderParams{ Dagserv: ds, Maxlinks: h.DefaultLinksPerBlock, NodeCB: ncb, } return trickle.TrickleLayout(dbp.New(blkch)) }
func buildTestDag(r io.Reader, ds merkledag.DAGService, spl chunk.BlockSplitter) (*merkledag.Node, error) { // Start the splitter blkch := spl.Split(r) dbp := h.DagBuilderParams{ Dagserv: ds, Maxlinks: h.DefaultLinksPerBlock, } nd, err := TrickleLayout(dbp.New(blkch)) if err != nil { return nil, err } return nd, VerifyTrickleDagStructure(nd, ds, dbp.Maxlinks, layerRepeat) }