Skip to main content

SlashingProofData

Trait SlashingProofData 

Source
pub trait SlashingProofData<'a> {
    const PROOF_TYPE: ProofType;

    // Required methods
    fn unpack(data: &'a [u8]) -> Result<Self, SlashingError>
       where Self: Sized;
    fn verify_proof(
        self,
        slot: Slot,
        pubkey: &Pubkey,
    ) -> Result<(), SlashingError>;
}
Expand description

Trait that proof accounts must satisfy in order to verify via the slashing program

Required Associated Constants§

Source

const PROOF_TYPE: ProofType

The type of proof this data represents

Required Methods§

Source

fn unpack(data: &'a [u8]) -> Result<Self, SlashingError>
where Self: Sized,

Zero copy from raw data buffer

Source

fn verify_proof(self, slot: Slot, pubkey: &Pubkey) -> Result<(), SlashingError>

Verification logic for this type of proof data

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a> SlashingProofData<'a> for DuplicateBlockProofData<'a>

Source§

const PROOF_TYPE: ProofType = ProofType::DuplicateBlockProof