[][src]Struct exonum_btc_anchoring::config::Config

pub struct Config {
    pub network: Network,
    pub anchoring_keys: Vec<AnchoringKeys>,
    pub anchoring_interval: u64,
    pub transaction_fee: u64,
}

Consensus parameters in the BTC anchoring.

Fields

network: Network

Type of the used BTC network.

anchoring_keys: Vec<AnchoringKeys>

Bitcoin public keys of nodes 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.

Methods

impl Config[src]

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

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

pub fn find_bitcoin_key(
    &self,
    service_key: &PublicKey
) -> Option<(u16, PublicKey)>
[src]

Tries to find bitcoin public key corresponding with the given service key.

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 anchoring_out_script(&self) -> Script[src]

Computes the P2WSH output corresponding to the actual 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.

pub fn byzantine_quorum(&self) -> usize[src]

Returns sufficient number of votes for the given anchoring nodes number.

Trait Implementations

impl BinaryValue for Config[src]

impl Clone for Config[src]

impl Debug for Config[src]

impl Default for Config[src]

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

impl ObjectHash for Config[src]

impl PartialEq<Config> for Config[src]

impl ProtobufConvert for Config[src]

type ProtoStruct = Config

Type generated from the Protobuf definition.

impl Serialize for Config[src]

impl StructuralPartialEq for Config[src]

impl ValidateInput for Config[src]

type Error = Error

The type returned in the event of a validate error.

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

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

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

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

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

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

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

impl<T> InitializableFromZeroed for T where
    T: Default

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

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

type Owned = T

The resulting type after obtaining ownership.

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> Typeable for T where
    T: Any

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