diff --git a/Cargo.lock b/Cargo.lock index ad3f2aa..fd05bbe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,12 +39,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - [[package]] name = "amplify" version = "4.9.0" @@ -405,15 +399,10 @@ dependencies = [ "bitvec", "blake2s_simd", "byteorder", - "crossbeam-channel", "ff", "group", - "lazy_static", - "log", - "num_cpus", "pairing", "rand_core 0.6.4", - "rayon", "subtle", ] @@ -455,16 +444,6 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" -[[package]] -name = "bitflags-serde-legacy" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b64e60c28b6d25ad92e8b367801ff9aa12b41d05fc8798055d296bace4a60cc" -dependencies = [ - "bitflags 2.10.0", - "serde", -] - [[package]] name = "bitvec" version = "1.0.1" @@ -547,7 +526,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09dc0086e469182132244e9b8d313a0742e1132da43a08c24b9dd3c18e0faf3a" dependencies = [ - "serde", "thiserror 2.0.17", ] @@ -584,12 +562,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" -[[package]] -name = "byte-slice-cast" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" - [[package]] name = "bytemuck" version = "1.24.0" @@ -800,26 +772,6 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "const_format" -version = "0.2.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - [[package]] name = "constant_time_eq" version = "0.4.2" @@ -1031,7 +983,6 @@ dependencies = [ "digest 0.10.7", "fiat-crypto", "rustc_version", - "serde", "subtle", "zeroize", ] @@ -1186,17 +1137,6 @@ dependencies = [ "void", ] -[[package]] -name = "derive-getters" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74ef43543e701c01ad77d3a5922755c6a1d71b22d942cb8042be4994b380caff" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.114", -] - [[package]] name = "derive_builder_core_fork_arti" version = "0.11.2" @@ -1383,7 +1323,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8", - "serde", "signature", ] @@ -1403,23 +1342,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ed25519-zebra" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0017d969298eec91e3db7a2985a8cab4df6341d86e6f3a6f5878b13fb7846bc9" -dependencies = [ - "curve25519-dalek", - "ed25519", - "hashbrown 0.15.5", - "pkcs8", - "rand_core 0.6.4", - "serde", - "sha2 0.10.9", - "subtle", - "zeroize", -] - [[package]] name = "educe" version = "0.4.23" @@ -1496,7 +1418,6 @@ checksum = "ca4f333d4ccc9d23c06593733673026efa71a332e028b00f12cf427b9677dce9" dependencies = [ "blake2b_simd", "core2", - "document-features", ] [[package]] @@ -1601,18 +1522,6 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db" -[[package]] -name = "fixed-hash" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" -dependencies = [ - "byteorder", - "rand 0.8.5", - "rustc-hex", - "static_assertions", -] - [[package]] name = "fixedbitset" version = "0.5.7" @@ -1913,7 +1822,7 @@ dependencies = [ "rand 0.8.5", "sinsemilla", "subtle", - "uint 0.9.5", + "uint", ] [[package]] @@ -1963,8 +1872,6 @@ version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "allocator-api2", - "equivalent", "foldhash", ] @@ -1989,20 +1896,11 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" - [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -dependencies = [ - "serde", -] [[package]] name = "hkdf" @@ -2212,26 +2110,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "impl-codec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.114", -] - [[package]] name = "incrementalmerkletree" version = "0.8.2" @@ -2500,7 +2378,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" dependencies = [ "cfg-if", - "rayon", ] [[package]] @@ -2701,16 +2578,6 @@ dependencies = [ "libm", ] -[[package]] -name = "num_cpus" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "num_enum" version = "0.7.5" @@ -2891,34 +2758,6 @@ dependencies = [ "group", ] -[[package]] -name = "parity-scale-codec" -version = "3.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" -dependencies = [ - "arrayvec", - "bitvec", - "byte-slice-cast", - "const_format", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "rustversion", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "3.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.114", -] - [[package]] name = "parking" version = "2.2.1" @@ -3185,17 +3024,6 @@ dependencies = [ "elliptic-curve", ] -[[package]] -name = "primitive-types" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" -dependencies = [ - "fixed-hash", - "impl-codec", - "uint 0.9.5", -] - [[package]] name = "priority-queue" version = "2.7.0" @@ -3456,7 +3284,6 @@ checksum = "89b0ac1bc6bb3696d2c6f52cff8fba57238b81da8c0214ee6cd146eb8fde364e" dependencies = [ "rand_core 0.6.4", "reddsa", - "serde", "thiserror 1.0.69", "zeroize", ] @@ -3634,12 +3461,6 @@ dependencies = [ "serde", ] -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - [[package]] name = "rustc_version" version = "0.4.1" @@ -3859,7 +3680,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" dependencies = [ "secp256k1-sys", - "serde", ] [[package]] @@ -3919,15 +3739,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-big-array" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" -dependencies = [ - "serde", -] - [[package]] name = "serde-value" version = "0.7.0" @@ -5782,18 +5593,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "uint" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - [[package]] name = "uncased" version = "0.9.10" @@ -6475,17 +6274,6 @@ dependencies = [ "nonempty", ] -[[package]] -name = "zcash_history" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fde17bf53792f9c756b313730da14880257d7661b5bfc69d0571c3a7c11a76d" -dependencies = [ - "blake2b_simd", - "byteorder", - "primitive-types", -] - [[package]] name = "zcash_keys" version = "0.12.0" @@ -6635,66 +6423,6 @@ dependencies = [ "zip32", ] -[[package]] -name = "zebra-chain" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c1b579eb4d25214fa15839a74f4b9599806bc8addb910cfbec50dd59fb97f" -dependencies = [ - "bech32", - "bitflags 2.10.0", - "bitflags-serde-legacy", - "bitvec", - "blake2b_simd", - "blake2s_simd", - "bounded-vec", - "bs58", - "byteorder", - "chrono", - "derive-getters", - "dirs", - "ed25519-zebra", - "equihash", - "futures", - "group", - "halo2_proofs", - "hex", - "humantime", - "incrementalmerkletree", - "itertools 0.14.0", - "jubjub", - "lazy_static", - "num-integer", - "orchard", - "primitive-types", - "rand_core 0.6.4", - "rayon", - "reddsa", - "redjubjub", - "ripemd 0.1.3", - "sapling-crypto", - "secp256k1", - "serde", - "serde-big-array", - "serde_with", - "sha2 0.10.9", - "sinsemilla", - "static_assertions", - "tempfile", - "thiserror 2.0.17", - "tracing", - "uint 0.10.0", - "x25519-dalek", - "zcash_address", - "zcash_encoding", - "zcash_history", - "zcash_note_encryption", - "zcash_primitives", - "zcash_protocol", - "zcash_script", - "zcash_transparent", -] - [[package]] name = "zerocopy" version = "0.8.33" @@ -6772,9 +6500,6 @@ dependencies = [ [[package]] name = "zingo_common_components" version = "0.2.0" -dependencies = [ - "zebra-chain", -] [[package]] name = "zip32" diff --git a/Cargo.toml b/Cargo.toml index 65c3f72..17d1e2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,9 +4,6 @@ resolver = "2" [workspace.dependencies] -# content -zebra-chain = "5.0" - # network http = "1.1.0" http-body = "1" @@ -21,5 +18,5 @@ tonic = { version = "0.14", features = [ tower = { version = "0.5" } webpki-roots = "0.25" -# exceptions +# error thiserror = "1.0.64" diff --git a/CHANGELOG.md b/zingo-netutils/CHANGELOG.md similarity index 83% rename from CHANGELOG.md rename to zingo-netutils/CHANGELOG.md index 723314c..e7a4222 100644 --- a/CHANGELOG.md +++ b/zingo-netutils/CHANGELOG.md @@ -13,21 +13,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -### Removed - -## [0.2.0] - 2026-02-12 - -### Deprecated - -### Added - -### Changed - - Support for Zebra 4.1.0 through `zebra-chain = "5.0"` - Bump `tonic` from `0.13` to `0.14`, with `tls-webpki-roots` enabled. ### Removed -## [0.1.0] +## [1.1.0] NOT PUBLISHED diff --git a/zingo-netutils/Cargo.toml b/zingo-netutils/Cargo.toml index 19d5354..47c11d0 100644 --- a/zingo-netutils/Cargo.toml +++ b/zingo-netutils/Cargo.toml @@ -21,7 +21,7 @@ thiserror.workspace = true tokio-rustls.workspace = true tonic.workspace = true tower.workspace = true -webpki-roots = "0.25" +webpki-roots.workspace = true zcash_client_backend = { version = "0.21", features = [ "lightwalletd-tonic", diff --git a/zingo_common_components/CHANGELOG.md b/zingo_common_components/CHANGELOG.md new file mode 100644 index 0000000..ada2f4f --- /dev/null +++ b/zingo_common_components/CHANGELOG.md @@ -0,0 +1,39 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Deprecated + +### Added + +- `protocol::NetworkType`: replaces zebra-chain `NetworkKind` type. +- `protocol::ActivationHeights`: replaces zebra-chain `ConfiguredActivationHeights` type. +- `protocol::ActivationHeightsBuilder` + +### Changed + +### Removed + +- `protocol::activation_heights` mod and `for_test` child module: results in removal of zebra-chain dependency. + +## [0.2.0] - 2026-02-12 + +### Deprecated + +### Added + +### Changed + +- Support for Zebra 4.1.0 through `zebra-chain = "5.0"` +- Bump `tonic` from `0.13` to `0.14`, with `tls-webpki-roots` enabled. + +### Removed + +## [0.1.0] + +NOT PUBLISHED diff --git a/zingo_common_components/Cargo.toml b/zingo_common_components/Cargo.toml index 861b104..930db27 100644 --- a/zingo_common_components/Cargo.toml +++ b/zingo_common_components/Cargo.toml @@ -8,8 +8,5 @@ repository = "https://github.com/zingolabs/zingo-common.git" version = "0.2.0" edition = "2024" license = "MIT" -[features] -for_test = [] [dependencies] -zebra-chain = { workspace = true } diff --git a/zingo_common_components/src/lib.rs b/zingo_common_components/src/lib.rs index 1b800ec..d993aba 100644 --- a/zingo_common_components/src/lib.rs +++ b/zingo_common_components/src/lib.rs @@ -1 +1,8 @@ +//! Crate for common types used by zingolabs crates. +//! +//! Types in this crate are intended to be suitable for use in the public API of other crates so must only include types +//! that have a stable public API that will only increase major semver version in rare cases. + +#![warn(missing_docs)] + pub mod protocol; diff --git a/zingo_common_components/src/protocol.rs b/zingo_common_components/src/protocol.rs index a660f32..5933e3c 100644 --- a/zingo_common_components/src/protocol.rs +++ b/zingo_common_components/src/protocol.rs @@ -1 +1,245 @@ -pub mod activation_heights; +//! Module for types associated with the zcash protocol and consensus. + +/// Network types. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum NetworkType { + /// Mainnet + Mainnet, + /// Testnet + Testnet, + /// Regtest + Regtest(ActivationHeights), +} + +impl std::fmt::Display for NetworkType { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let chain = match self { + NetworkType::Mainnet => "mainnet", + NetworkType::Testnet => "testnet", + NetworkType::Regtest(_) => "regtest", + }; + write!(f, "{chain}") + } +} + +/// Network upgrade activation heights for custom testnet and regtest network configuration. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct ActivationHeights { + overwinter: Option, + sapling: Option, + blossom: Option, + heartwood: Option, + canopy: Option, + nu5: Option, + nu6: Option, + nu6_1: Option, + nu7: Option, +} + +impl Default for ActivationHeights { + fn default() -> Self { + Self::builder() + .set_overwinter(Some(1)) + .set_sapling(Some(1)) + .set_blossom(Some(1)) + .set_heartwood(Some(1)) + .set_canopy(Some(1)) + .set_nu5(Some(1)) + .set_nu6(Some(1)) + .set_nu6_1(Some(1)) + .set_nu7(None) + .build() + } +} + +impl ActivationHeights { + /// Constructs new builder. + pub fn builder() -> ActivationHeightsBuilder { + ActivationHeightsBuilder::new() + } + + /// Returns overwinter network upgrade activation height. + pub fn overwinter(&self) -> Option { + self.overwinter + } + + /// Returns sapling network upgrade activation height. + pub fn sapling(&self) -> Option { + self.sapling + } + + /// Returns blossom network upgrade activation height. + pub fn blossom(&self) -> Option { + self.blossom + } + + /// Returns heartwood network upgrade activation height. + pub fn heartwood(&self) -> Option { + self.heartwood + } + + /// Returns canopy network upgrade activation height. + pub fn canopy(&self) -> Option { + self.canopy + } + + /// Returns nu5 network upgrade activation height. + pub fn nu5(&self) -> Option { + self.nu5 + } + + /// Returns nu6 network upgrade activation height. + pub fn nu6(&self) -> Option { + self.nu6 + } + + /// Returns nu6.1 network upgrade activation height. + pub fn nu6_1(&self) -> Option { + self.nu6_1 + } + + /// Returns nu7 network upgrade activation height. + pub fn nu7(&self) -> Option { + self.nu7 + } +} + +/// Leverages a builder method to avoid new network upgrades from causing breaking changes to the public API. +pub struct ActivationHeightsBuilder { + overwinter: Option, + sapling: Option, + blossom: Option, + heartwood: Option, + canopy: Option, + nu5: Option, + nu6: Option, + nu6_1: Option, + nu7: Option, +} + +impl Default for ActivationHeightsBuilder { + fn default() -> Self { + Self::new() + } +} + +impl ActivationHeightsBuilder { + /// Constructs a builder with all fields set to `None`. + pub fn new() -> Self { + Self { + overwinter: None, + sapling: None, + blossom: None, + heartwood: None, + canopy: None, + nu5: None, + nu6: None, + nu6_1: None, + nu7: None, + } + } + + /// Set `overwinter` field. + pub fn set_overwinter(mut self, height: Option) -> Self { + self.overwinter = height; + + self + } + + /// Set `sapling` field. + pub fn set_sapling(mut self, height: Option) -> Self { + self.sapling = height; + + self + } + + /// Set `blossom` field. + pub fn set_blossom(mut self, height: Option) -> Self { + self.blossom = height; + + self + } + + /// Set `heartwood` field. + pub fn set_heartwood(mut self, height: Option) -> Self { + self.heartwood = height; + + self + } + + /// Set `canopy` field. + pub fn set_canopy(mut self, height: Option) -> Self { + self.canopy = height; + + self + } + + /// Set `nu5` field. + pub fn set_nu5(mut self, height: Option) -> Self { + self.nu5 = height; + + self + } + + /// Set `nu6` field. + pub fn set_nu6(mut self, height: Option) -> Self { + self.nu6 = height; + + self + } + + /// Set `nu6_1` field. + pub fn set_nu6_1(mut self, height: Option) -> Self { + self.nu6_1 = height; + + self + } + + /// Set `nu7` field. + pub fn set_nu7(mut self, height: Option) -> Self { + self.nu7 = height; + + self + } + + /// Builds `ActivationHeights` with assertions to ensure all earlier network upgrades are active with an activation + /// height equal to or lower than the later network upgrades. + pub fn build(self) -> ActivationHeights { + if let Some(b) = self.sapling { + assert!(self.overwinter.is_some_and(|a| a <= b)); + } + if let Some(b) = self.blossom { + assert!(self.sapling.is_some_and(|a| a <= b)); + } + if let Some(b) = self.heartwood { + assert!(self.blossom.is_some_and(|a| a <= b)); + } + if let Some(b) = self.canopy { + assert!(self.heartwood.is_some_and(|a| a <= b)); + } + if let Some(b) = self.nu5 { + assert!(self.canopy.is_some_and(|a| a <= b)); + } + if let Some(b) = self.nu6 { + assert!(self.nu5.is_some_and(|a| a <= b)); + } + if let Some(b) = self.nu6_1 { + assert!(self.nu6.is_some_and(|a| a <= b)); + } + if let Some(b) = self.nu7 { + assert!(self.nu6_1.is_some_and(|a| a <= b)); + } + + ActivationHeights { + overwinter: self.overwinter, + sapling: self.sapling, + blossom: self.blossom, + heartwood: self.heartwood, + canopy: self.canopy, + nu5: self.nu5, + nu6: self.nu6, + nu6_1: self.nu6_1, + nu7: self.nu7, + } + } +} diff --git a/zingo_common_components/src/protocol/activation_heights.rs b/zingo_common_components/src/protocol/activation_heights.rs deleted file mode 100644 index f43dd30..0000000 --- a/zingo_common_components/src/protocol/activation_heights.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg(feature = "for_test")] -pub mod for_test; diff --git a/zingo_common_components/src/protocol/activation_heights/for_test.rs b/zingo_common_components/src/protocol/activation_heights/for_test.rs deleted file mode 100644 index 44df483..0000000 --- a/zingo_common_components/src/protocol/activation_heights/for_test.rs +++ /dev/null @@ -1,46 +0,0 @@ -use zebra_chain::parameters; - -/// Get the default all nu activated at 1, Network -#[must_use] -pub fn current_nus_configured_in_block_one_regtest_net() -> parameters::Network { - parameters::Network::new_regtest(all_height_one_nus().into()) -} - -/// Get sequentially activated (1,2,3,4,5,6,7,8) nus network -#[must_use] -pub fn nus_configured_in_sequence_regtest_net() -> parameters::Network { - parameters::Network::new_regtest(sequential_height_nus().into()) -} - -#[must_use] -pub fn sequential_height_nus() -> parameters::testnet::ConfiguredActivationHeights { - parameters::testnet::ConfiguredActivationHeights { - before_overwinter: Some(1), - overwinter: Some(2), - sapling: Some(3), - blossom: Some(4), - heartwood: Some(5), - canopy: Some(6), - nu5: Some(7), - nu6: Some(8), - // see https://zips.z.cash/#nu6-1-candidate-zips for info on NU6.1 - nu6_1: Some(9), - nu7: None, - } -} -#[must_use] -pub fn all_height_one_nus() -> parameters::testnet::ConfiguredActivationHeights { - parameters::testnet::ConfiguredActivationHeights { - before_overwinter: Some(1), - overwinter: Some(1), - sapling: Some(1), - blossom: Some(1), - heartwood: Some(1), - canopy: Some(1), - nu5: Some(1), - nu6: Some(1), - // see https://zips.z.cash/#nu6-1-candidate-zips for info on NU6.1 - nu6_1: Some(1), - nu7: None, - } -}