From ac9f61c9129ab78fabe42e81b06b2b78171095f4 Mon Sep 17 00:00:00 2001 From: sword_smith Date: Sun, 7 Apr 2024 23:42:53 +0200 Subject: [PATCH] test: Reduce size of all tests running more than 20 seconds in Mjolnir Six property-based tests were very slow. This addresses that problem by reducing the number of cases they verify. --- src/models/blockchain/type_scripts/native_currency.rs | 6 +++--- src/models/blockchain/type_scripts/time_lock.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/models/blockchain/type_scripts/native_currency.rs b/src/models/blockchain/type_scripts/native_currency.rs index 3c2b2ff4..37b19d1f 100644 --- a/src/models/blockchain/type_scripts/native_currency.rs +++ b/src/models/blockchain/type_scripts/native_currency.rs @@ -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, @@ -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, @@ -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, diff --git a/src/models/blockchain/type_scripts/time_lock.rs b/src/models/blockchain/type_scripts/time_lock.rs index b3a20801..2bd8bb02 100644 --- a/src/models/blockchain/type_scripts/time_lock.rs +++ b/src/models/blockchain/type_scripts/time_lock.rs @@ -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, @@ -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, @@ -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,