Skip to content

Commit

Permalink
chore: updated networks in hardhat config
Browse files Browse the repository at this point in the history
  • Loading branch information
jatZama committed Nov 29, 2024
1 parent a4e087d commit a5590a3
Showing 1 changed file with 8 additions and 40 deletions.
48 changes: 8 additions & 40 deletions contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ function getChainConfig(chain: keyof typeof chainIds): NetworkUserConfig {
case 'sepolia':
jsonRpcUrl = process.env.SEPOLIA_RPC_URL!;
break;
case 'localCoprocessor':
jsonRpcUrl = 'http://localhost:8745';
break;
case 'localNative':
jsonRpcUrl = 'http://localhost:8545';
break;
default:
throw new Error(`unsupported chain: ${chain}`);
}
Expand All @@ -67,46 +73,6 @@ function getChainConfig(chain: keyof typeof chainIds): NetworkUserConfig {
};
}

task('coverage').setAction(async (taskArgs, hre, runSuper) => {
hre.config.networks.hardhat.allowUnlimitedContractSize = true;
hre.config.networks.hardhat.blockGasLimit = 1099511627775;

await runSuper(taskArgs);
});

task('test', async (taskArgs, hre, runSuper) => {
// Run modified test task
if (hre.network.name === 'hardhat') {
// in fhevm mode all this block is done when launching the node via `pnmp fhevm:start`
const privKeyGatewayDeployer = process.env.PRIVATE_KEY_GATEWAY_DEPLOYER;
const privKeyFhevmDeployer = process.env.PRIVATE_KEY_FHEVM_DEPLOYER;
await hre.run('task:computeGatewayAddress', { privateKey: privKeyGatewayDeployer });
await hre.run('task:computeACLAddress', { privateKey: privKeyFhevmDeployer });
await hre.run('task:computeTFHEExecutorAddress', { privateKey: privKeyFhevmDeployer });
await hre.run('task:computeKMSVerifierAddress', { privateKey: privKeyFhevmDeployer });
await hre.run('task:computeInputVerifierAddress', { privateKey: privKeyFhevmDeployer, useAddress: false });
await hre.run('task:computeFHEPaymentAddress', { privateKey: privKeyFhevmDeployer });
await hre.run('compile:specific', { contract: 'contracts' });
await hre.run('compile:specific', { contract: 'lib' });
await hre.run('compile:specific', { contract: 'gateway' });
await hre.run('compile:specific', { contract: 'payment' });
await hre.run('task:faucetToPrivate', { privateKey: privKeyFhevmDeployer });
await hre.run('task:deployACL', { privateKey: privKeyFhevmDeployer });
await hre.run('task:deployTFHEExecutor', { privateKey: privKeyFhevmDeployer });
await hre.run('task:deployKMSVerifier', { privateKey: privKeyFhevmDeployer });
await hre.run('task:deployInputVerifier', { privateKey: privKeyFhevmDeployer });
await hre.run('task:deployFHEPayment', { privateKey: privKeyFhevmDeployer });
await hre.run('task:addSigners', {
numSigners: process.env.NUM_KMS_SIGNERS!,
privateKey: privKeyFhevmDeployer,
useAddress: false,
});
await hre.run('task:launchFhevm', { skipGetCoin: false, useAddress: false });
}
await hre.run('compile:specific', { contract: 'examples' });
await runSuper();
});

const config: HardhatUserConfig = {
defaultNetwork: 'sepolia',
namedAccounts: {
Expand All @@ -130,6 +96,8 @@ const config: HardhatUserConfig = {
},
},
sepolia: getChainConfig('sepolia'),
localNative: getChainConfig('localNative'),
localCoprocessor: getChainConfig('localCoprocessor'),
},
paths: {
artifacts: './artifacts',
Expand Down

0 comments on commit a5590a3

Please sign in to comment.