Skip to content
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

feat: update to Soldeer v0.4.0 #9014

Merged
merged 10 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading