mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-01 16:39:53 +00:00
22 lines
949 B
Rust
22 lines
949 B
Rust
|
#![cfg_attr(not(feature = "std"), no_std)]
|
||
|
|
||
|
use scale::{Encode, Decode, MaxEncodedLen};
|
||
|
use scale_info::TypeInfo;
|
||
|
#[cfg(feature = "std")]
|
||
|
use serde::{Serialize, Deserialize};
|
||
|
|
||
|
/// The type used to identify a specific session of validators.
|
||
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen)]
|
||
|
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||
|
pub struct Session(pub u32);
|
||
|
|
||
|
/// The type used to identify a validator set.
|
||
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen)]
|
||
|
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||
|
pub struct ValidatorSetIndex(pub u16);
|
||
|
|
||
|
/// The type used to identify a specific validator set during a specific session.
|
||
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen)]
|
||
|
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||
|
pub struct ValidatorSetInstance(pub Session, pub ValidatorSetIndex);
|