[][src]Struct exonum_testkit::TestNode

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]

Constructs a new node from the given keypairs.

pub fn create_propose(
    &self,
    height: Height,
    last_hash: &Hash,
    tx_hashes: &[Hash]
) -> Signed<Propose>
[src]

Creates a Propose message signed by this validator.

pub fn create_precommit(
    &self,
    propose: &Propose,
    block_hash: &Hash
) -> Signed<Precommit>
[src]

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 PartialEq<TestNode> for TestNode[src]

impl From<TestNode> for ValidatorKeys[src]

impl Clone for TestNode[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for TestNode[src]

impl Serialize for TestNode[src]

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

Auto Trait Implementations

impl Send for TestNode

impl Sync for TestNode

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto 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> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Erased for T

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]