pub struct SlashReason<S: Signature, A: AggregateSignature, H: BlockHash> { /* private fields */ }Expand description
A reason to slash a validator.
This contains the necessary evidence to convince other validators of this slash.
Implementations§
Source§impl<S: Signature, A: AggregateSignature, H: BlockHash> SlashReason<S, A, H>
impl<S: Signature, A: AggregateSignature, H: BlockHash> SlashReason<S, A, H>
Sourcepub fn verify<V: Validator>(
&self,
genesis: impl AsRef<[u8]>,
validator_set: &(impl ?Sized + ValidatorSet<Validator = V>),
signature_scheme: &(impl ?Sized + SignatureScheme<Validator = V, Signature = S, AggregateSignature = A>),
validator: V,
) -> Result<(), InvalidReason>
pub fn verify<V: Validator>( &self, genesis: impl AsRef<[u8]>, validator_set: &(impl ?Sized + ValidatorSet<Validator = V>), signature_scheme: &(impl ?Sized + SignatureScheme<Validator = V, Signature = S, AggregateSignature = A>), validator: V, ) -> Result<(), InvalidReason>
Verify the reasoning for this slash.
Trait Implementations§
Source§impl<S, A, H> BorshDeserialize for SlashReason<S, A, H>where
S: BorshDeserialize + Signature,
A: BorshDeserialize + AggregateSignature,
H: BorshDeserialize + BlockHash,
impl<S, A, H> BorshDeserialize for SlashReason<S, A, H>where
S: BorshDeserialize + Signature,
A: BorshDeserialize + AggregateSignature,
H: BorshDeserialize + BlockHash,
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl<S, A, H> BorshSerialize for SlashReason<S, A, H>where
S: BorshSerialize + Signature,
A: BorshSerialize + AggregateSignature,
H: BorshSerialize + BlockHash,
impl<S, A, H> BorshSerialize for SlashReason<S, A, H>where
S: BorshSerialize + Signature,
A: BorshSerialize + AggregateSignature,
H: BorshSerialize + BlockHash,
Source§impl<S: Clone + Signature, A: Clone + AggregateSignature, H: Clone + BlockHash> Clone for SlashReason<S, A, H>
impl<S: Clone + Signature, A: Clone + AggregateSignature, H: Clone + BlockHash> Clone for SlashReason<S, A, H>
Source§fn clone(&self) -> SlashReason<S, A, H>
fn clone(&self) -> SlashReason<S, A, H>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<S, A, H> Freeze for SlashReason<S, A, H>
impl<S, A, H> RefUnwindSafe for SlashReason<S, A, H>
impl<S, A, H> Send for SlashReason<S, A, H>
impl<S, A, H> Sync for SlashReason<S, A, H>
impl<S, A, H> Unpin for SlashReason<S, A, H>
impl<S, A, H> UnsafeUnpin for SlashReason<S, A, H>
impl<S, A, H> UnwindSafe for SlashReason<S, A, H>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more