Skip to content

Partial support for Fuel Bytes type - #225

Merged
DZakh merged 3 commits into
mainfrom
dz/fuel-bytes-support
Sep 24, 2024
Merged

Partial support for Fuel Bytes type#225
DZakh merged 3 commits into
mainfrom
dz/fuel-bytes-support

Conversation

@DZakh

@DZakh DZakh commented Sep 24, 2024

Copy link
Copy Markdown
Member

Treat it as unknown for now

@DZakh
DZakh requested a review from JonoPrest September 24, 2024 09:32
const bytesLogSchema = S.unknown;
AllEvents.BytesLog.handler(async ({ event }) => {
bytesLogSchema.assert(event.params)!;
expectType<AssertSchemaType<typeof event.params, typeof bytesLogSchema>>(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 JasoonS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@DZakh

DZakh commented Sep 24, 2024

Copy link
Copy Markdown
Member Author

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.

@DZakh
DZakh merged commit dabd985 into main Sep 24, 2024
@DZakh
DZakh deleted the dz/fuel-bytes-support branch September 24, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants