New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate initial work from fuel-core #1
Conversation
4df8a46
to
bf2a987
Compare
Co-authored-by: Brandon Kite <brandonkite92@gmail.com>
Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>
client/Cargo.toml
Outdated
@@ -0,0 +1,14 @@ | |||
[package] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use a flat cargo workspace rather than a nested crate. Otherwise publishing, lockfiles and caching etc will be more complicated.
client/src/main.rs
Outdated
}; | ||
} | ||
|
||
async fn parse_and_run_command(client: &mut Client, text: &str) -> io::Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The async-friendly shellfish crate might be a nicer alternative to the manual parsing here: https://crates.io/crates/shellfish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shellfish looks suitable. A simple google search didn't find me anything else than doing it with clap which wasn't really good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I kinda like clap. But using some lib to parse arguments seems really like the way to go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clap is really good for command line argument parsing, but doesn't allow customizing things enough to be nice for interactive CLI apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1st round of comments
client/src/main.rs
Outdated
}; | ||
} | ||
|
||
async fn parse_and_run_command(client: &mut Client, text: &str) -> io::Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I kinda like clap. But using some lib to parse arguments seems really like the way to go
Blocked by FuelLabs/fuel-core#260 |
Would it be possible to write integration tests for this CLI against fuel-core? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall; small optional style nit
return Err(Box::new(ArgError::Invalid)); | ||
}; | ||
|
||
let contract = if let Some(contract_id) = contract_id { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using combinators instead
uses: baptiste0928/cargo-install@v1 | ||
with: | ||
crate: fuel-core | ||
version: "0.8" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] consider moving "0.8" to a github env var
Nice |
Migrated from FuelLabs/fuel-core#204
As per debugger meeting on 2022-03-15, the content here is migrated to a new repo.
After this has been merged and published:
fuel-core
so the debugger can be usedfuel-debugger
to crates.io