Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommytrg committed Oct 11, 2023
1 parent ca50c33 commit f725b5f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
14 changes: 1 addition & 13 deletions data_structures/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,6 @@ pub enum TransactionError {
display = "Stake weight ({}) exceeds the limit ({})",
weight, max_weight
)]
StakeWeightLimitExceeded { weight: u32, max_weight: u32 },
#[fail(
display = "Minimum stake ({}) not reached ({})",
min_stake,
stake
)]
MinStakeNotReached {
min_stake: u32,
stake: u64,
Expand Down Expand Up @@ -423,13 +417,7 @@ pub enum BlockError {
weight, max_weight
)]
TotalStakeWeightLimitExceeded { weight: u32, max_weight: u32 },
/// Stake number limit exceeded
#[fail(
display = "Total number of Stake Transactions in a block ({}) exceeds the limit ({})",
stakes, max_stakes
)]
TotalStakeNumberLimitExceeded { stakes: usize, max_stakes: u16 },
/// Repeated operator Stake
/// Repeated operator Stake
#[fail(display = "A single operator is staking more than once: ({}) ", pkh)]
RepeatedStakeOperator { pkh: Hash },
/// Missing expected tallies
Expand Down
8 changes: 0 additions & 8 deletions validations/src/validations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,14 +1124,6 @@ pub fn validate_stake_transaction<'a>(
signatures_to_verify: &mut Vec<SignaturesToVerify>,
) -> Result<(Vec<&'a Input>, &'a StakeOutput, u64, u32, &'a Option<ValueTransferOutput>), failure::Error> {

if st_tx.weight() > MAX_STAKE_BLOCK_WEIGHT {
return Err(TransactionError::StakeWeightLimitExceeded {
weight: st_tx.weight(),
max_weight: MAX_STAKE_BLOCK_WEIGHT,
}
.into());
}

// TODO: validate the stake is greater than the min stake: 10_000_000_000_000

if st_tx.body.output.value < MINIMUM_STAKE_NANOWITS.into() {
Expand Down

0 comments on commit f725b5f

Please sign in to comment.