Skip to content

Commit

Permalink
Merge pull request #3167 from dusk-network/rusk-wallet-topup
Browse files Browse the repository at this point in the history
  • Loading branch information
herr-seppia authored Dec 18, 2024
2 parents a580bfd + ab03a95 commit 88d8018
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
3 changes: 0 additions & 3 deletions rusk-wallet/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ pub enum Error {
/// Not enough gas to perform this transaction
#[error("Not enough gas to perform this transaction")]
NotEnoughGas,
/// A stake already exists for this key
#[error("A stake already exists for this key")]
AlreadyStaked,
/// A stake does not exist for this key
#[error("A stake does not exist for this key")]
NotStaked,
Expand Down
14 changes: 0 additions & 14 deletions rusk-wallet/src/wallet/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,6 @@ impl<F: SecureWalletFile + Debug> Wallet<F> {
let mut stake_sk = self.derive_bls_sk(profile_idx);

let stake_pk = self.public_key(profile_idx)?;
let current_stake = state.fetch_stake(stake_pk).await?;
if let Some(stake) = current_stake {
if stake.amount.is_some() {
return Err(Error::AlreadyStaked);
}
}

let stake_owner_idx = match self.find_stake_owner_idx(stake_pk).await {
Ok(state_idx) => {
if let Some(owner_idx) = owner_idx {
Expand Down Expand Up @@ -339,13 +332,6 @@ impl<F: SecureWalletFile + Debug> Wallet<F> {
let moonlight_current_nonce =
state.fetch_account(stake_pk).await?.nonce + 1;

let current_stake = state.fetch_stake(stake_pk).await?;
if let Some(stake) = current_stake {
if stake.amount.is_some() {
return Err(Error::AlreadyStaked);
}
}

let stake_owner_idx = match self.find_stake_owner_idx(stake_pk).await {
Ok(state_idx) => {
if let Some(owner_idx) = owner_idx {
Expand Down

0 comments on commit 88d8018

Please sign in to comment.