[][src]Struct exonum_btc_anchoring::test_helpers::AnchoringTestKit

pub struct AnchoringTestKit {
    pub inner: TestKit,
    // some fields omitted
}

Convenient wrapper around testkit with the built-in bitcoin key pool for the each anchoring node.

Fields

inner: TestKit

Underlying testkit instance.

Methods

impl AnchoringTestKit[src]

pub fn new(nodes_num: u16, anchoring_interval: u64) -> Self[src]

Creates an anchoring testkit instance for the specified number of anchoring nodes, and interval between anchors.

pub fn actual_anchoring_config(&self) -> Config[src]

Returns the actual anchoring configuration.

pub fn last_anchoring_tx(&self) -> Option<Transaction>[src]

Returns the latest anchoring transaction.

pub fn anchoring_transaction_proposal(
    &self
) -> Option<(Transaction, Vec<Transaction>)>
[src]

Returns the proposal of the next anchoring transaction for the actual anchoring state.

pub fn create_signature_tx_for_node(
    &self,
    node: &TestNode
) -> Result<Vec<Verified<AnyTx>>, BuilderError>
[src]

Creates signatures for each input of the proposed anchoring transaction signed by the specified node.

pub fn create_signature_txs(&self) -> Vec<Vec<Verified<AnyTx>>>[src]

Creates signatures for each input of the proposed anchoring transaction signed by all of anchoring nodes.

pub fn create_funding_confirmation_txs(
    &self,
    satoshis: u64
) -> (Vec<Verified<AnyTx>>, Transaction)
[src]

Creates the confirmation transactions with a funding transaction to the current address with a given amount of Satoshi.

pub fn create_funding_confirmation_txs_with(
    &self,
    transaction: Transaction
) -> Vec<Verified<AnyTx>>
[src]

Creates the confirmation transactions with a specified funding transaction.

pub fn create_config_change_tx(
    &self,
    proposal: ConfigPropose
) -> Verified<AnyTx>
[src]

Creates configuration change transaction for simple supervisor.

pub fn add_node(&mut self) -> AnchoringKeys[src]

Adds a new auditor node to the testkit network and create Bitcoin keypair for it.

pub fn node_private_key(&self, public_key: &PublicKey) -> PrivateKey[src]

Returns a corresponding private Bitcoin key.

pub fn gen_bitcoin_key(&mut self) -> PublicKey[src]

Generates bitcoin keypair and adds them to the key pool.

pub fn block_hash_on_height(&self, height: Height) -> Hash[src]

Returns the block hash for the given blockchain height.

pub fn anchoring_keypairs(
    &self
) -> impl IntoIterator<Item = (PublicKey, PrivateKey)>
[src]

Returns Bitcoin key pairs of anchoring nodes.

pub fn find_anchoring_node(&self, bitcoin_key: &PublicKey) -> Option<&TestNode>[src]

Finds anchoring node with the specified bitcoin key.

Trait Implementations

impl Debug for AnchoringTestKit[src]

impl Default for AnchoringTestKit[src]

fn default() -> Self[src]

Creates anchoring testkit instance with the unspent funding transaction.

To add funds, this instance commit a block with transactions, so in addition to the genesis block this instance contains one more.

Auto Trait Implementations

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> 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, 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>,