[][src]Struct exonum_btc_anchoring::config::GlobalConfig

pub struct GlobalConfig {
    pub network: Network,
    pub public_keys: Vec<PublicKey>,
    pub anchoring_interval: u64,
    pub transaction_fee: u64,
    pub funding_transaction: Option<Transaction>,
}

Consensus parameters in the BTC anchoring.

Fields

network: Network

Type of the used BTC network.

public_keys: Vec<PublicKey>

Bitcoin public keys of validators from from which the current anchoring redeem script can be calculated.

anchoring_interval: u64

Interval in blocks between anchored blocks.

transaction_fee: u64

Fee per byte in satoshis.

funding_transaction: Option<Transaction>

Funding transaction.

Methods

impl GlobalConfig[src]

pub fn with_public_keys(
    network: Network,
    keys: impl IntoIterator<Item = PublicKey>
) -> Result<Self, RedeemScriptError>
[src]

Creates global configuration instance with default parameters for the given Bitcoin network and public keys of participants.

pub fn anchoring_address(&self) -> Address[src]

Returns the corresponding Bitcoin address.

pub fn redeem_script(&self) -> RedeemScript[src]

Returns the corresponding redeem script.

pub fn previous_anchoring_height(&self, current_height: Height) -> Height[src]

Returns the latest height below the given height which must be anchored.

pub fn following_anchoring_height(&self, current_height: Height) -> Height[src]

Returns the nearest height above the given height which must be anchored.

Trait Implementations

impl PartialEq<GlobalConfig> for GlobalConfig[src]

impl Clone for GlobalConfig[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for GlobalConfig[src]

impl Debug for GlobalConfig[src]

impl Serialize for GlobalConfig[src]

impl<'de> Deserialize<'de> for GlobalConfig[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Erased for T

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]

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

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