use proptest::prelude::*;
use super::{Network, NetworkUpgrade};
impl NetworkUpgrade {
pub fn branch_id_strategy() -> BoxedStrategy<NetworkUpgrade> {
prop_oneof![
Just(NetworkUpgrade::Overwinter),
Just(NetworkUpgrade::Sapling),
Just(NetworkUpgrade::Blossom),
Just(NetworkUpgrade::Heartwood),
Just(NetworkUpgrade::Canopy),
Just(NetworkUpgrade::Nu5),
]
.boxed()
}
pub fn reduced_branch_id_strategy() -> BoxedStrategy<NetworkUpgrade> {
prop_oneof![
Just(NetworkUpgrade::Overwinter),
Just(NetworkUpgrade::Sapling),
Just(NetworkUpgrade::Blossom),
Just(NetworkUpgrade::Heartwood),
]
.boxed()
}
}
impl Arbitrary for Network {
type Parameters = ();
fn arbitrary_with(_args: ()) -> Self::Strategy {
prop_oneof![Just(Self::Mainnet), Just(Self::new_default_testnet())].boxed()
}
type Strategy = BoxedStrategy<Self>;
}