()
| 143 | } |
| 144 | |
| 145 | func (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 | } |
no test coverage detected