Skip to content

Commit

Permalink
test: Reduce size of all tests running more than 20 seconds in Mjolnir
Browse files Browse the repository at this point in the history
Six property-based tests were very slow. This addresses that problem by
reducing the number of cases they verify.
  • Loading branch information
Sword-Smith committed Apr 7, 2024
1 parent 3adb021 commit ac9f61c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/models/blockchain/type_scripts/native_currency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ pub mod test {

use super::*;

#[proptest]
#[proptest(cases = 20)]
fn balanced_transaction_is_valid(
#[strategy(1usize..=3)] _num_inputs: usize,
#[strategy(1usize..=3)] _num_outputs: usize,
Expand All @@ -303,7 +303,7 @@ pub mod test {
);
}

#[proptest]
#[proptest(cases = 20)]
fn unbalanced_transaction_without_coinbase_is_invalid(
#[strategy(1usize..=3)] _num_inputs: usize,
#[strategy(1usize..=3)] _num_outputs: usize,
Expand Down Expand Up @@ -333,7 +333,7 @@ pub mod test {
);
}

#[proptest]
#[proptest(cases = 20)]
fn unbalanced_transaction_with_coinbase_is_invalid(
#[strategy(1usize..=3)] _num_inputs: usize,
#[strategy(1usize..=3)] _num_outputs: usize,
Expand Down
6 changes: 3 additions & 3 deletions src/models/blockchain/type_scripts/time_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ mod test {

use super::TimeLockWitness;

#[proptest]
#[proptest(cases = 20)]
fn test_unlocked(
#[strategy(1usize..=3)] _num_inputs: usize,
#[strategy(1usize..=3)] _num_outputs: usize,
Expand All @@ -614,7 +614,7 @@ mod test {
.as_millis() as u64
}

#[proptest]
#[proptest(cases = 20)]
fn test_locked(
#[strategy(1usize..=3)] _num_inputs: usize,
#[strategy(1usize..=3)] _num_outputs: usize,
Expand All @@ -636,7 +636,7 @@ mod test {
);
}

#[proptest]
#[proptest(cases = 20)]
fn test_released(
#[strategy(1usize..=3)] _num_inputs: usize,
#[strategy(1usize..=3)] _num_outputs: usize,
Expand Down

0 comments on commit ac9f61c

Please sign in to comment.