Prepare cli for Fuel merge to support contract import#24
Conversation
| //Allowing dead code for these implementations since they function as library methods | ||
| #[allow(dead_code)] |
There was a problem hiding this comment.
I think it's not relevant for hyperindex
| pub fn to_upper_hex_string(&self) -> String { | ||
| encode_upper_prefixed(self.0) | ||
| } | ||
|
|
||
| pub fn to_lower_hex_string(&self) -> String { | ||
| encode_prefixed(self.0) | ||
| } | ||
|
|
| @@ -0,0 +1,87 @@ | |||
| use anyhow::{Context, Error, Result}; | |||
| use ethers::{abi::AbiEncode, types::H256}; | |||
There was a problem hiding this comment.
It works like this for now, later I'll replace with a type from fuels
|
I want to keep PRs small and easy to review, so I'll work on the next part of the feature in another one. |
|
The PR doesn't include any braking changes, only internal refactoring. Can be safely merged in the v1 branch |
|
Nice Dmitry! Will look and review properly in the morning 👍🏼 |
| Fuel { | ||
| #[command(subcommand)] | ||
| init_flow: Option<FuelInitFlow>, | ||
| }, |
There was a problem hiding this comment.
Ah that's a neat trick!
|
|
||
| #[derive(Args, Debug, Default, Clone)] | ||
| pub struct LocalImportArgs { | ||
| pub struct EvmLocalImportArgs { |
There was a problem hiding this comment.
We could probably namespace these structs inside a module if we are going to add more ecosystems. All good for now to name at the type level though.
There was a problem hiding this comment.
Nice, I didn't think of it. I'll do in the next PR
| #[derive(Args, Debug, Default, Clone)] | ||
| pub struct FuelContractImportArgs { | ||
| ///Choose to import a contract from a local abi or | ||
| ///using get values from an explorer using a contract address | ||
| #[command(subcommand)] | ||
| pub local_or_explorer: Option<FuelLocalOrExplorerImport>, | ||
|
|
||
| ///Contract address to generate the config from | ||
| #[arg(global = true, short, long)] | ||
| pub contract_address: Option<fuel::address::Address>, | ||
|
|
||
| ///If selected, prompt will not ask for additional contracts/addresses/networks | ||
| #[arg(long, action)] | ||
| pub single_contract: bool, | ||
|
|
||
| ///If selected, prompt will not ask to confirm selection of events on a contract | ||
| #[arg(long, action)] | ||
| pub all_events: bool, | ||
| } |
There was a problem hiding this comment.
You don't want to make these structs generic and just change parameters?
There was a problem hiding this comment.
Maybe in the future, but currently Fuel doesn't have explorer, so it's difficult to generalize
I actually didn't plan to remove the duplicate, since these are different types. Do you think we should store both Evm and Fuel addresses in a single |
evmandfuelto store ecosystem related code