File tree Expand file tree Collapse file tree 1 file changed +9
-16
lines changed Expand file tree Collapse file tree 1 file changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -13,28 +13,21 @@ import { expect } from 'chai';
1313import { BigNumber } from 'ethers' ;
1414import { 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
1826const randomAddress = ( ) =>
1927 ethers . utils . getAddress ( ethers . utils . hexlify ( ethers . utils . randomBytes ( 20 ) ) ) ;
2028
2129const 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
3932function checkNodes ( nodes : string [ ] | BigNumber [ ] ) {
4033 nodes . forEach ( ( node , index ) => {
You can’t perform that action at this time.
0 commit comments