mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-14 14:54:51 +00:00
4913873b10
* report_slashes plumbing in Substrate Notably delays the SetRetired event until it provides a slash report or the set after it becomes the set to report its slashes. * Add dedicated AcceptedHandover event * Add SlashReport TX to Tributary * Create SlashReport TXs * Handle SlashReport TXs * Add logic to generate a SlashReport to the coordinator * Route SlashReportSigner into the processor * Finish routing the SlashReport signing/TX publication * Add serai feature to processor's serai-client
73 lines
1.7 KiB
Rust
73 lines
1.7 KiB
Rust
use sp_core::{ConstU32, bounded_vec::BoundedVec};
|
|
|
|
pub use serai_validator_sets_primitives as primitives;
|
|
|
|
use serai_primitives::*;
|
|
use serai_validator_sets_primitives::*;
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
|
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
|
pub enum Call {
|
|
set_keys {
|
|
network: NetworkId,
|
|
removed_participants: Vec<SeraiAddress>,
|
|
key_pair: KeyPair,
|
|
signature: Signature,
|
|
},
|
|
report_slashes {
|
|
network: NetworkId,
|
|
slashes: BoundedVec<(SeraiAddress, u32), ConstU32<{ MAX_KEY_SHARES_PER_SET / 3 }>>,
|
|
signature: Signature,
|
|
},
|
|
allocate {
|
|
network: NetworkId,
|
|
amount: Amount,
|
|
},
|
|
deallocate {
|
|
network: NetworkId,
|
|
amount: Amount,
|
|
},
|
|
claim_deallocation {
|
|
network: NetworkId,
|
|
session: Session,
|
|
},
|
|
}
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
|
#[cfg_attr(feature = "borsh", derive(borsh::BorshSerialize, borsh::BorshDeserialize))]
|
|
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
|
pub enum Event {
|
|
NewSet {
|
|
set: ValidatorSet,
|
|
},
|
|
ParticipantRemoved {
|
|
set: ValidatorSet,
|
|
removed: SeraiAddress,
|
|
},
|
|
KeyGen {
|
|
set: ValidatorSet,
|
|
key_pair: KeyPair,
|
|
},
|
|
AcceptedHandover {
|
|
set: ValidatorSet,
|
|
},
|
|
SetRetired {
|
|
set: ValidatorSet,
|
|
},
|
|
AllocationIncreased {
|
|
validator: SeraiAddress,
|
|
network: NetworkId,
|
|
amount: Amount,
|
|
},
|
|
AllocationDecreased {
|
|
validator: SeraiAddress,
|
|
network: NetworkId,
|
|
amount: Amount,
|
|
delayed_until: Option<Session>,
|
|
},
|
|
DeallocationClaimed {
|
|
validator: SeraiAddress,
|
|
network: NetworkId,
|
|
session: Session,
|
|
},
|
|
}
|