Skip to content

Add Fuel to Human config - #30

Merged
DZakh merged 11 commits into
mainfrom
dz/fuel-contract-import-2
Jun 14, 2024
Merged

Add Fuel to Human config#30
DZakh merged 11 commits into
mainfrom
dz/fuel-contract-import-2

Conversation

@DZakh

@DZakh DZakh commented Jun 13, 2024

Copy link
Copy Markdown
Member

Pretty much nothing changed. Mostly moving code around. And now it's possible to pass fuel configuration, even though it won't be able to run.

@DZakh
DZakh force-pushed the dz/fuel-contract-import-2 branch from 1f4c5ee to 77e1233 Compare June 13, 2024 12:43
@DZakh
DZakh requested a review from JonoPrest June 13, 2024 12:47
Comment on lines +28 to +30
#[serde(skip_serializing_if = "Option::is_none")]
pub fuel: Option<fuel::Config>,
}

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.

We must decide if we will allow people to have both an evm and fuel indexer simultaneously in one project. Because if not then maybe it makes more sense to have a Fuel HumanConfig and an Evm Human config and only allow one or the other.

Comment thread codegenerator/cli/src/executor/init.rs Outdated

@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.

Hey Dmitry, it looks good from a once over but maybe lets agree on what the user will be allowed to configure?

What do you think, will there be scope have fuel indexer and evm indexer in one project?

It would obviously be nice to have it side by side multichain with evm indexers but I'm not sure if this is a goal or even possible.

@github-actions

Copy link
Copy Markdown

Here's the diff of the codegen output.🙌🧠🦜

@DZakh
DZakh requested a review from JonoPrest June 14, 2024 11:57
Comment on lines +68 to +70
// clap_definitions::fuel::InitFlow::ContractImport(args) => Ecosystem::Fuel {
// init_flow: fuel_prompts::prompt_contract_import_init_flow(args)?,
// },

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.

Does this not make the match non-exhaustive? It looks like ContractImport was added to fuel init flow?

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.

I use todo! There

@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.

Ok cool, its a lot of changes but looks good to me 😄

I see that fuel::HumanConfig never gets deserialized?

So one thing you can do when you need to check for both of them is use an internally tagged enum, or just untagged enum:

https://serde.rs/enum-representations.html#internally-tagged

You can use a tag called "ecosystem" instead of having a field in the human config struct called ecosystem.

@DZakh

DZakh commented Jun 14, 2024

Copy link
Copy Markdown
Member Author

Ok cool, its a lot of changes but looks good to me 😄

I see that fuel::HumanConfig never gets deserialized?

So one thing you can do when you need to check for both of them is use an internally tagged enum, or just untagged enum:

https://serde.rs/enum-representations.html#internally-tagged

You can use a tag called "ecosystem" instead of having a field in the human config struct called ecosystem.

It's not possible to have an optional tag for evm, so I had to use the workaround with EcosystemTag. Later we'll have to use an untagged enum

@DZakh
DZakh merged commit d5b728f into main Jun 14, 2024
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