Add Fuel to Human config - #30
Conversation
1f4c5ee to
77e1233
Compare
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub fuel: Option<fuel::Config>, | ||
| } |
There was a problem hiding this comment.
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.
JonoPrest
left a comment
There was a problem hiding this comment.
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.
|
Here's the diff of the codegen output.🙌🧠🦜 |
| // clap_definitions::fuel::InitFlow::ContractImport(args) => Ecosystem::Fuel { | ||
| // init_flow: fuel_prompts::prompt_contract_import_init_flow(args)?, | ||
| // }, |
There was a problem hiding this comment.
Does this not make the match non-exhaustive? It looks like ContractImport was added to fuel init flow?
JonoPrest
left a comment
There was a problem hiding this comment.
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 |
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.