From 1765e62aa4b2ad6d404a65681e3d4cd175aecbca Mon Sep 17 00:00:00 2001 From: Daksh <41485688+Daksh14@users.noreply.github.com> Date: Mon, 9 Sep 2024 12:39:41 -0400 Subject: [PATCH] test-wallet: fix imports --- rusk-wallet/src/bin/command.rs | 66 ------------------------------ rusk-wallet/src/bin/interactive.rs | 43 ------------------- test-wallet/src/imp.rs | 5 +-- wallet-core/src/phoenix.rs | 3 +- 4 files changed, 3 insertions(+), 114 deletions(-) diff --git a/rusk-wallet/src/bin/command.rs b/rusk-wallet/src/bin/command.rs index b786f4c503..1c8e39d2d2 100644 --- a/rusk-wallet/src/bin/command.rs +++ b/rusk-wallet/src/bin/command.rs @@ -145,25 +145,6 @@ pub(crate) enum Command { gas_price: Lux, }, - /// Start staking DUSK through moonlight - MoonlightStake { - /// Bls Address from which to stake DUSK [default: first address] - #[clap(short = 's', long)] - addr: Option
, - - /// Amount of DUSK to stake - #[clap(short, long)] - amt: Dusk, - - /// Max amt of gas for this transaction - #[clap(short = 'l', long, default_value_t= DEFAULT_STAKE_GAS_LIMIT)] - gas_limit: u64, - - /// Price you're going to pay for each gas unit (in LUX) - #[clap(short = 'p', long, default_value_t= DEFAULT_PRICE)] - gas_price: Lux, - }, - /// Check your stake information StakeInfo { /// Address used to stake [default: first address] @@ -191,22 +172,6 @@ pub(crate) enum Command { gas_price: Lux, }, - /// Moonlight Unstake a key's stake - MoonlightUnstake { - /// Bls Address from which your DUSK was staked [default: first - /// address] - #[clap(short, long)] - addr: Option, - - /// Max amt of gas for this transaction - #[clap(short = 'l', long, default_value_t= DEFAULT_STAKE_GAS_LIMIT)] - gas_limit: u64, - - /// Price you're going to pay for each gas unit (in LUX) - #[clap(short = 'p', long, default_value_t= DEFAULT_PRICE)] - gas_price: Lux, - }, - /// Phoenix Withdraw accumulated reward for a stake key PhoenixWithdraw { /// Phoenix Address from which your DUSK was staked [default: first @@ -346,23 +311,6 @@ impl Command { let tx = wallet.phoenix_stake(addr, amt, gas).await?; Ok(RunResult::Tx(tx.hash())) } - Command::MoonlightStake { - addr, - amt, - gas_limit, - gas_price, - } => { - let addr = match addr { - Some(addr) => wallet.claim_as_address(addr)?, - None => wallet.default_address(), - }; - - let gas = Gas::new(gas_limit).with_price(gas_price); - - let tx = wallet.moonlight_stake(addr, amt, gas)?; - - Ok(RunResult::Tx(tx.hash())) - } Command::StakeInfo { addr, reward } => { let addr = match addr { Some(addr) => wallet.claim_as_address(addr)?, @@ -391,20 +339,6 @@ impl Command { let tx = wallet.phoenix_unstake(addr, gas).await?; Ok(RunResult::Tx(tx.hash())) } - Command::MoonlightUnstake { - addr, - gas_limit, - gas_price, - } => { - let addr = match addr { - Some(addr) => wallet.claim_as_address(addr)?, - None => wallet.default_address(), - }; - let gas = Gas::new(gas_limit).with_price(gas_price); - let tx = wallet.moonlight_unstake(addr, gas).await?; - - Ok(RunResult::Tx(tx.hash())) - } Command::PhoenixWithdraw { addr, gas_limit, diff --git a/rusk-wallet/src/bin/interactive.rs b/rusk-wallet/src/bin/interactive.rs index b5da824575..a6befe3ab0 100644 --- a/rusk-wallet/src/bin/interactive.rs +++ b/rusk-wallet/src/bin/interactive.rs @@ -210,10 +210,8 @@ enum CommandMenuItem { PhoenixTransfer, MoonlightTransfer, PhoenixStake, - MoonlightStake, StakeInfo, PhoenixUnstake, - MoonlightUnstake, PhoenixWithdraw, Export, Back, @@ -233,10 +231,8 @@ fn menu_op( .add(CMI::PhoenixTransfer, "Phoenix Transfer Dusk") .add(CMI::MoonlightTransfer, "Moonlight Transfer Dusk") .add(CMI::PhoenixStake, "Phoenix Stake Dusk") - .add(CMI::MoonlightStake, "Moonlight Stake Dusk") .add(CMI::StakeInfo, "Check existing stake") .add(CMI::PhoenixUnstake, "Phoenix Unstake Dusk") - .add(CMI::MoonlightUnstake, "Moonlight Unstake Dusk") .add(CMI::PhoenixWithdraw, "Phoenix Withdraw staking reward") .add(CMI::Export, "Export provisioner key-pair") .separator() @@ -278,12 +274,6 @@ fn menu_op( gas_limit: prompt::request_gas_limit(DEFAULT_STAKE_GAS_LIMIT)?, gas_price: prompt::request_gas_price()?, })), - CMI::MoonlightStake => AddrOp::Run(Box::new(Command::MoonlightStake { - addr: Some(addr), - amt: prompt::request_token_amt("stake", balance)?, - gas_limit: prompt::request_gas_limit(DEFAULT_STAKE_GAS_LIMIT)?, - gas_price: prompt::request_gas_price()?, - })), CMI::StakeInfo => AddrOp::Run(Box::new(Command::StakeInfo { addr: Some(addr), reward: false, @@ -293,13 +283,6 @@ fn menu_op( gas_limit: prompt::request_gas_limit(DEFAULT_STAKE_GAS_LIMIT)?, gas_price: prompt::request_gas_price()?, })), - CMI::MoonlightUnstake => { - AddrOp::Run(Box::new(Command::MoonlightUnstake { - addr: Some(addr), - gas_limit: prompt::request_gas_limit(DEFAULT_STAKE_GAS_LIMIT)?, - gas_price: prompt::request_gas_price()?, - })) - } CMI::PhoenixWithdraw => { AddrOp::Run(Box::new(Command::PhoenixWithdraw { addr: Some(addr), @@ -518,20 +501,6 @@ fn confirm(cmd: &Command) -> anyhow::Result