mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 12:49:23 +00:00
Satisfy Scheduler for Bitcoin
This commit is contained in:
@@ -17,8 +17,6 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
async-trait = { version = "0.1", default-features = false }
|
||||
|
||||
borsh = { version = "1", default-features = false, features = ["std", "derive", "de_strict_order"] }
|
||||
|
||||
serai-primitives = { path = "../../../../substrate/primitives", default-features = false, features = ["std"] }
|
||||
|
||||
@@ -39,7 +39,6 @@ pub struct AmortizePlannedTransaction<S: ScannerFeed, ST: SignableTransaction, A
|
||||
}
|
||||
|
||||
/// An object able to plan a transaction.
|
||||
#[async_trait::async_trait]
|
||||
pub trait TransactionPlanner<S: ScannerFeed, A>: 'static + Send + Sync {
|
||||
/// The type representing a fee rate to use for transactions.
|
||||
type FeeRate: Clone + Copy;
|
||||
|
||||
@@ -203,6 +203,9 @@ impl<S: ScannerFeed, P: TransactionPlanner<S, ()>> Scheduler<S, P> {
|
||||
// Fetch the operating costs/outputs
|
||||
let mut operating_costs = Db::<S>::operating_costs(txn, coin).0;
|
||||
let outputs = Db::<S>::outputs(txn, key, coin).unwrap();
|
||||
if outputs.is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Fetch the fulfillable payments
|
||||
let payments = Self::fulfillable_payments(
|
||||
|
||||
@@ -23,7 +23,7 @@ mod db;
|
||||
use db::Db;
|
||||
|
||||
/// The outputs which will be effected by a PlannedTransaction and received by Serai.
|
||||
pub struct EffectedReceivedOutputs<S: ScannerFeed>(Vec<OutputFor<S>>);
|
||||
pub struct EffectedReceivedOutputs<S: ScannerFeed>(pub Vec<OutputFor<S>>);
|
||||
|
||||
/// A scheduler of transactions for networks premised on the UTXO model which support
|
||||
/// transaction chaining.
|
||||
@@ -179,6 +179,9 @@ impl<S: ScannerFeed, P: TransactionPlanner<S, EffectedReceivedOutputs<S>>> Sched
|
||||
// Fetch the operating costs/outputs
|
||||
let mut operating_costs = Db::<S>::operating_costs(txn, coin).0;
|
||||
let outputs = Db::<S>::outputs(txn, key, coin).unwrap();
|
||||
if outputs.is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Fetch the fulfillable payments
|
||||
let payments = Self::fulfillable_payments(
|
||||
|
||||
Reference in New Issue
Block a user