You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
381 B
15 lines
381 B
1 year ago
|
const { ethers } = require('hardhat');
|
||
|
|
||
|
const randomArray = (generator, arrayLength = 3) => Array(arrayLength).fill().map(generator);
|
||
|
|
||
|
const generators = {
|
||
|
address: () => ethers.Wallet.createRandom().address,
|
||
|
bytes32: () => ethers.hexlify(ethers.randomBytes(32)),
|
||
|
uint256: () => ethers.toBigInt(ethers.randomBytes(32)),
|
||
|
};
|
||
|
|
||
|
module.exports = {
|
||
|
randomArray,
|
||
|
generators,
|
||
|
};
|