From 15e4d39fe176d4034703fbbf56c32094e6d90ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Vincent-Genod?= <37535451+VGLoic@users.noreply.github.com> Date: Mon, 14 Nov 2022 19:07:44 +0100 Subject: [PATCH] fix: allow string as abi (#57) --- src/testing-utils/contract-utils.ts | 10 ++++++---- src/testing-utils/testing-utils.ts | 10 +++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/testing-utils/contract-utils.ts b/src/testing-utils/contract-utils.ts index 05e4b74..9706173 100644 --- a/src/testing-utils/contract-utils.ts +++ b/src/testing-utils/contract-utils.ts @@ -32,10 +32,12 @@ type ConditionCache = Record; type AbiType = ReadonlyArray; export class ContractUtils< - TAbi extends readonly ( - | (JsonFragment | Fragment) - | (AbiEvent | AbiFunction | AbiError) - )[] + TAbi extends + | string + | readonly ( + | (JsonFragment | Fragment) + | (AbiEvent | AbiFunction | AbiError) + )[] > { private mockManager: MockManager; private contractInterface: Interface; diff --git a/src/testing-utils/testing-utils.ts b/src/testing-utils/testing-utils.ts index bffc98c..8e0bbb8 100644 --- a/src/testing-utils/testing-utils.ts +++ b/src/testing-utils/testing-utils.ts @@ -341,13 +341,9 @@ export class TestingUtils { * ``` */ public generateContractUtils< - TAbi extends readonly ( - | Fragment - | JsonFragment - | AbiEvent - | AbiFunction - | AbiError - )[] + TAbi extends + | string + | readonly (Fragment | JsonFragment | AbiEvent | AbiFunction | AbiError)[] >(abi: TAbi, contractAddress?: string) { return new ContractUtils(this.mockManager, abi, contractAddress); }