File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -13,21 +13,28 @@ import { expect } from 'chai';
1313import { BigNumber } from 'ethers' ;
1414import { ethers } from 'hardhat' ;
1515
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 ) ;
16+ const randomBytes32 = ( ) => ethers . utils . hexlify ( ethers . utils . randomBytes ( 32 ) ) ;
2517
2618const randomAddress = ( ) =>
2719 ethers . utils . getAddress ( ethers . utils . hexlify ( ethers . utils . randomBytes ( 20 ) ) ) ;
2820
2921const randomUint256 = ( ) => ethers . BigNumber . from ( ethers . utils . randomBytes ( 32 ) ) ;
3022
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+
3138// checks that the parent node is greater than or equal to the children nodes
3239function checkNodes ( nodes : string [ ] | BigNumber [ ] ) {
3340 nodes . forEach ( ( node , index ) => {
You can’t perform that action at this time.
0 commit comments