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
// Type definition for `tournament::ls15_components::models::tournament::GatedEntryType` enum
export enum GatedEntryType {
criteria,
uniform,
}
Expected
// Type definition for `tournament::ls15_components::models::tournament::GatedEntryType` enum
export type GatedEntryType = {
criteria: EntryCriteria[];
uniform: number;
};
export type GatedEntryTypeEnum = TypedCairoEnum<GatedEntryType>;
Fieldorder
It seems the new RemoveFieldOrder doesn't account for field orders in some of the new types. I have extended the removal to these in my implementation.
Before
type RemoveFieldOrder<T> = T extends object
? Omit<
{
[K in keyof T]: T[K] extends object ? RemoveFieldOrder<T[K]> : T[K];
},
'fieldOrder'
>
: T;
After
type RemoveFieldOrder<T> = T extends object
? T extends CairoOption<infer U>
? CairoOption<RemoveFieldOrder<U>>
: T extends CairoCustomEnum
? T
: Omit<
{
[K in keyof T]: T[K] extends object ? RemoveFieldOrder<T[K]> : T[K];
},
"fieldOrder"
>
: T;
Since removing the field orders for nested types is quite messy, perhaps we could do the reverse and add the field orders only for the model schemas as suggested here #2748 (comment)
The text was updated successfully, but these errors were encountered:
Describe the bug
Some issues remaining in the typescript bindings on the back of CairoOption and CustomEnum PR.
To Reproduce
or find the file here:
CairoOption
contracts.gen.ts
referencesCairoOption
in the models file, rather than using the starknet import.GatedType
is not being referenced in the model file.Cairo Options aren't defined properly in the schema.
I have defined them as so (still questioning exactly how this would relate to the torii types as they are different)
CustomEnum
Not being defined properly in the schema.
I have defined as
Some custom enums aren't being defined properly
Expected
Fieldorder
It seems the new
RemoveFieldOrder
doesn't account for field orders in some of the new types. I have extended the removal to these in my implementation.Before
After
Since removing the field orders for nested types is quite messy, perhaps we could do the reverse and add the field orders only for the model schemas as suggested here #2748 (comment)
The text was updated successfully, but these errors were encountered: