mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-14 23:05:09 +00:00
41ce5b1738
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.
22 lines
1,007 B
Rust
22 lines
1,007 B
Rust
use serai_primitives::*;
|
|
|
|
pub use serai_in_instructions_primitives as primitives;
|
|
use primitives::SignedBatch;
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
|
#[cfg_attr(feature = "borsh", derive(borsh::BorshSerialize, borsh::BorshDeserialize))]
|
|
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
|
|
#[cfg_attr(all(feature = "std", feature = "serde"), derive(serde::Deserialize))]
|
|
pub enum Call {
|
|
execute_batch { batch: SignedBatch },
|
|
}
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
|
#[cfg_attr(feature = "borsh", derive(borsh::BorshSerialize, borsh::BorshDeserialize))]
|
|
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
|
|
#[cfg_attr(all(feature = "std", feature = "serde"), derive(serde::Deserialize))]
|
|
pub enum Event {
|
|
Batch { network: NetworkId, id: u32, block: BlockHash, instructions_hash: [u8; 32] },
|
|
InstructionFailure { network: NetworkId, id: u32, index: u32 },
|
|
Halt { network: NetworkId },
|
|
}
|