Add contract function hints to the MockContract.mock object
This change is backwards compatible as it uses an optional generic, that is by default set to BaseContract, which contains a mapped object functions: { [ name: string ]: ... }; that provides the same namespace.
I've been using this already with this ambient type declaration
declare type BaseContract = import('ethers').BaseContract
declare type _MockContract = import('ethereum-waffle').MockContract
declare type Stub = import('ethereum-waffle').Stub
interface MockContract<T extends BaseContract = BaseContract> extends _MockContract {
mock: {
[key in keyof T['functions']]: Stub
}
}

🦋 Changeset detected
Latest commit: 1c279645e17d5548899cc599cd95ee9d5929466e
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 2 packages
| Name | Type |
|---|---|
| @ethereum-waffle/mock-contract | Patch |
| ethereum-waffle | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Dang, I put that commit message there by mistake. I thought it was the PR text. You can amend my commit and remove it if you want.
@ackvf We have some build errors, did you take a look at those?
@rzadp I didn't see this before. I will look at it.