From cc3b92a4303cc70a57b4aeb7e4eba391cd16be76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?= Date: Thu, 7 Mar 2024 14:44:25 +0100 Subject: [PATCH] fix: updated utils --- test/instance.ts | 4 +++- test/types.ts | 12 ------------ 2 files changed, 3 insertions(+), 13 deletions(-) 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;