Files
openzeppelin-contracts/scripts/generate/templates/Heap.opts.js
Hadrien Croubois 231fae33f0 Add Binary heap structure (#5084)
Co-authored-by: Ernesto García <ernestognw@gmail.com>
Co-authored-by: cairo <cairoeth@protonmail.com>
2024-07-23 11:31:26 -06:00

14 lines
343 B
JavaScript

const makeType = (valueSize, indexSize) => ({
struct: `Uint${valueSize}Heap`,
node: `Uint${valueSize}HeapNode`,
valueSize,
valueType: `uint${valueSize}`,
indexSize,
indexType: `uint${indexSize}`,
blockSize: Math.ceil((valueSize + 2 * indexSize) / 256),
});
module.exports = {
TYPES: [makeType(256, 64), makeType(208, 24)],
};