Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com> Co-authored-by: ernestognw <ernestognw@gmail.com>
15 lines
381 B
JavaScript
15 lines
381 B
JavaScript
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,
|
|
};
|