-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(torii): enum support #874
Conversation
Down: (), | ||
} | ||
|
||
impl DirectionPrintImpl of PrintTrait<Direction> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, running sozo test
something is forcing debug print of all component members so needed to implement PrintTrait, otherwise can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I'll take a look at this
|
||
let position_component = world.component("Position", block_id).await.unwrap(); | ||
|
||
let position = position_component.entity(vec![account.address()], block_id).await.unwrap(); | ||
|
||
assert_eq!(position, vec![11_u8.into(), 11_u8.into()]); | ||
assert_eq!(position, vec![9_u8.into(), 9_u8.into()]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm why did this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a None
state to the Direction enum so it shifted the cmds up by one
Down: (), | ||
} | ||
|
||
impl DirectionPrintImpl of PrintTrait<Direction> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I'll take a look at this
Resolves #772
Currently, indexer can't differentiate between enums and custom type in component members, so unknown types will default to enum. Will requires a bigger followup PR to support custom types