Skip to main content

Certified

Trait Certified 

Source
pub trait Certified {
    type Value: CertificateValue;

    // Required methods
    fn value(&self) -> &Self::Value;
    fn round(&self) -> Round;
    fn unlocking_round(&self) -> Option<Round>;
    fn signatures(&self) -> &Vec<(ValidatorPublicKey, ValidatorSignature)>;
    fn lite_certificate(&self) -> LiteCertificate<'_>;
    fn check(&self, committee: &Committee) -> Result<(), ChainError>;

    // Provided methods
    fn hash(&self) -> CryptoHash { ... }
    fn is_signed_by(&self, validator_name: &ValidatorPublicKey) -> bool { ... }
}
Expand description

The common read interface shared by all certificate types: the signed value, the round and unlocking round it was certified under, its signatures, and verification.

Required Associated Types§

Source

type Value: CertificateValue

The kind of value this certificate certifies.

Required Methods§

Source

fn value(&self) -> &Self::Value

Returns a reference to the certified value.

Source

fn round(&self) -> Round

Returns the round in which the value was certified.

Source

fn unlocking_round(&self) -> Option<Round>

Returns the unlocking round the ValidatedBlock voters signed, if any.

Source

fn signatures(&self) -> &Vec<(ValidatorPublicKey, ValidatorSignature)>

Returns the validator signatures certifying this value.

Source

fn lite_certificate(&self) -> LiteCertificate<'_>

Returns the LiteCertificate corresponding to this certificate, without the value but with the justification chain.

Source

fn check(&self, committee: &Committee) -> Result<(), ChainError>

Verifies the certificate, including its justification chain.

Provided Methods§

Source

fn hash(&self) -> CryptoHash

Returns the certified value’s hash.

Source

fn is_signed_by(&self, validator_name: &ValidatorPublicKey) -> bool

Returns whether the validator is among the signatories of this certificate.

Implementors§