diff --git a/libtonode-tests/tests/concrete.rs b/libtonode-tests/tests/concrete.rs index 797b795bc..3432c7e9a 100644 --- a/libtonode-tests/tests/concrete.rs +++ b/libtonode-tests/tests/concrete.rs @@ -561,10 +561,10 @@ mod fast { #[tokio::test] async fn sync_all_epochs_from_sapling() { - let regtest_network = RegtestNetwork::new(1, 1, 3, 5, 7, 9); + let regtest_network = RegtestNetwork::new(1, 1, 3, 5, 7, 9, 11); let (regtest_manager, _cph, lightclient) = scenarios::unfunded_client(regtest_network).await; - increase_height_and_wait_for_client(®test_manager, &lightclient, 12) + increase_height_and_wait_for_client(®test_manager, &lightclient, 14) .await .unwrap(); } @@ -616,10 +616,10 @@ mod fast { #[ignore] #[tokio::test] async fn sync_all_epochs() { - let regtest_network = RegtestNetwork::new(1, 3, 5, 7, 9, 11); + let regtest_network = RegtestNetwork::new(1, 3, 5, 7, 9, 11, 13); let (regtest_manager, _cph, lightclient) = scenarios::unfunded_client(regtest_network).await; - increase_height_and_wait_for_client(®test_manager, &lightclient, 12) + increase_height_and_wait_for_client(®test_manager, &lightclient, 14) .await .unwrap(); } @@ -1656,7 +1656,7 @@ mod slow { } #[tokio::test] async fn send_heartwood_sapling_funds() { - let regtest_network = RegtestNetwork::new(1, 1, 1, 1, 3, 5); + let regtest_network = RegtestNetwork::new(1, 1, 1, 1, 3, 5, 5); let (regtest_manager, _cph, faucet, recipient) = scenarios::faucet_recipient( PoolType::Shielded(ShieldedProtocol::Sapling), regtest_network, diff --git a/libtonode-tests/tests/wallet.rs b/libtonode-tests/tests/wallet.rs index 3c3f81944..08af61128 100644 --- a/libtonode-tests/tests/wallet.rs +++ b/libtonode-tests/tests/wallet.rs @@ -21,7 +21,7 @@ mod load_wallet { #[tokio::test] async fn load_old_wallet_at_reorged_height() { - let regtest_network = RegtestNetwork::all_upgrades_active(); + let regtest_network = RegtestNetwork::new(1, 1, 1, 1, 1, 1, 200); let (ref regtest_manager, cph, ref faucet) = scenarios::faucet( PoolType::Shielded(ShieldedProtocol::Orchard), regtest_network, diff --git a/zingolib/src/config.rs b/zingolib/src/config.rs index d41093b11..f2ead353e 100644 --- a/zingolib/src/config.rs +++ b/zingolib/src/config.rs @@ -607,6 +607,7 @@ impl RegtestNetwork { heartwood_activation_height: u64, canopy_activation_height: u64, orchard_activation_height: u64, + nu6_activation_height: u64, ) -> Self { Self { activation_heights: ActivationHeights::new( @@ -616,6 +617,7 @@ impl RegtestNetwork { heartwood_activation_height, canopy_activation_height, orchard_activation_height, + nu6_activation_height, ), } } @@ -623,14 +625,22 @@ impl RegtestNetwork { /// TODO: Add Doc Comment Here! pub fn all_upgrades_active() -> Self { Self { - activation_heights: ActivationHeights::new(1, 1, 1, 1, 1, 1), + activation_heights: ActivationHeights::new(1, 1, 1, 1, 1, 1, 1), } } /// TODO: Add Doc Comment Here! - pub fn set_orchard(orchard_activation_height: u64) -> Self { + pub fn set_orchard_and_nu6(custom_activation_height: u64) -> Self { Self { - activation_heights: ActivationHeights::new(1, 1, 1, 1, 1, orchard_activation_height), + activation_heights: ActivationHeights::new( + 1, + 1, + 1, + 1, + 1, + custom_activation_height, + custom_activation_height, + ), } } @@ -661,7 +671,10 @@ impl RegtestNetwork { self.activation_heights .get_activation_height(NetworkUpgrade::Nu5), ), - NetworkUpgrade::Nu6 => None, + NetworkUpgrade::Nu6 => Some( + self.activation_heights + .get_activation_height(NetworkUpgrade::Nu6), + ), } } } @@ -675,6 +688,7 @@ pub struct ActivationHeights { heartwood: BlockHeight, canopy: BlockHeight, orchard: BlockHeight, + nu6: BlockHeight, } impl ActivationHeights { @@ -686,6 +700,7 @@ impl ActivationHeights { heartwood: u64, canopy: u64, orchard: u64, + nu6: u64, ) -> Self { Self { overwinter: BlockHeight::from_u32(overwinter as u32), @@ -694,6 +709,7 @@ impl ActivationHeights { heartwood: BlockHeight::from_u32(heartwood as u32), canopy: BlockHeight::from_u32(canopy as u32), orchard: BlockHeight::from_u32(orchard as u32), + nu6: BlockHeight::from_u32(nu6 as u32), } } @@ -706,7 +722,7 @@ impl ActivationHeights { NetworkUpgrade::Heartwood => self.heartwood, NetworkUpgrade::Canopy => self.canopy, NetworkUpgrade::Nu5 => self.orchard, - NetworkUpgrade::Nu6 => todo!(), + NetworkUpgrade::Nu6 => self.nu6, } } } diff --git a/zingolib/src/testutils/regtest/conf/zcash.conf b/zingolib/src/testutils/regtest/conf/zcash.conf index 463d73aa0..169658563 100644 --- a/zingolib/src/testutils/regtest/conf/zcash.conf +++ b/zingolib/src/testutils/regtest/conf/zcash.conf @@ -6,7 +6,7 @@ nuparams=2bb40e60:1 # Blossom nuparams=f5b9230b:1 # Heartwood nuparams=e9ff75a6:1 # Canopy nuparams=c2d6d0b4:1 # NU5 - +nuparams=c8e71055:1 # NU6 txindex=1 insightexplorer=1 experimentalfeatures=1 diff --git a/zingolib/src/testvectors.rs b/zingolib/src/testvectors.rs index 03b4ec5c6..32a12691d 100644 --- a/zingolib/src/testvectors.rs +++ b/zingolib/src/testvectors.rs @@ -90,6 +90,9 @@ pub mod config_template_fillers { let orchard_activation_height = regtest_network .activation_height(NetworkUpgrade::Nu5) .unwrap(); + let nu6_activation_height = regtest_network + .activation_height(NetworkUpgrade::Nu6) + .unwrap(); format!("\ ### Blockchain Configuration @@ -100,6 +103,7 @@ nuparams=2bb40e60:{blossom_activation_height} # Blossom nuparams=f5b9230b:{heartwood_activation_height} # Heartwood nuparams=e9ff75a6:{canopy_activation_height} # Canopy nuparams=c2d6d0b4:{orchard_activation_height} # NU5 (Orchard) +nuparams=c8e71055:{nu6_activation_height} # NU6 ### MetaData Storage and Retrieval # txindex: @@ -142,7 +146,7 @@ minetolocalwallet=0 # This is set to false so that we can mine to a wallet, othe #[test] fn funded_zcashd_conf() { - let regtest_network = crate::config::RegtestNetwork::new(1, 2, 3, 4, 5, 6); + let regtest_network = crate::config::RegtestNetwork::new(1, 2, 3, 4, 5, 6, 7); assert_eq!( funded( super::super::REG_Z_ADDR_FROM_ABANDONART, @@ -158,6 +162,7 @@ nuparams=2bb40e60:3 # Blossom nuparams=f5b9230b:4 # Heartwood nuparams=e9ff75a6:5 # Canopy nuparams=c2d6d0b4:6 # NU5 (Orchard) +nuparams=c8e71055:7 # NU6 ### MetaData Storage and Retrieval # txindex: