2025-02-12 03:41:50 -05:00
|
|
|
use borsh::{BorshSerialize, BorshDeserialize};
|
2024-09-01 01:55:42 +03:00
|
|
|
|
2025-02-12 03:41:50 -05:00
|
|
|
use serai_primitives::network_id::ExternalNetworkId;
|
|
|
|
|
|
|
|
|
|
/// An event from economic security.
|
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, BorshSerialize, BorshDeserialize)]
|
2024-09-01 01:55:42 +03:00
|
|
|
pub enum Event {
|
2025-02-12 03:41:50 -05:00
|
|
|
/// Economic security was achieved for a network's validator set.
|
|
|
|
|
EconomicSecurityAchieved {
|
|
|
|
|
/// The network whose validator set achieved economic security.
|
|
|
|
|
network: ExternalNetworkId,
|
|
|
|
|
},
|
2024-09-01 01:55:42 +03:00
|
|
|
}
|
2025-09-20 01:41:54 -04:00
|
|
|
|
|
|
|
|
/// A trait representing access to the information on economic security.
|
|
|
|
|
pub trait EconomicSecurity {
|
|
|
|
|
/// If am external network has _ever_ achieved economic security.
|
|
|
|
|
#[must_use]
|
|
|
|
|
fn achieved_economic_security(network: ExternalNetworkId) -> bool;
|
|
|
|
|
}
|