Struct exonum_testkit::TestNetwork
[−]
[src]
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 us(&self) -> &TestNode
[src]
Returns the node in the emulated network, from whose perspective the testkit operates.
pub fn validators(&self) -> &[TestNode]
[src]
Returns a slice of all validators in the network.
pub fn genesis_config(&self) -> GenesisConfig
[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_configuration(&mut self, config: TestNetworkConfiguration)
[src]
Updates the test network with a new 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.