You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building out Scripts and Predicates using configurables, I encountered some issues with the generated types (which can be found below with examples). The following PR has the expanded example that should showcase the issue.
As part of this, we should:
Add valid typegen output for Option, Enum and Struct
Expand the example from the PR, adding all types used to the inputs of the script and predicate.
Add tests around these two script and predicate, ensuring that we can use the typegen'd resuts, pass inputs and update configurables.
// V generic is unusedexporttypeGenericEnumInput<V>=Enum<{Foo: BigNumberish}>;exporttypeGenericEnumOutput<V>=Enum<{Foo: BN}>;exporttypeAbiConfigurables=Partial<{// We don't pass in any generic type to `GenericEnumInput` so TS complainsconfigurableEnumWithGeneric: GenericEnumInput;}>
Expected
// V should extend the given type and default to the that typeexporttypeGenericEnumInput<VextendsBigNumberish=BigNumberish>=Enum<{Foo: V}>;exporttypeGenericEnumOutput<VextendsBigNumberish=BigNumberish>=Enum<{Foo: V}>;exporttypeAbiConfigurables=Partial<{configurableEnumWithGeneric: GenericEnumInput;}>
// T is used, however, we don't enforce a typeexporttypeGenericStructInput<T>={Boo: T};exporttypeGenericStructOutput<T>=GenericStructInput<T>;exporttypeAbiConfigurables=Partial<{// We don't pass in any generic type to `GenericStructInput` so TS complainsconfigurableStructWithGeneric: GenericStructInput;}>
Expected
// T should extend the given type and default to the that typeexporttypeGenericStructInput<TextendsBigNumberish=BigNumberish>={Boo: T};exporttypeGenericStructOutput<TextendsBigNumberish=BigNumberish>=GenericStructInput<T>;exporttypeAbiConfigurables=Partial<{configurableStructWithGeneric: GenericStructInput;}>
The text was updated successfully, but these errors were encountered:
Summary
When building out
Scripts
andPredicates
using configurables, I encountered some issues with the generated types (which can be found below with examples). The following PR has the expanded example that should showcase the issue.As part of this, we should:
Option
,Enum
andStruct
script
andpredicate
.script
andpredicate
, ensuring that we can use the typegen'd resuts, pass inputs and update configurables.Details
Option
Actual
Expected
Enum
Actual
Expected
Option
Actual
Expected
The text was updated successfully, but these errors were encountered: