Skip to content

Commit b8657a9

Browse files
committed
Revert "initialize constants randomly"
This reverts commit 46fb72e.
1 parent 46fb72e commit b8657a9

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

test/data/BinaryHeap.ts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,21 @@ import { expect } from 'chai';
1313
import { BigNumber } from 'ethers';
1414
import { ethers } from 'hardhat';
1515

16-
const randomBytes32 = () => ethers.utils.hexlify(ethers.utils.randomBytes(32));
16+
const numbers = [0, 1, 2].map((n) => BigNumber.from(n));
17+
18+
const constants = {
19+
bytes32: numbers.map((n) => bnToBytes32(n)),
20+
address: numbers.map((n) => bnToAddress(n)),
21+
uint256: numbers,
22+
};
23+
24+
const randomBytes32 = () => ethers.utils.randomBytes(32);
1725

1826
const randomAddress = () =>
1927
ethers.utils.getAddress(ethers.utils.hexlify(ethers.utils.randomBytes(20)));
2028

2129
const randomUint256 = () => ethers.BigNumber.from(ethers.utils.randomBytes(32));
2230

23-
const constants = {
24-
bytes32: new Array(3)
25-
.fill()
26-
.map(() => randomBytes32())
27-
.sort(),
28-
address: new Array(3)
29-
.fill()
30-
.map(() => randomAddress())
31-
.sort(),
32-
uint256: new Array(3)
33-
.fill()
34-
.map(() => randomUint256())
35-
.sort(),
36-
};
37-
3831
// checks that the parent node is greater than or equal to the children nodes
3932
function checkNodes(nodes: string[] | BigNumber[]) {
4033
nodes.forEach((node, index) => {

0 commit comments

Comments
 (0)