diff --git a/packages/evm/test/Enclave.spec.ts b/packages/evm/test/Enclave.spec.ts index 07d46851..c4078fe2 100644 --- a/packages/evm/test/Enclave.spec.ts +++ b/packages/evm/test/Enclave.spec.ts @@ -588,7 +588,35 @@ describe("Enclave", function () { await enclave.setCyphernodeRegistry(prevRegistry); await expect(enclave.activate(0)).to.not.be.reverted; }); - it("sets committeePublicKey correctly"); + it("sets committeePublicKey correctly", async () => { + const { + enclave, + request, + mocks: { registry }, + } = await loadFixture(setup); + + await enclave.request( + request.pool, + request.threshold, + request.duration, + request.computationModule, + request.cMParams, + request.executionModule, + request.eMParams, + { value: 10 }, + ); + + const e3Id = 0; + const publicKey = await registry.getCommitteePublicKey(e3Id); + + let e3 = await enclave.getE3(e3Id); + expect(e3.committeePublicKey).to.not.equal(publicKey); + + await enclave.activate(e3Id); + + e3 = await enclave.getE3(e3Id); + expect(e3.committeePublicKey).to.equal(publicKey); + }); it("returns true if E3 is activated successfully"); it("emits E3Activated event"); }); diff --git a/packages/evm/test/fixtures/MockCyphernodeRegistry.fixture.ts b/packages/evm/test/fixtures/MockCyphernodeRegistry.fixture.ts index 73d87fbe..99b317df 100644 --- a/packages/evm/test/fixtures/MockCyphernodeRegistry.fixture.ts +++ b/packages/evm/test/fixtures/MockCyphernodeRegistry.fixture.ts @@ -3,7 +3,8 @@ import { ethers } from "hardhat"; import { MockCyphernodeRegistry__factory } from "../../types"; export async function deployCyphernodeRegistryFixture(name?: string) { + const [signer] = await ethers.getSigners(); const deployment = await (await ethers.getContractFactory(name || "MockCyphernodeRegistry")).deploy(); - return MockCyphernodeRegistry__factory.connect(await deployment.getAddress()); + return MockCyphernodeRegistry__factory.connect(await deployment.getAddress(), signer.provider); }