mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 20:59:23 +00:00
Handle signing batches in the processor
Duplicates the existing signer for one tailored to batch signing.
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
use std::{io, collections::HashMap};
|
||||
use std::{
|
||||
time::{SystemTime, Duration},
|
||||
io,
|
||||
collections::HashMap,
|
||||
};
|
||||
|
||||
use async_trait::async_trait;
|
||||
|
||||
@@ -10,7 +14,7 @@ use frost::{
|
||||
ThresholdKeys,
|
||||
};
|
||||
|
||||
use tokio::time::{Duration, sleep};
|
||||
use tokio::time::sleep;
|
||||
|
||||
use bitcoin_serai::{
|
||||
bitcoin::{
|
||||
@@ -197,6 +201,9 @@ impl BlockTrait<Bitcoin> for Block {
|
||||
hash.reverse();
|
||||
hash
|
||||
}
|
||||
fn time(&self) -> SystemTime {
|
||||
SystemTime::UNIX_EPOCH + Duration::from_secs(self.header.time.into())
|
||||
}
|
||||
fn median_fee(&self) -> Fee {
|
||||
// TODO
|
||||
Fee(20)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use core::fmt::Debug;
|
||||
use std::{collections::HashMap, io};
|
||||
use std::{time::SystemTime, io, collections::HashMap};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use thiserror::Error;
|
||||
@@ -160,6 +160,7 @@ pub trait Block<C: Coin>: Send + Sync + Sized + Clone + Debug {
|
||||
// This is currently bounded to being 32-bytes.
|
||||
type Id: 'static + Id;
|
||||
fn id(&self) -> Self::Id;
|
||||
fn time(&self) -> SystemTime;
|
||||
fn median_fee(&self) -> C::Fee;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
use std::{time::Duration, collections::HashMap, io};
|
||||
use std::{
|
||||
time::{SystemTime, Duration},
|
||||
collections::HashMap,
|
||||
io,
|
||||
};
|
||||
|
||||
use async_trait::async_trait;
|
||||
|
||||
@@ -142,6 +146,10 @@ impl BlockTrait<Monero> for Block {
|
||||
self.0
|
||||
}
|
||||
|
||||
fn time(&self) -> SystemTime {
|
||||
SystemTime::UNIX_EPOCH + Duration::from_secs(self.1.header.timestamp)
|
||||
}
|
||||
|
||||
fn median_fee(&self) -> Fee {
|
||||
// TODO
|
||||
Fee { per_weight: 80000, mask: 10000 }
|
||||
|
||||
Reference in New Issue
Block a user