Struct diem_sdk::types::validator_verifier::ValidatorVerifier[][src]

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

Supports validation of signatures for known authors with individual voting powers. This struct can be used for all signature verification operations including block and network signature verification, respectively.

Implementations

Initialize with a map of account address to validator info and set quorum size to default (2f + 1) or zero if address_to_validator_info is empty.

Helper method to initialize with a single author and public key with quorum voting power 1.

Verify the correctness of a signature of a message by a known author.

This function will successfully return when at least quorum_size signatures of known authors are successfully verified. Also, an aggregated signature is considered invalid if any of the attached signatures is invalid or it does not correspond to a known author. The latter is to prevent malicious users from adding arbitrary content to the signature payload that would go unnoticed.

This function will try batch signature verification and falls back to normal iterated verification if batching fails.

Ensure there is at least quorum_voting_power in the provided signatures and there are only known authors. According to the threshold verification policy, invalid public keys are not allowed.

Returns the public key for this address.

Returns the voting power for this address.

Returns an ordered list of account addresses as an Iterator.

Returns the number of authors to be validated.

Is there at least one author?

Returns quorum voting power.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

Generates a hash used only for tests.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more