Struct LocalNetwork

Source
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>,
}
Available on crate feature 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

Source§

fn clone(&self) -> LocalNetwork

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LocalNetwork

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for LocalNetwork

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Parameters for LocalNetwork

Parameters implementation for LocalNetwork

Source§

fn network_type(&self) -> NetworkType

Returns the type of network configured by this set of consensus parameters.
Source§

fn activation_height(&self, nu: NetworkUpgrade) -> Option<BlockHeight>

Returns the activation height for a particular network upgrade, if an activation height has been set.
Source§

fn is_nu_active(&self, nu: NetworkUpgrade, height: BlockHeight) -> bool

Determines whether the specified network upgrade is active as of the provided block height on the network to which this Parameters value applies.
Source§

impl PartialEq for LocalNetwork

Source§

fn eq(&self, other: &LocalNetwork) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for LocalNetwork

Source§

impl Eq for LocalNetwork

Source§

impl StructuralPartialEq for LocalNetwork

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<P> NetworkConstants for P
where P: Parameters,

Source§

fn coin_type(&self) -> u32

The coin type for ZEC, as defined by SLIP 44.
Source§

fn hrp_sapling_extended_spending_key(&self) -> &'static str

Returns the human-readable prefix for Bech32-encoded Sapling extended spending keys for the network to which this NetworkConstants value applies. Read more
Source§

fn hrp_sapling_extended_full_viewing_key(&self) -> &'static str

Returns the human-readable prefix for Bech32-encoded Sapling extended full viewing keys for the network to which this NetworkConstants value applies. Read more
Source§

fn hrp_sapling_payment_address(&self) -> &'static str

Returns the Bech32-encoded human-readable prefix for Sapling payment addresses for the network to which this NetworkConstants value applies. Read more
Source§

fn b58_sprout_address_prefix(&self) -> [u8; 2]

Returns the human-readable prefix for Base58Check-encoded Sprout payment addresses for the network to which this NetworkConstants value applies. Read more
Source§

fn b58_pubkey_address_prefix(&self) -> [u8; 2]

Returns the human-readable prefix for Base58Check-encoded transparent pay-to-public-key-hash payment addresses for the network to which this NetworkConstants value applies.
Source§

fn b58_script_address_prefix(&self) -> [u8; 2]

Returns the human-readable prefix for Base58Check-encoded transparent pay-to-script-hash payment addresses for the network to which this NetworkConstants value applies.
Source§

fn hrp_tex_address(&self) -> &'static str

Returns the Bech32-encoded human-readable prefix for TEX addresses, for the network to which this NetworkConstants value applies. Read more
Source§

fn hrp_unified_address(&self) -> &'static str

The HRP for a Bech32m-encoded mainnet Unified Address. Read more
Source§

fn hrp_unified_fvk(&self) -> &'static str

The HRP for a Bech32m-encoded mainnet Unified FVK. Read more
Source§

fn hrp_unified_ivk(&self) -> &'static str

The HRP for a Bech32m-encoded mainnet Unified IVK. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V