Have typegen generate a type representation of the abi and then read it via type parameters on the appropriate classes. A typegen contract output would look like this:
Note that to 100% test these type generics we'd have to introduce type-level testing to verify that e.g. the functions on Interface<MyAbi> correspond to the passed-in MyAbi's functions, their inputs and outputs.
Alternatively, we could do type checking in our test suites and have the type checking succeeding be a proxy for verifying that the implementation is correct.
Have
typegen
generate a type representation of the abi and then read it via type parameters on the appropriate classes. A typegen contract output would look like this:The same would apply for scripts and predicates.
Note that to 100% test these type generics we'd have to introduce type-level testing to verify that e.g. the functions on
Interface<MyAbi>
correspond to the passed-inMyAbi
's functions, their inputs and outputs. Alternatively, we could do type checking in our test suites and have the type checking succeeding be a proxy for verifying that the implementation is correct.