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:
Renan Souza
2023-11-23 05:38:20 +00:00
committed by GitHub
parent 7bd2b2aaf6
commit 0950532d9a
10 changed files with 453 additions and 472 deletions

14
test/helpers/random.js Normal file
View 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,
};