Skip to content

Commit

Permalink
Simplify Fixture deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
cristovaoth committed Jun 3, 2024
1 parent 8e16a39 commit ecd83c1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 28 deletions.
11 changes: 3 additions & 8 deletions packages/evm/test/fixtures/MockCypherNodeRegistry.fixture.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import { ethers } from "hardhat";

import { MockCypherNodeRegistry } from "../../types/contracts/test/MockCypherNodeRegistry";
import { MockCypherNodeRegistry__factory } from "../../types/factories/contracts/test/MockCypherNodeRegistry__factory";

export async function deployMockCypherNodeRegistryFixture() {
const MockCypherNodeRegistry = (await ethers.getContractFactory(
"MockCypherNodeRegistry",
)) as MockCypherNodeRegistry__factory;
const mockCypherNodeRegistry = (await MockCypherNodeRegistry.deploy()) as MockCypherNodeRegistry;
const mockCypherNodeRegistry_address = await mockCypherNodeRegistry.getAddress();
export async function deployCypherNodeRegistryFixture() {
const deployment = await (await ethers.getContractFactory("MockCypherNodeRegistry")).deploy();

return { mockCypherNodeRegistry, mockCypherNodeRegistry_address };
return MockCypherNodeRegistry__factory.connect(await deployment.getAddress());
}
9 changes: 3 additions & 6 deletions packages/evm/test/fixtures/MockExecutionModule.fixture.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { ethers } from "hardhat";

import { MockExecutionModule } from "../../types/contracts/test/MockExecutionModule";
import { MockExecutionModule__factory } from "../../types/factories/contracts/test/MockExecutionModule__factory";

export async function deployMockExecutionModuleFixture() {
const MockExecutionModule = (await ethers.getContractFactory("MockExecutionModule")) as MockExecutionModule__factory;
const mockExecutionModule = (await MockExecutionModule.deploy()) as MockExecutionModule;
const mockExecutionModule_address = await mockExecutionModule.getAddress();
export async function deployExecutionModuleFixture() {
const deployment = await (await ethers.getContractFactory("MockExecutionModule")).deploy();

return { mockExecutionModule, mockExecutionModule_address };
return MockExecutionModule__factory.connect(await deployment.getAddress());
}
10 changes: 3 additions & 7 deletions packages/evm/test/fixtures/MockInputValidator.fixture.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { ethers } from "hardhat";

import { MockInputValidator } from "../../types/contracts/test/MockInputValidator";
import { MockInputValidator__factory } from "../../types/factories/contracts/test/MockInputValidator__factory";

export async function deployMockInputValidatorFixture() {
const MockInputValidator = (await ethers.getContractFactory("MockInputValidator")) as MockInputValidator__factory;
const mockInputValidator = (await MockInputValidator.deploy()) as MockInputValidator;
const mockInputValidator_address = await mockInputValidator.getAddress();

return { mockInputValidator, mockInputValidator_address };
export async function deployInputValidatorFixture() {
const deployment = await (await ethers.getContractFactory("MockInputValidator")).deploy();
return MockInputValidator__factory.connect(await deployment.getAddress());
}
10 changes: 3 additions & 7 deletions packages/evm/test/fixtures/MockOutputVerifier.fixture.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { ethers } from "hardhat";

import { MockOutputVerifier } from "../../types/contracts/test/MockOutputVerifier";
import { MockOutputVerifier__factory } from "../../types/factories/contracts/test/MockOutputVerifier__factory";

export async function deployMockOutputVerifierFixture() {
const MockOutputVerifier = (await ethers.getContractFactory("MockOutputVerifier")) as MockOutputVerifier__factory;
const mockOutputVerifier = (await MockOutputVerifier.deploy()) as MockOutputVerifier;
const mockOutputVerifier_address = await mockOutputVerifier.getAddress();

return { mockOutputVerifier, mockOutputVerifier_address };
export async function deployOutputVerifierFixture() {
const deployment = await (await ethers.getContractFactory("MockComputationModule")).deploy();
return MockOutputVerifier__factory.connect(await deployment.getAddress());
}

0 comments on commit ecd83c1

Please sign in to comment.