mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
We prior required they had the same encoding, yet this ensures they do by making them one and the same. This does require an large, ugly, From/TryInto block which is deemed preferable for moving this more and more into syntax (from semantics). Further improvements (notably re: Extra) is possible, and this already lets us strip some members from the Call enum.
18 lines
704 B
Rust
18 lines
704 B
Rust
use sp_consensus_babe::EquivocationProof;
|
|
|
|
use serai_primitives::{Header, SeraiAddress};
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
|
pub struct ReportEquivocation {
|
|
pub equivocation_proof: alloc::boxed::Box<EquivocationProof<Header>>,
|
|
pub key_owner_proof: SeraiAddress,
|
|
}
|
|
|
|
// We could define a Babe Config here and use the literal pallet_babe::Call
|
|
// The disadvantage to this would be the complexity and presence of junk fields such as `__Ignore`
|
|
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
|
pub enum Call {
|
|
report_equivocation(ReportEquivocation),
|
|
report_equivocation_unsigned(ReportEquivocation),
|
|
}
|