Migrate utils-structs tests to ethersjs (#4748)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com> Co-authored-by: ernestognw <ernestognw@gmail.com>
This commit is contained in:
14
test/helpers/random.js
Normal file
14
test/helpers/random.js
Normal file
@ -0,0 +1,14 @@
|
||||
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,
|
||||
};
|
||||
Reference in New Issue
Block a user