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

Method HashBranchArray

mtree/aug_mt.go:145–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143}
144
145func (amt AugTree) HashBranchArray() []*big.Int {
146 if amt.finalized {
147 result := []*big.Int{}
148 branches := amt.Branches()
149 var node AugData
150 for _, k := range amt.Indices() {
151 nodes := branches[k].ToNodeArray()[1:]
152 for _, n := range nodes {
153 node = n.(AugData)
154 be := smartpool.BranchElement{}
155 copy(be[:], msbPadding(node.Hash[:], 32))
156 result = append(result, be.Big())
157 }
158 }
159 return result
160 }
161 panic("SP Merkle tree needs to be finalized by calling mt.Finalize()")
162}

Callers 1

HashBranchMethod · 0.80

Calls 5

BigMethod · 0.95
msbPaddingFunction · 0.85
BranchesMethod · 0.80
IndicesMethod · 0.80
ToNodeArrayMethod · 0.45

Tested by

no test coverage detected