diff --git a/test/instance.ts b/test/instance.ts index fccac88..4f1a98f 100644 --- a/test/instance.ts +++ b/test/instance.ts @@ -54,6 +54,8 @@ export const createInstance = async (contractAddress: string, account: Signer, e const instance = await fhevmjs.createInstance({ chainId, publicKey }); if (HARDHAT_NETWORK === "hardhat") { + instance.encryptBool = createUintToUint8ArrayFunction(1); + instance.encrypt4 = createUintToUint8ArrayFunction(4); instance.encrypt8 = createUintToUint8ArrayFunction(8); instance.encrypt16 = createUintToUint8ArrayFunction(16); instance.encrypt32 = createUintToUint8ArrayFunction(32); @@ -81,7 +83,7 @@ const generatePublicKey = async (contractAddress: string, signer: Signer, instan function createUintToUint8ArrayFunction(numBits: number) { const numBytes = Math.ceil(numBits / 8); - return function (uint: number | bigint) { + return function (uint: number | bigint | boolean) { const buffer = toBufferBE(BigInt(uint), numBytes); return buffer; }; diff --git a/test/types.ts b/test/types.ts index 849116d..1e13854 100644 --- a/test/types.ts +++ b/test/types.ts @@ -1,17 +1,5 @@ import type { FhevmInstance } from "fhevmjs"; -import { ConfidentialERC20 } from "../types"; -import type { Signers } from "./signers"; - -declare module "mocha" { - export interface Context { - signers: Signers; - contractAddress: string; - instances: FhevmInstances; - erc20: ConfidentialERC20; - } -} - export interface FhevmInstances { alice: FhevmInstance; bob: FhevmInstance;