Struct exonum_testkit::TestNode
[−]
[src]
pub struct TestNode { /* fields omitted */ }
An emulated node in the test network.
Methods
impl TestNode
[src]
pub fn new_auditor() -> Self
[src]
Creates a new auditor.
pub fn new_validator(validator_id: ValidatorId) -> Self
[src]
Creates a new validator with the given id.
pub fn from_parts(
consensus_keypair: (PublicKey, SecretKey),
service_keypair: (PublicKey, SecretKey),
validator_id: Option<ValidatorId>
) -> TestNode
[src]
consensus_keypair: (PublicKey, SecretKey),
service_keypair: (PublicKey, SecretKey),
validator_id: Option<ValidatorId>
) -> TestNode
Constructs a new node from the given keypairs.
pub fn create_propose(
&self,
height: Height,
last_hash: &Hash,
tx_hashes: &[Hash]
) -> Propose
[src]
&self,
height: Height,
last_hash: &Hash,
tx_hashes: &[Hash]
) -> Propose
Creates a Propose
message signed by this validator.
pub fn create_precommit(
&self,
propose: &Propose,
block_hash: &Hash
) -> Precommit
[src]
&self,
propose: &Propose,
block_hash: &Hash
) -> Precommit
Creates a Precommit
message signed by this validator.
pub fn public_keys(&self) -> ValidatorKeys
[src]
Returns public keys of the node.
pub fn validator_id(&self) -> Option<ValidatorId>
[src]
Returns the current validator id of node if it is validator of the test network.
pub fn change_role(&mut self, role: Option<ValidatorId>)
[src]
Changes node role.
pub fn service_keypair(&self) -> (&PublicKey, &SecretKey)
[src]
Returns the service keypair.
Trait Implementations
impl Debug for TestNode
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for TestNode
[src]
fn clone(&self) -> TestNode
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for TestNode
[src]
fn eq(&self, __arg_0: &TestNode) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &TestNode) -> bool
[src]
This method tests for !=
.