pub struct LocalNetwork {
pub overwinter: Option<BlockHeight>,
pub sapling: Option<BlockHeight>,
pub blossom: Option<BlockHeight>,
pub heartwood: Option<BlockHeight>,
pub canopy: Option<BlockHeight>,
pub nu5: Option<BlockHeight>,
pub nu6: Option<BlockHeight>,
}
local-consensus
only.Expand description
a LocalNetwork
setup should define the activation heights
of network upgrades. None
is considered as “not activated”
These heights are not validated. Callers shall initialized
them according to the settings used on the Full Nodes they
are connecting to.
Example:
Regtest Zcashd using the following zcash.conf
## NUPARAMS nuparams=5ba81b19:1 # Overwinter nuparams=76b809bb:1 # Sapling nuparams=2bb40e60:1 # Blossom nuparams=f5b9230b:1 # Heartwood nuparams=e9ff75a6:1 # Canopy nuparams=c2d6d0b4:1 # NU5 nuparams=c8e71055:1 # NU6
would use the following LocalNetwork
struct
let regtest = LocalNetwork { overwinter: Some(BlockHeight::from_u32(1)), sapling: Some(BlockHeight::from_u32(1)), blossom: Some(BlockHeight::from_u32(1)), heartwood: Some(BlockHeight::from_u32(1)), canopy: Some(BlockHeight::from_u32(1)), nu5: Some(BlockHeight::from_u32(1)), nu6: Some(BlockHeight::from_u32(1)), };
Fields§
§overwinter: Option<BlockHeight>
§sapling: Option<BlockHeight>
§blossom: Option<BlockHeight>
§heartwood: Option<BlockHeight>
§canopy: Option<BlockHeight>
§nu5: Option<BlockHeight>
§nu6: Option<BlockHeight>
Trait Implementations§
Source§impl Clone for LocalNetwork
impl Clone for LocalNetwork
Source§fn clone(&self) -> LocalNetwork
fn clone(&self) -> LocalNetwork
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for LocalNetwork
impl Debug for LocalNetwork
Source§impl Hash for LocalNetwork
impl Hash for LocalNetwork
Source§impl Parameters for LocalNetwork
Parameters implementation for LocalNetwork
impl Parameters for LocalNetwork
Parameters implementation for LocalNetwork
Source§fn network_type(&self) -> NetworkType
fn network_type(&self) -> NetworkType
Source§fn activation_height(&self, nu: NetworkUpgrade) -> Option<BlockHeight>
fn activation_height(&self, nu: NetworkUpgrade) -> Option<BlockHeight>
Source§fn is_nu_active(&self, nu: NetworkUpgrade, height: BlockHeight) -> bool
fn is_nu_active(&self, nu: NetworkUpgrade, height: BlockHeight) -> bool
Source§impl PartialEq for LocalNetwork
impl PartialEq for LocalNetwork
impl Copy for LocalNetwork
impl Eq for LocalNetwork
impl StructuralPartialEq for LocalNetwork
Auto Trait Implementations§
impl Freeze for LocalNetwork
impl RefUnwindSafe for LocalNetwork
impl Send for LocalNetwork
impl Sync for LocalNetwork
impl Unpin for LocalNetwork
impl UnwindSafe for LocalNetwork
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<P> NetworkConstants for Pwhere
P: Parameters,
impl<P> NetworkConstants for Pwhere
P: Parameters,
Source§fn hrp_sapling_extended_spending_key(&self) -> &'static str
fn hrp_sapling_extended_spending_key(&self) -> &'static str
Source§fn hrp_sapling_extended_full_viewing_key(&self) -> &'static str
fn hrp_sapling_extended_full_viewing_key(&self) -> &'static str
Source§fn hrp_sapling_payment_address(&self) -> &'static str
fn hrp_sapling_payment_address(&self) -> &'static str
Source§fn b58_sprout_address_prefix(&self) -> [u8; 2]
fn b58_sprout_address_prefix(&self) -> [u8; 2]
Source§fn b58_pubkey_address_prefix(&self) -> [u8; 2]
fn b58_pubkey_address_prefix(&self) -> [u8; 2]
Source§fn b58_script_address_prefix(&self) -> [u8; 2]
fn b58_script_address_prefix(&self) -> [u8; 2]
Source§fn hrp_tex_address(&self) -> &'static str
fn hrp_tex_address(&self) -> &'static str
NetworkConstants
value applies. Read more