diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index e6d814b3..481a7996 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -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}`); } @@ -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: { @@ -130,6 +96,8 @@ const config: HardhatUserConfig = { }, }, sepolia: getChainConfig('sepolia'), + localNative: getChainConfig('localNative'), + localCoprocessor: getChainConfig('localCoprocessor'), }, paths: { artifacts: './artifacts',