MCPcopy Create free account
hub / github.com/SmartPool/smartpool-client / AllDAGElements

Method AllDAGElements

mtree/dag_mt.go:106–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104}
105
106func (dt DagTree) AllDAGElements() []smartpool.Word {
107 if dt.finalized {
108 result := []smartpool.Word{}
109 branches := dt.Branches()
110 for _, k := range dt.Indices() {
111 // p := branches[k]
112 // fmt.Printf("Index: %d\nRawData: %s\nHashedData: %s\n", k, hex.EncodeToString(p.RawData[:]), proofs[k].HashedData.Hex())
113 result = append(result, branches[k].RawData.(smartpool.Word))
114 }
115 return result
116 }
117 panic("SP Merkle tree needs to be finalized by calling mt.Finalize()")
118}

Callers 1

DAGElementArrayMethod · 0.80

Calls 2

BranchesMethod · 0.80
IndicesMethod · 0.80

Tested by

no test coverage detected