Skip to content

Commit

Permalink
feat: update to Soldeer v0.4.0 (#9014)
Browse files Browse the repository at this point in the history
* updated to version 0.4.0

* fmt and clippy

* added cargo modifications

* solving small nits

* forcing special chars on windows

* escaping special chars

* removing stderr checks

* fmt

* remvoving err assert from login
  • Loading branch information
mario-eth authored Oct 8, 2024
1 parent e215f3f commit 0b9bdf3
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 252 deletions.
92 changes: 83 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ reqwest = { version = "0.12", default-features = false }
tower = "0.4"
tower-http = "0.5"
# soldeer
soldeer = "=0.3.4"
soldeer-commands = "=0.4.0"
proptest = "1"
comfy-table = "7"

Expand Down
2 changes: 1 addition & 1 deletion crates/forge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ tower-http = { workspace = true, features = ["fs"] }
opener = "0.7"

# soldeer
soldeer.workspace = true
soldeer-commands.workspace = true
quick-junit = "0.5.0"

[target.'cfg(unix)'.dependencies]
Expand Down
21 changes: 11 additions & 10 deletions crates/forge/bin/cmd/soldeer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clap::Parser;
use eyre::Result;

use soldeer::commands::Subcommands;
use soldeer_commands::Command;

// CLI arguments for `forge soldeer`.
// The following list of commands and their actions:
Expand All @@ -22,14 +22,14 @@ use soldeer::commands::Subcommands;
override_usage = "Native Solidity Package Manager, `run forge soldeer [COMMAND] --help` for more details"
)]
pub struct SoldeerArgs {
/// Command must be one of the following install/push/login/update/version.
/// Command must be one of the following init/install/login/push/uninstall/update/version.
#[command(subcommand)]
command: Subcommands,
command: Command,
}

impl SoldeerArgs {
pub fn run(self) -> Result<()> {
match soldeer::run(self.command) {
pub async fn run(self) -> Result<()> {
match soldeer_commands::run(self.command).await {
Ok(_) => Ok(()),
Err(err) => Err(eyre::eyre!("Failed to run soldeer {}", err)),
}
Expand All @@ -38,11 +38,12 @@ impl SoldeerArgs {

#[cfg(test)]
mod tests {
use super::*;
use soldeer::commands::Version;
use soldeer_commands::{commands::Version, Command};

#[test]
fn test_soldeer_version() {
assert!(soldeer::run(Subcommands::Version(Version {})).is_ok());
#[tokio::test]
#[allow(clippy::needless_return)]
async fn test_soldeer_version() {
let command = Command::Version(Version::default());
assert!(soldeer_commands::run(command).await.is_ok());
}
}
2 changes: 1 addition & 1 deletion crates/forge/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fn main() -> Result<()> {
ForgeSubcommand::Generate(cmd) => match cmd.sub {
GenerateSubcommands::Test(cmd) => cmd.run(),
},
ForgeSubcommand::Soldeer(cmd) => cmd.run(),
ForgeSubcommand::Soldeer(cmd) => utils::block_on(cmd.run()),
ForgeSubcommand::Eip712(cmd) => cmd.run(),
ForgeSubcommand::BindJson(cmd) => cmd.run(),
}
Expand Down
Loading

0 comments on commit 0b9bdf3

Please sign in to comment.