[−][src]Struct exonum_testkit::TestNetwork
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]
&mut self,
us: TestNode,
validators: I
)
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]
fn clone(&self) -> TestNetwork
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for TestNetwork
[src]
impl<'de> Deserialize<'de> for TestNetwork
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for TestNetwork
[src]
Auto Trait Implementations
impl RefUnwindSafe for TestNetwork
impl Send for TestNetwork
impl Sync for TestNetwork
impl Unpin for TestNetwork
impl UnwindSafe for TestNetwork
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,