2024-06-02 23:58:29 +00:00
|
|
|
use sp_core::{ConstU32, bounded::BoundedVec};
|
2024-01-29 08:48:53 +00:00
|
|
|
|
2023-12-06 14:53:48 +00:00
|
|
|
pub use serai_validator_sets_primitives as primitives;
|
|
|
|
|
|
|
|
use serai_primitives::*;
|
|
|
|
use serai_validator_sets_primitives::*;
|
|
|
|
|
2023-12-07 07:30:09 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
2024-06-02 23:58:29 +00:00
|
|
|
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
|
|
|
|
#[cfg_attr(all(feature = "std", feature = "serde"), derive(serde::Deserialize))]
|
2023-12-06 14:53:48 +00:00
|
|
|
pub enum Call {
|
|
|
|
set_keys {
|
|
|
|
network: NetworkId,
|
2024-06-02 23:58:29 +00:00
|
|
|
removed_participants: BoundedVec<SeraiAddress, ConstU32<{ MAX_KEY_SHARES_PER_SET / 3 }>>,
|
2023-12-06 14:53:48 +00:00
|
|
|
key_pair: KeyPair,
|
|
|
|
signature: Signature,
|
|
|
|
},
|
2024-01-29 08:48:53 +00:00
|
|
|
report_slashes {
|
|
|
|
network: NetworkId,
|
|
|
|
slashes: BoundedVec<(SeraiAddress, u32), ConstU32<{ MAX_KEY_SHARES_PER_SET / 3 }>>,
|
|
|
|
signature: Signature,
|
|
|
|
},
|
2023-12-06 14:53:48 +00:00
|
|
|
allocate {
|
|
|
|
network: NetworkId,
|
|
|
|
amount: Amount,
|
|
|
|
},
|
|
|
|
deallocate {
|
|
|
|
network: NetworkId,
|
|
|
|
amount: Amount,
|
|
|
|
},
|
|
|
|
claim_deallocation {
|
|
|
|
network: NetworkId,
|
|
|
|
session: Session,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2023-12-07 07:30:09 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
2023-12-06 14:53:48 +00:00
|
|
|
#[cfg_attr(feature = "borsh", derive(borsh::BorshSerialize, borsh::BorshDeserialize))]
|
2024-06-02 23:58:29 +00:00
|
|
|
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
|
|
|
|
#[cfg_attr(all(feature = "std", feature = "serde"), derive(serde::Deserialize))]
|
2023-12-06 14:53:48 +00:00
|
|
|
pub enum Event {
|
|
|
|
NewSet {
|
|
|
|
set: ValidatorSet,
|
|
|
|
},
|
|
|
|
ParticipantRemoved {
|
|
|
|
set: ValidatorSet,
|
|
|
|
removed: SeraiAddress,
|
|
|
|
},
|
|
|
|
KeyGen {
|
|
|
|
set: ValidatorSet,
|
|
|
|
key_pair: KeyPair,
|
|
|
|
},
|
2024-01-29 08:48:53 +00:00
|
|
|
AcceptedHandover {
|
|
|
|
set: ValidatorSet,
|
|
|
|
},
|
|
|
|
SetRetired {
|
|
|
|
set: ValidatorSet,
|
|
|
|
},
|
2023-12-06 14:53:48 +00:00
|
|
|
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,
|
|
|
|
},
|
|
|
|
}
|