diff --git a/rusk-wallet/src/wallet.rs b/rusk-wallet/src/wallet.rs index 471aff2a60..f41dfa62fe 100644 --- a/rusk-wallet/src/wallet.rs +++ b/rusk-wallet/src/wallet.rs @@ -730,7 +730,6 @@ impl Wallet { } let state = self.state()?; - let amt = *amt; let sender_index = addr.index()?; let mut stake_sk = self.bls_secret_key(sender_index); @@ -741,13 +740,14 @@ impl Wallet { let nonce = state.fetch_stake(&pk)?.map(|s| s.nonce).unwrap_or(0); let stake = moonlight_stake( + &stake_sk, &stake_sk, amt, - chain_id, - nonce, - account.nonce, gas.limit, gas.price, + account.nonce, + nonce, + chain_id, )?; stake_sk.zeroize(); @@ -842,11 +842,12 @@ impl Wallet { let unstake = moonlight_unstake( &mut rng, &stake_sk, + &stake_sk, unstake_value, - chain_id, - account.nonce + 1, gas.price, gas.limit, + account.nonce + 1, + chain_id, )?; stake_sk.zeroize(); diff --git a/wallet-core/src/transaction.rs b/wallet-core/src/transaction.rs index b91d3b197a..de9378f5a3 100644 --- a/wallet-core/src/transaction.rs +++ b/wallet-core/src/transaction.rs @@ -707,25 +707,3 @@ fn withdraw_to_moonlight( gas_payment_token, ) } - -/// Create a [`Withdraw`] struct to be used to withdraw funds from a contract -/// into a Moonlight account. -/// -/// The gas payment can be done by either Phoenix or Moonlight by setting the -/// `gas_payment_token` accordingly. -fn withdraw_to_moonlight( - rng: &mut R, - receiver_sk: &BlsSecretKey, - contract: impl Into, - gas_payment_token: WithdrawReplayToken, - value: u64, -) -> Withdraw { - Withdraw::new( - rng, - receiver_sk, - contract.into(), - value, - WithdrawReceiver::Moonlight(BlsPublicKey::from(receiver_sk)), - gas_payment_token, - ) -}