From d9db45a21363f9393048536777c4c63d9ccf4c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?= Date: Tue, 27 Feb 2024 19:37:55 +0100 Subject: [PATCH] fix: removed nonce manager --- pnpm-lock.yaml | 8 ++++---- test/signers.ts | 37 +++++++++++-------------------------- 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b878ee3..d3761fe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -77,8 +77,8 @@ devDependencies: specifier: 0.4.0-0 version: 0.4.0-0(hardhat@2.19.4) fhevmjs: - specifier: ^0.4.0-3 - version: 0.4.0-3 + specifier: ^0.4.0-4 + version: 0.4.0-4 fs-extra: specifier: ^10.1.0 version: 10.1.0 @@ -2818,8 +2818,8 @@ packages: - hardhat dev: true - /fhevmjs@0.4.0-3: - resolution: {integrity: sha512-7b/8OyLh0M5yzR3gxMd2ZtzM2XO4UP3zLwrGW0jtVbjSzcs8CzGiemSoRg1t5bFlFTMaigDHZNceOYrCiRCqIA==} + /fhevmjs@0.4.0-4: + resolution: {integrity: sha512-aCEtp3cNGIc8wuAaxnXaztfP6VLzIHPTFKgCT3izAaWLoo50P6xZ1okbKdeX3vT+lmOYdszwY03ICooKZO68xg==} hasBin: true dependencies: bigint-buffer: 1.1.5 diff --git a/test/signers.ts b/test/signers.ts index 6bc5773..4715592 100644 --- a/test/signers.ts +++ b/test/signers.ts @@ -1,27 +1,12 @@ -import { NonceManager } from "ethers"; +import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers"; import { ethers } from "hardhat"; -// Module augmentation to add 'address' to NonceManager -declare module "ethers" { - interface NonceManager { - address: string; - } -} - -// Extend the NonceManager prototype -Object.defineProperty(ethers.NonceManager.prototype, "address", { - get: function () { - return this.signer.address; - }, - enumerable: true, -}); - export interface Signers { - alice: NonceManager; - bob: NonceManager; - carol: NonceManager; - dave: NonceManager; - eve: NonceManager; + alice: HardhatEthersSigner; + bob: HardhatEthersSigner; + carol: HardhatEthersSigner; + dave: HardhatEthersSigner; + eve: HardhatEthersSigner; } let signers: Signers; @@ -30,11 +15,11 @@ export const initSigners = async (): Promise => { if (!signers) { const eSigners = await ethers.getSigners(); signers = { - alice: new NonceManager(eSigners[0]), - bob: new NonceManager(eSigners[1]), - carol: new NonceManager(eSigners[2]), - dave: new NonceManager(eSigners[3]), - eve: new NonceManager(eSigners[4]), + alice: eSigners[0], + bob: eSigners[1], + carol: eSigners[2], + dave: eSigners[3], + eve: eSigners[4], }; } };