Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nu6 #1502

Merged
merged 3 commits into from
Nov 14, 2024
Merged

Nu6 #1502

Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions libtonode-tests/tests/concrete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(&regtest_manager, &lightclient, 12)
increase_height_and_wait_for_client(&regtest_manager, &lightclient, 14)
.await
.unwrap();
}
Expand Down Expand Up @@ -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(&regtest_manager, &lightclient, 12)
increase_height_and_wait_for_client(&regtest_manager, &lightclient, 14)
.await
.unwrap();
}
Expand Down Expand Up @@ -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,
Expand Down
26 changes: 21 additions & 5 deletions zingolib/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -616,21 +617,30 @@ impl RegtestNetwork {
heartwood_activation_height,
canopy_activation_height,
orchard_activation_height,
nu6_activation_height,
),
}
}

/// 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,
),
}
}

Expand Down Expand Up @@ -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),
),
}
}
}
Expand All @@ -675,6 +688,7 @@ pub struct ActivationHeights {
heartwood: BlockHeight,
canopy: BlockHeight,
orchard: BlockHeight,
nu6: BlockHeight,
}

impl ActivationHeights {
Expand All @@ -686,6 +700,7 @@ impl ActivationHeights {
heartwood: u64,
canopy: u64,
orchard: u64,
nu6: u64,
) -> Self {
Self {
overwinter: BlockHeight::from_u32(overwinter as u32),
Expand All @@ -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),
}
}

Expand All @@ -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,
}
}
}
2 changes: 1 addition & 1 deletion zingolib/src/testutils/regtest/conf/zcash.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion zingolib/src/testvectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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,
Expand All @@ -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:
Expand Down
Loading