From 11b83a8b83a8c4d4c5338b8a780f2fb2f1049f43 Mon Sep 17 00:00:00 2001 From: PacificYield <173040337+PacificYield@users.noreply.github.com> Date: Tue, 31 Dec 2024 14:57:48 +0100 Subject: [PATCH] test: test --- contracts/test/kmsVerifier/kmsVerifier.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/contracts/test/kmsVerifier/kmsVerifier.ts b/contracts/test/kmsVerifier/kmsVerifier.ts index 6320f82..f8e22bb 100644 --- a/contracts/test/kmsVerifier/kmsVerifier.ts +++ b/contracts/test/kmsVerifier/kmsVerifier.ts @@ -3,7 +3,6 @@ import dotenv from 'dotenv'; import fs from 'fs'; import { ethers } from 'hardhat'; -import { IInputVerifier__factory } from '../../types'; import { awaitAllDecryptionResults, initDecryptionOracle } from '../asyncDecrypt'; import { createInstances } from '../instance'; import { getSigners, initSigners } from '../signers'; @@ -101,7 +100,13 @@ describe('KMSVerifier', function () { // It should be reverted by InputVerifier with custom error 'SignerIsNotCoprocessor'. // It should fail because in this case the InputVerifier received only one KMS signature (instead of at least 2). - await expect(contract2.requestMixedBytes256(encryptedAmount2.handles[0], cheat)).to.reverted; + + const orig = dotenv.parse(fs.readFileSync('addresses/.env.inputverifier')).INPUT_VERIFIER_CONTRACT_ADDRESS; + const inputVerifier = (await ethers.getContractFactory('InputVerifier')).attach(orig); + await expect(contract2.requestMixedBytes256(encryptedAmount2.handles[0], cheat)).to.revertedWithCustomError( + inputVerifier, + 'SignerIsNotCoprocessor', + ); } process.env.NUM_KMS_SIGNERS = '4'; const encryptedAmount = await inputAlice.encrypt();