aave-utilities icon indicating copy to clipboard operation
aave-utilities copied to clipboard

fix: remove static interface and use emitted instead [RFC]

Open sakulstra opened this issue 3 years ago • 1 comments

tl;dr; remove statically typed interfaces as they do more harm than help

I've spend quite some time today fighting with types, and in the end it turned out the inaccurate types come from here.

In utilities we define interfaces which are implemented in classes. (In my eyes) this only makes sense when the interfaces are reused and multiple classes implement the same interface. In this case though each interface is only implemented once and in some cases they are incomplete.

This imo is a bit unreasonable and a self created maintenance burden. Instead of using the PoolInterface you can just use the emitted Pool type and instead of specifying the return type you can infer it.

setUsageAsCollateral for example does not always return a promise, but can return a promise<extendedTxn[]> or extendedTxn[]. Wdyt? Should we drop the manually maintained interfaces?

sakulstra avatar Jul 27 '22 16:07 sakulstra

❌ Something went wrong with canary release Please see logs at https://github.com/aave/aave-utilities/actions/runs/2748289776

github-actions[bot] avatar Jul 27 '22 16:07 github-actions[bot]