Update processor message flow around the new SignedBatch flow

This commit is contained in:
Luke Parker
2023-04-10 02:51:15 -04:00
parent ccec529cee
commit b9f38fb354
10 changed files with 213 additions and 98 deletions

View File

@@ -37,7 +37,7 @@ use bitcoin_serai::bitcoin::{
};
use serai_client::{
primitives::{MAX_DATA_LEN, BITCOIN, Amount, Balance},
primitives::{MAX_DATA_LEN, BITCOIN, BITCOIN_NET_ID, NetworkId, Amount, Balance},
coins::bitcoin::Address,
};
@@ -286,6 +286,7 @@ impl Coin for Bitcoin {
type Address = Address;
const NETWORK: NetworkId = BITCOIN_NET_ID;
const ID: &'static str = "Bitcoin";
const CONFIRMATIONS: usize = 3;

View File

@@ -10,7 +10,7 @@ use frost::{
sign::PreprocessMachine,
};
use serai_client::primitives::Balance;
use serai_client::primitives::{NetworkId, Balance};
#[cfg(feature = "bitcoin")]
pub mod bitcoin;
@@ -157,6 +157,7 @@ impl<E: Eventuality> Default for EventualitiesTracker<E> {
}
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 median_fee(&self) -> C::Fee;
@@ -249,6 +250,8 @@ pub trait Coin: 'static + Send + Sync + Clone + PartialEq + Eq + Debug {
+ TryInto<Vec<u8>>
+ TryFrom<Vec<u8>>;
/// Network ID for this coin.
const NETWORK: NetworkId;
/// String ID for this coin.
const ID: &'static str;
/// The amount of confirmations required to consider a block 'final'.

View File

@@ -26,7 +26,7 @@ use monero_serai::{
use tokio::time::sleep;
pub use serai_client::{
primitives::{MAX_DATA_LEN, MONERO, Amount, Balance},
primitives::{MAX_DATA_LEN, MONERO, MONERO_NET_ID, NetworkId, Amount, Balance},
coins::monero::Address,
};
@@ -217,6 +217,7 @@ impl Coin for Monero {
type Address = Address;
const NETWORK: NetworkId = MONERO_NET_ID;
const ID: &'static str = "Monero";
const CONFIRMATIONS: usize = 10;