Partial support for Fuel Bytes type - #225
Conversation
| const bytesLogSchema = S.unknown; | ||
| AllEvents.BytesLog.handler(async ({ event }) => { | ||
| bytesLogSchema.assert(event.params)!; | ||
| expectType<AssertSchemaType<typeof event.params, typeof bytesLogSchema>>( |
There was a problem hiding this comment.
I think I need a little bit more explanation on this. So it's seen as an unknown type.
Does that mean it's the data exactly raw as is from the chain and it's up to the user to parse this type into whatever they want?
There was a problem hiding this comment.
Does that mean it's the data exactly raw as is from the chain and it's up to the user to parse this type into whatever they want?
Yes
JasoonS
left a comment
There was a problem hiding this comment.
If I understand this change correctly, it doesn't change any functionality. It just explicitly marks the type of the data to unknown. And then the user can do whatever they want with that data, but we don't pause it for them.
Yes, previously it was treated as an object with some weird fields, which wasn't correct and broke codegen for schemas. In this version, we still don't have an exact type for bytes, but at least it's not lying. |
Treat it as unknown for now