runtypes
runtypes copied to clipboard
Support Optional Parameters For Contracts
Contracts do not allow variable number of parameters due to a length check which looks like it may just be to prevent an out of bounds condition in the next loop.
An implementation would allow the looping over parameters to continue past the number use at the call site, and would supply undefined
to any remaining Runtype.check()
calls
I can't imagine this would be implemented in a neat way. Could you pick some ideas how the API would look like?