Skip to content

Fuel merge part 8 - It runs 馃帀 - #186

Merged
DZakh merged 16 commits into
mainfrom
dz/fuel-merge-7
Sep 11, 2024
Merged

Fuel merge part 8 - It runs 馃帀#186
DZakh merged 16 commits into
mainfrom
dz/fuel-merge-7

Conversation

@DZakh

@DZakh DZakh commented Sep 9, 2024

Copy link
Copy Markdown
Member
image


format!(
"let abi = %raw(`null`)\n{}\n{}",
"let abi = Fuel.transpileAbi(%raw(`require(\"../../{}\")`))\n{}\n{}",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm always nervous to see hardcoded relative paths. Should this not take some sort of parameter that's been parsed. Like generated relative path?

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.

Let's fix it when we have a case when it breaks.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm pretty sure even our integration tests would have this case.

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.

This is how indexer-fuel works. I'll cut the corner here, to make it work and then fix some of the issues. I already have 4 similar things on my list

Comment thread codegenerator/cli/src/rescript_types.rs Outdated
Comment thread codegenerator/cli/src/rescript_types.rs Outdated
.to_rescript_schema(),
"S.object(s => {fieldA: s.field(\"fieldA\", S.int), fieldB: s.field(\"fieldB\", \
.to_rescript_schema(&"eventArgs".to_string()),
"S.object((s): eventArgs => {fieldA: s.field(\"fieldA\", S.int), fieldB: s.field(\"fieldB\", \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is the error you get if you don't have the type annotation? Does rescript not infer the type if it's in the same scope?

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.

There are cases when there are multiple types with the same shape, and ReScript doesn't know which one to use

Comment on lines +62 to +67
{{#if is_evm_ecosystem}} {{!-- TODO: Add validation for Fuel --}}
// Even though it's the Address.t type on ReScript side, for TS side it's a string.
// So we need to ensure that it's a valid checksummed address.
let contractAddress = contractAddress->Address.Evm.fromAddressOrThrow

{{/if}}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Will you add a similar sanitisation function for fuel

@DZakh DZakh Sep 11, 2024

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.

Yes, I'll add it in the next PR

@DZakh

DZakh commented Sep 11, 2024

Copy link
Copy Markdown
Member Author

Thanks for the review. I've fixed the code comments, and I'll do other fixes in the next PR

@DZakh
DZakh requested a review from JonoPrest September 11, 2024 11:46

@JonoPrest JonoPrest left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Cool, looks good Dmitry although I don't think the paths are handled properly for referencing the abi file. I would prefer we handle it rather than wait for it to come up.

@DZakh
DZakh merged commit 57aaa6d into main Sep 11, 2024
@DZakh
DZakh deleted the dz/fuel-merge-7 branch September 11, 2024 12:24
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