Skip to content

Commit

Permalink
rusk-wallet:s
Browse files Browse the repository at this point in the history
  • Loading branch information
Daksh14 committed Jan 31, 2025
1 parent 55f6a2e commit 3ff836d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
3 changes: 2 additions & 1 deletion rusk-wallet/src/bin/interactive/command_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use rusk_wallet::gas::{
};
use rusk_wallet::{
Address, Error, Wallet, MAX_CONTRACT_INIT_ARG_SIZE, MAX_FUNCTION_NAME_SIZE,
MIN_CONVERTIBLE,
};

use super::ProfileOp;
Expand Down Expand Up @@ -179,7 +180,7 @@ pub(crate) async fn online(

// if the user has stake then they are performing a topup
if has_stake {
1
MIN_CONVERTIBLE
} else {
DEFAULT_MINIMUM_STAKE
}
Expand Down
17 changes: 0 additions & 17 deletions rusk-wallet/src/wallet/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,21 +734,4 @@ impl<F: SecureWalletFile + Debug> Wallet<F> {
StakeFundOwner::Contract(_) => Err(Error::Unauthorized),
}
}

/// Return true if the stake amount currently exists
/// or if the user has staked some amount
pub async fn check_stake_exists(
&self,
stake_pk: &BlsPublicKey,
) -> Result<bool, Error> {
let stake = self.state()?.fetch_stake(stake_pk).await?;

let exists = if let Some(stake) = stake {
stake.amount.is_some()
} else {
false
};

Ok(exists)
}
}

0 comments on commit 3ff836d

Please sign in to comment.