Skip to content

Commit

Permalink
test: adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
PacificYield committed Dec 31, 2024
1 parent 9c3f173 commit 82d8f8f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions contracts/test/kmsVerifier/kmsVerifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ 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 @@ -97,9 +98,10 @@ describe('KMSVerifier', function () {
// different format of inputProof for native
const cheatInputProof = encryptedAmount2.inputProof + encryptedAmount2.inputProof.slice(-130); // trying to cheat by repeating the first kms signer signature
const cheat = cheatInputProof.slice(0, 5) + '2' + cheatInputProof.slice(6);
await expect(contract2.requestMixedBytes256(encryptedAmount2.handles[0], cheat)).to.revertedWith(
'Not enough unique KMS input signatures',
); // this should fail because in this case the InputVerifier received only one KMS signature (instead of at least 2)

// 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;
}
process.env.NUM_KMS_SIGNERS = '4';
const encryptedAmount = await inputAlice.encrypt();
Expand Down

0 comments on commit 82d8f8f

Please sign in to comment.