Skip to content

Commit

Permalink
test: test
Browse files Browse the repository at this point in the history
  • Loading branch information
PacificYield committed Dec 31, 2024
1 parent 82d8f8f commit 11b83a8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions contracts/test/kmsVerifier/kmsVerifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 11b83a8

Please sign in to comment.