Struct diem_types::validator_signer::ValidatorSigner[][src]

pub struct ValidatorSigner { /* fields omitted */ }
Expand description

ValidatorSigner associates an author with public and private keys with helpers for signing and validating. This struct can be used for all signing operations including block and network signing, respectively.

Implementations

impl ValidatorSigner[src]

pub fn new(author: AccountAddress, private_key: Ed25519PrivateKey) -> Self[src]

pub fn sign<T: Serialize + CryptoHash>(&self, message: &T) -> Ed25519Signature[src]

Constructs a signature for message using private_key.

pub fn author(&self) -> AccountAddress[src]

Returns the author associated with this signer.

pub fn public_key(&self) -> Ed25519PublicKey[src]

Returns the public key associated with this signer.

impl ValidatorSigner[src]

pub fn random(opt_rng_seed: impl for<'a> Into<Option<[u8; 32]>>) -> Self[src]

Generate a random set of public and private keys and author information. This takes an optional seed, which it initializes to test_utils::TEST_SEED if passed None

pub fn from_int(num: u8) -> Self[src]

For test only - makes signer with nicely looking account address that has specified integer as fist byte, and rest are zeroes

Trait Implementations

impl Debug for ValidatorSigner[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V