mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-14 15:09:23 +00:00
Redo primitives, abi
Consolidates all primitives into a single crate. We didn't benefit from its fragmentation. I'm hesitant to say the new internal-organization is better (it may be just as clunky), but it's at least in a single crate (not spread out over micro-crates). The ABI is the most distinct. We now entirely own it. Block header hashes don't directly commit to any BABE data (avoiding potentially ~4 KB headers upon session changes), and are hashed as borsh (a more widely used codec than SCALE). There are still Substrate variants, using SCALE and with the BABE data, but they're prunable from a protocol design perspective. Defines a transaction as a Vec of Calls, allowing atomic operations.
This commit is contained in:
21
substrate/primitives/src/instructions/out.rs
Normal file
21
substrate/primitives/src/instructions/out.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use zeroize::Zeroize;
|
||||
|
||||
use borsh::{BorshSerialize, BorshDeserialize};
|
||||
|
||||
use crate::{address::ExternalAddress, balance::ExternalBalance};
|
||||
|
||||
/// An instruction on how to transfer coins out.
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Zeroize, BorshSerialize, BorshDeserialize)]
|
||||
pub enum OutInstruction {
|
||||
/// Transfer to the specified address.
|
||||
Transfer(ExternalAddress),
|
||||
}
|
||||
|
||||
/// An instruction on how to transfer coins out with the balance to use for the transfer out.
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Zeroize, BorshSerialize, BorshDeserialize)]
|
||||
pub struct OutInstructionWithBalance {
|
||||
/// The instruction on how to transfer coins out.
|
||||
pub instruction: OutInstruction,
|
||||
/// The balance to use for the transfer out.
|
||||
pub balance: ExternalBalance,
|
||||
}
|
||||
Reference in New Issue
Block a user