Skip to content

Commit

Permalink
Merge pull request #34 from zama-ai/fasterMockedTests
Browse files Browse the repository at this point in the history
fix: removed useless 5seconds pause in mocked mode
  • Loading branch information
jatZama authored Aug 22, 2024
2 parents e85c929 + 723908a commit 9aabf5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ 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`
await hre.run("clean");
await hre.run("compile:specific", { contract: "contracts" });
const sourceDir = path.resolve(__dirname, "node_modules/fhevm/");
const destinationDir = path.resolve(__dirname, "fhevmTemp/");
Expand All @@ -99,11 +98,10 @@ task("test", async (taskArgs, hre, runSuper) => {
fs.copyFileSync(sourceFile, destinationFile);

const targetAddress = "0x000000000000000000000000000000000000005d";
const NeverRevert = await hre.artifacts.readArtifact("MockedPrecompile");
const bytecode = NeverRevert.deployedBytecode;
const MockedPrecompile = await hre.artifacts.readArtifact("MockedPrecompile");
const bytecode = MockedPrecompile.deployedBytecode;
await hre.network.provider.send("hardhat_setCode", [targetAddress, bytecode]);
console.log(`Code of Mocked Pre-compile set at address: ${targetAddress}`);
fs.removeSync("fhevmTemp/");

const privKeyDeployer = process.env.PRIVATE_KEY_GATEWAY_DEPLOYER;
await hre.run("task:computePredeployAddress", { privateKey: privKeyDeployer });
Expand Down
2 changes: 1 addition & 1 deletion tasks/taskGatewayRelayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ task("task:launchFhevm")
const p2 = getCoin(ownerAddress);
const p3 = getCoin(relayerAddress);
await Promise.all([p1, p2, p3]);
await new Promise((res) => setTimeout(res, 5000)); // wait 5 seconds
}
}
await new Promise((res) => setTimeout(res, 5000)); // wait 5 seconds
console.log(`privateKey ${privKeyDeployer}`);
console.log(`ownerAddress ${ownerAddress}`);
await hre.run("task:deployGateway", { privateKey: privKeyDeployer, ownerAddress: ownerAddress });
Expand Down

0 comments on commit 9aabf5e

Please sign in to comment.