I am not being able to wrap my head around this issue in a generic way with Typescript, I would appreciate any help!
- A Factory should deploy a Contract
- A CustomFactory is a Factory and should deploy a CustomContract (that is a Contract)
- A MockFactory should be a wrapper of all this logic
Something like this would be the goal (semi pseudocode)
interface MockFactory<F extends Factory> extends F {
deploy: (...args: Parameters<F.prototype.deploy>) => MockContract<F.prototype.deploy.returnValue>
}
In order to illustrate the issue even better I created a Playground where you can see the errors