Skip to content

Commit

Permalink
fix: allow string as abi (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
VGLoic authored Nov 14, 2022
1 parent a8990ef commit 15e4d39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
10 changes: 6 additions & 4 deletions src/testing-utils/contract-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ type ConditionCache = Record<string, MockCondition>;
type AbiType = ReadonlyArray<AbiEvent | AbiFunction | AbiError>;

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;
Expand Down
10 changes: 3 additions & 7 deletions src/testing-utils/testing-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TAbi>(this.mockManager, abi, contractAddress);
}
Expand Down

0 comments on commit 15e4d39

Please sign in to comment.