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:
Luke Parker
2023-12-06 09:53:48 -05:00
parent 7768ea90ad
commit 6416e0079b
14 changed files with 539 additions and 105 deletions

View File

@@ -0,0 +1,24 @@
use sp_consensus_grandpa::EquivocationProof;
use serai_primitives::{BlockNumber, SeraiAddress};
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode)]
pub struct ReportEquivocation {
pub equivocation_proof: Box<EquivocationProof<[u8; 32], BlockNumber>>,
pub key_owner_proof: (),
}
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode)]
pub enum Call {
report_equivocation(ReportEquivocation),
report_equivocation_unsigned(ReportEquivocation),
}
#[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 {
NewAuthorities { authority_set: Vec<(SeraiAddress, u64)> },
Paused,
Resumed,
}