diff --git a/CHANGELOG.md b/CHANGELOG.md index 810f82856b2e..97fff86f534e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,10 +35,13 @@ ### Removed +- [#6010](https://github.com/ChainSafe/forest/pull/6010) Removed the deprecated `forest-cli send` subcommand. Use `forest-wallet send` instead. + - [#6014](https://github.com/ChainSafe/forest/pull/6014) Removed `--unordered` from `forest-cli snapshot export`. - [#6014](https://github.com/ChainSafe/forest/pull/6014) Removed `unordered-graph-traversal` from `forest-tool benchmark`. + ### Fixed ## Forest v0.29.0 "Fëanor" diff --git a/src/cli/main.rs b/src/cli/main.rs index 598d83188274..4e4aee964916 100644 --- a/src/cli/main.rs +++ b/src/cli/main.rs @@ -40,7 +40,6 @@ where Subcommand::Mpool(cmd) => cmd.run(client).await, Subcommand::State(cmd) => cmd.run(client).await, Subcommand::Config(cmd) => cmd.run(&mut std::io::stdout()), - Subcommand::Send(cmd) => cmd.run(client).await, Subcommand::Info(cmd) => cmd.run(client).await, Subcommand::Snapshot(cmd) => cmd.run(client).await, Subcommand::Shutdown(cmd) => cmd.run(client).await, diff --git a/src/cli/subcommands/mod.rs b/src/cli/subcommands/mod.rs index 1a39dd8061e7..bbb39793a7e9 100644 --- a/src/cli/subcommands/mod.rs +++ b/src/cli/subcommands/mod.rs @@ -14,7 +14,6 @@ mod healthcheck_cmd; mod info_cmd; mod mpool_cmd; mod net_cmd; -pub(crate) mod send_cmd; mod shutdown_cmd; mod snapshot_cmd; mod state_cmd; @@ -31,9 +30,8 @@ use tracing::error; pub(super) use self::{ auth_cmd::AuthCommands, chain_cmd::ChainCommands, config_cmd::ConfigCommands, f3_cmd::F3Commands, healthcheck_cmd::HealthcheckCommand, mpool_cmd::MpoolCommands, - net_cmd::NetCommands, send_cmd::SendCommand, shutdown_cmd::ShutdownCommand, - snapshot_cmd::SnapshotCommands, state_cmd::StateCommands, sync_cmd::SyncCommands, - wait_api_cmd::WaitApiCommand, + net_cmd::NetCommands, shutdown_cmd::ShutdownCommand, snapshot_cmd::SnapshotCommands, + state_cmd::StateCommands, sync_cmd::SyncCommands, wait_api_cmd::WaitApiCommand, }; use crate::cli::subcommands::info_cmd::InfoCommand; @@ -85,9 +83,6 @@ pub enum Subcommand { #[command(subcommand)] Snapshot(SnapshotCommands), - /// Send funds between accounts - Send(SendCommand), - /// Print node info #[command(subcommand)] Info(InfoCommand), diff --git a/src/cli/subcommands/send_cmd.rs b/src/cli/subcommands/send_cmd.rs deleted file mode 100644 index cabbd3e3a358..000000000000 --- a/src/cli/subcommands/send_cmd.rs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2019-2025 ChainSafe Systems -// SPDX-License-Identifier: Apache-2.0, MIT - -use std::str::FromStr as _; - -use crate::rpc::{self, prelude::*}; -use crate::shim::address::{Address, StrictAddress}; -use crate::shim::econ::TokenAmount; -use crate::shim::message::{METHOD_SEND, Message}; -use anyhow::Context as _; -use num::Zero as _; - -use crate::cli::humantoken; - -#[derive(Debug, clap::Args)] -pub struct SendCommand { - /// optionally specify the account to send funds from (otherwise the default - /// one will be used) - #[arg(long)] - from: Option, - target_address: String, - #[arg(value_parser = humantoken::parse)] - amount: TokenAmount, - #[arg(long, value_parser = humantoken::parse, default_value_t = TokenAmount::zero())] - gas_feecap: TokenAmount, - /// In milliGas - #[arg(long, default_value_t = 0)] - gas_limit: i64, - #[arg(long, value_parser = humantoken::parse, default_value_t = TokenAmount::zero())] - gas_premium: TokenAmount, -} - -impl SendCommand { - pub async fn run(self, client: rpc::Client) -> anyhow::Result<()> { - eprintln!( - "This command has been deprecated and will be removed in the future.\n\ - Please use the 'forest-wallet' executable instead." - ); - - let from: Address = if let Some(from) = &self.from { - StrictAddress::from_str(from)?.into() - } else { - WalletDefaultAddress::call(&client, ()) - .await? - .context("No default wallet address selected. Please set a default address.")? - }; - - let message = Message { - from, - to: StrictAddress::from_str(&self.target_address)?.into(), - value: self.amount.clone(), - method_num: METHOD_SEND, - gas_limit: self.gas_limit as u64, - gas_fee_cap: self.gas_feecap.clone(), - gas_premium: self.gas_premium.clone(), - ..Default::default() - }; - - let signed_msg = MpoolPushMessage::call(&client, (message, None)).await?; - - println!("{}", signed_msg.cid()); - - Ok(()) - } -}