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

Method CounterBranchArray

mtree/aug_mt.go:126–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124}
125
126func (amt AugTree) CounterBranchArray() []*big.Int {
127 if amt.finalized {
128 result := []*big.Int{}
129 branches := amt.Branches()
130 var node AugData
131 for _, k := range amt.Indices() {
132 nodes := branches[k].ToNodeArray()[1:]
133 for _, n := range nodes {
134 node = n.(AugData)
135 be := smartpool.BranchElement{}
136 copy(be[:], node.CounterBytes())
137 result = append(result, be.Big())
138 }
139 }
140 return result
141 }
142 panic("SP Merkle tree needs to be finalized by calling mt.Finalize()")
143}
144
145func (amt AugTree) HashBranchArray() []*big.Int {
146 if amt.finalized {

Callers 1

CounterBranchMethod · 0.80

Calls 5

CounterBytesMethod · 0.95
BigMethod · 0.95
BranchesMethod · 0.80
IndicesMethod · 0.80
ToNodeArrayMethod · 0.45

Tested by

no test coverage detected