Files
openzeppelin-contracts/test/helpers/random.js
Renan Souza 0950532d9a Migrate utils-structs tests to ethersjs (#4748)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: ernestognw <ernestognw@gmail.com>
2023-11-23 05:38:20 +00:00

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,
};