-
Notifications
You must be signed in to change notification settings - Fork 279
Open
Description
I'm working with a piece of code that tries to impersonate an account on mainnet, and it works fine in a normal Hardhat test. However, when I run it with solidity-coverage, it fails with the error ProviderError: Unknown account 0xx.
Here's my Hardhat configuration setup:
hardhat: {
chainId: 31337,
live: false,
tags: ['test', 'local'],
hardfork: HARDFORK,
blockGasLimit: BigNumber.from(10).pow(15).toNumber(),
// gas: DEFAULT_BLOCK_GAS_LIMIT,
throwOnTransactionFailures: true,
throwOnCallFailures: true,
forking: {
enabled: FORKING_ENABLED,
url: `https://eth-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_KEY}`,
blockNumber: 22016809,
},
allowUnlimitedContractSize: true,
allowBlocksWithSameTimestamp: false,
gasPrice: 2228078444,
accounts: [
{
privateKey: DEPLOYER_PRIVATE_KEY,
balance: DEFAULT_ACCOUNT_BALANCE,
},
...Array.from({ length: 10 }, () => {
const wallet = Wallet.createRandom();
return {
privateKey: wallet.privateKey,
balance: DEFAULT_ACCOUNT_BALANCE,
};
}),
],
And this's my command for running coverage script: COVERAGE=true npx hardhat coverage
. Are there any ways to workaround this one ?
Metadata
Metadata
Assignees
Labels
No labels