mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Further work on transaction signing
This commit is contained in:
@@ -20,7 +20,8 @@ ignored = ["scale", "borsh"]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
group = { version = "0.13", default-features = false }
|
||||
ciphersuite = { path = "../../../crypto/ciphersuite", default-features = false, features = ["std"] }
|
||||
frost = { package = "modular-frost", path = "../../../crypto/frost", default-features = false }
|
||||
|
||||
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["std"] }
|
||||
borsh = { version = "1", default-features = false, features = ["std", "derive", "de_strict_order"] }
|
||||
|
||||
@@ -5,16 +5,25 @@
|
||||
use core::marker::PhantomData;
|
||||
use std::io;
|
||||
|
||||
use group::GroupEncoding;
|
||||
use ciphersuite::{group::GroupEncoding, Ciphersuite};
|
||||
use frost::{dkg::ThresholdKeys, sign::PreprocessMachine};
|
||||
|
||||
use serai_db::DbTxn;
|
||||
|
||||
/// A transaction.
|
||||
pub trait Transaction: Sized {
|
||||
/// Read a `Transaction`.
|
||||
fn read(reader: &mut impl io::Read) -> io::Result<Self>;
|
||||
/// Write a `Transaction`.
|
||||
fn write(&self, writer: &mut impl io::Write) -> io::Result<()>;
|
||||
}
|
||||
|
||||
/// A signable transaction.
|
||||
pub trait SignableTransaction: 'static + Sized + Send + Sync + Clone {
|
||||
/// The ciphersuite used to sign this transaction.
|
||||
type Ciphersuite: Cuphersuite;
|
||||
type Ciphersuite: Ciphersuite;
|
||||
/// The preprocess machine for the signing protocol for this transaction.
|
||||
type PreprocessMachine: PreprocessMachine;
|
||||
type PreprocessMachine: Clone + PreprocessMachine<Signature: Send>;
|
||||
|
||||
/// Read a `SignableTransaction`.
|
||||
fn read(reader: &mut impl io::Read) -> io::Result<Self>;
|
||||
|
||||
Reference in New Issue
Block a user