Skip to content

Commit

Permalink
Fix errors from merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Daksh14 committed Sep 10, 2024
1 parent b1fd0a4 commit 4de4e2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
13 changes: 7 additions & 6 deletions rusk-wallet/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,6 @@ impl<F: SecureWalletFile + Debug> Wallet<F> {
}

let state = self.state()?;

let amt = *amt;
let sender_index = addr.index()?;
let mut stake_sk = self.bls_secret_key(sender_index);
Expand All @@ -741,13 +740,14 @@ impl<F: SecureWalletFile + Debug> Wallet<F> {
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();
Expand Down Expand Up @@ -842,11 +842,12 @@ impl<F: SecureWalletFile + Debug> Wallet<F> {
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();
Expand Down
22 changes: 0 additions & 22 deletions wallet-core/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,25 +707,3 @@ fn withdraw_to_moonlight<R: RngCore + CryptoRng>(
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<R: RngCore + CryptoRng>(
rng: &mut R,
receiver_sk: &BlsSecretKey,
contract: impl Into<ContractId>,
gas_payment_token: WithdrawReplayToken,
value: u64,
) -> Withdraw {
Withdraw::new(
rng,
receiver_sk,
contract.into(),
value,
WithdrawReceiver::Moonlight(BlsPublicKey::from(receiver_sk)),
gas_payment_token,
)
}

0 comments on commit 4de4e2f

Please sign in to comment.