Builds a tree starting from the bottom level where nodes are data nodes. Data nodes should be calculated and passed as the only level in chunk levels Each next level is calculated as following: - Pick up to maxChildNum (174) nodes until a whole level is added, group them and pass to the node in the next level - Do this until the current level has only one node, return the hash in that node
| 142 | /// - Pick up to maxChildNum (174) nodes until a whole level is added, group them and pass to the node in the next level |
| 143 | /// - Do this until the current level has only one node, return the hash in that node |
| 144 | bytes groupChunksBottomUp(Chunks _currentLevel) |
| 145 | { |
| 146 | // when we reach root it will be the only node in that level |
| 147 | while (_currentLevel.size() != 1) |
| 148 | _currentLevel = buildNextLevel(_currentLevel); |
| 149 | |
| 150 | // top level's only node stores the hash for file |
| 151 | return _currentLevel.front().hash; |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | bytes solidity::util::ipfsHash(std::string _data) |
no test coverage detected