pub struct SlashingRecord {
pub validator_pubkey: [u8; 32],
pub evidence_type: EvidenceType,
pub slashed_at: BlockHeight,
pub validator_slash_amount: Balance,
pub delegation_slash_amount: Balance,
pub jailed_until: BlockHeight,
pub tombstoned: bool,
pub slash_fraction_bps: u16,
}Expand description
Record of a slashing event
Fields§
§validator_pubkey: [u8; 32]Validator’s public key
evidence_type: EvidenceTypeType of evidence that caused the slash
slashed_at: BlockHeightBlock height when slash was applied
validator_slash_amount: BalanceAmount of validator’s self-stake slashed
delegation_slash_amount: BalanceAmount of delegator stake slashed
jailed_until: BlockHeightJail until block height (0 if not jailed)
tombstoned: boolWhether this was a tombstone (permanent jail)
slash_fraction_bps: u16Fraction slashed (basis points)
Implementations§
Source§impl SlashingRecord
impl SlashingRecord
Sourcepub fn new(
validator_pubkey: [u8; 32],
evidence_type: EvidenceType,
slashed_at: BlockHeight,
validator_slash_amount: Balance,
delegation_slash_amount: Balance,
jailed_until: BlockHeight,
tombstoned: bool,
slash_fraction_bps: u16,
) -> Self
pub fn new( validator_pubkey: [u8; 32], evidence_type: EvidenceType, slashed_at: BlockHeight, validator_slash_amount: Balance, delegation_slash_amount: Balance, jailed_until: BlockHeight, tombstoned: bool, slash_fraction_bps: u16, ) -> Self
Create a new slashing record
Sourcepub fn total_slashed(&self) -> Balance
pub fn total_slashed(&self) -> Balance
Get total slashed amount
Trait Implementations§
Source§impl Clone for SlashingRecord
impl Clone for SlashingRecord
Source§fn clone(&self) -> SlashingRecord
fn clone(&self) -> SlashingRecord
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 moreSource§impl Debug for SlashingRecord
impl Debug for SlashingRecord
Source§impl<'de> Deserialize<'de> for SlashingRecord
impl<'de> Deserialize<'de> for SlashingRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SlashingRecord
impl PartialEq for SlashingRecord
Source§fn eq(&self, other: &SlashingRecord) -> bool
fn eq(&self, other: &SlashingRecord) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for SlashingRecord
impl Serialize for SlashingRecord
impl Eq for SlashingRecord
impl StructuralPartialEq for SlashingRecord
Auto Trait Implementations§
impl Freeze for SlashingRecord
impl RefUnwindSafe for SlashingRecord
impl Send for SlashingRecord
impl Sync for SlashingRecord
impl Unpin for SlashingRecord
impl UnsafeUnpin for SlashingRecord
impl UnwindSafe for SlashingRecord
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