[][src]Struct exonum_testkit::TestNetwork

pub struct TestNetwork { /* fields omitted */ }

Emulated test network.

Methods

impl TestNetwork[src]

pub fn new(validator_count: u16) -> Self[src]

Creates a new emulated network.

pub fn with_our_role(us: Option<ValidatorId>, validator_count: u16) -> Self[src]

Creates a new emulated network with a specific role of the node the network will be viewed from.

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

Adds a new auditor node to this network.

pub fn us(&self) -> &TestNode[src]

Returns the node in the emulated network, from whose perspective the testkit operates.

pub fn validators(&self) -> Vec<TestNode>[src]

Returns all validators in the network.

pub fn nodes(&self) -> &[TestNode][src]

Returns a slice of all nodes in the network.

pub fn consensus_config(&self) -> ConsensusConfig[src]

Returns config encoding the network structure usable for creating the genesis block of a blockchain.

pub fn update<I: IntoIterator<Item = TestNode>>(
    &mut self,
    us: TestNode,
    validators: I
)
[src]

Updates the test network by the new set of nodes.

pub fn update_consensus_config(&mut self, config: &ConsensusConfig)[src]

Updates the test network with a new consensus configuration.

pub fn service_public_key_of(&self, id: ValidatorId) -> Option<PublicKey>[src]

Returns service public key of the validator with given id.

pub fn consensus_public_key_of(&self, id: ValidatorId) -> Option<PublicKey>[src]

Returns consensus public key of the validator with given id.

Trait Implementations

impl Clone for TestNetwork[src]

impl Debug for TestNetwork[src]

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

impl Serialize for TestNetwork[src]

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

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

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<V, T> VZip<V> for T where
    V: MultiLane<T>,