mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
Add ABI crate
Call and Event are both from the pallets, which are AGPL licensed. Accordingly, they make serai-client AGPL licensed when serai-client must end up MIT licensed. This creates a MIT-licensed variant of Calls and Events such that they can be used by serai-client, enabling transitioning it to MIT. Relevant to https://github.com/serai-dex/serai/issues/337.
This commit is contained in:
68
substrate/abi/src/validator_sets.rs
Normal file
68
substrate/abi/src/validator_sets.rs
Normal file
@@ -0,0 +1,68 @@
|
||||
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)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub enum Call {
|
||||
set_keys {
|
||||
network: NetworkId,
|
||||
key_pair: KeyPair,
|
||||
signature: Signature,
|
||||
},
|
||||
remove_participant {
|
||||
network: NetworkId,
|
||||
to_remove: SeraiAddress,
|
||||
signers: Vec<SeraiAddress>,
|
||||
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)]
|
||||
#[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,
|
||||
},
|
||||
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,
|
||||
},
|
||||
SetRetired {
|
||||
set: ValidatorSet,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user