mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Remove final references to scale in coordinator/processor
Slight tweaks to processor
This commit is contained in:
@@ -7,7 +7,6 @@ use serai_primitives::{
|
||||
balance::{Amount, ExternalBalance},
|
||||
};
|
||||
|
||||
use borsh::BorshDeserialize;
|
||||
use serai_db::{Get, DbTxn, create_db, db_channel};
|
||||
|
||||
use primitives::{Payment, ReceivedOutput};
|
||||
@@ -22,9 +21,10 @@ create_db! {
|
||||
}
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
db_channel! {
|
||||
UtxoScheduler {
|
||||
PendingBranch: (key: &[u8], balance: ExternalBalance) -> Vec<u8>,
|
||||
PendingBranch: <S: ScannerFeed>(key: &[u8], balance: ExternalBalance) -> TreeTransaction<AddressFor<S>>,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,14 +103,13 @@ impl<S: ScannerFeed> Db<S> {
|
||||
balance: ExternalBalance,
|
||||
child: &TreeTransaction<AddressFor<S>>,
|
||||
) {
|
||||
PendingBranch::send(txn, key.to_bytes().as_ref(), balance, &borsh::to_vec(child).unwrap())
|
||||
PendingBranch::<S>::send(txn, key.to_bytes().as_ref(), balance, child)
|
||||
}
|
||||
pub(crate) fn take_pending_branch(
|
||||
txn: &mut impl DbTxn,
|
||||
key: KeyFor<S>,
|
||||
balance: ExternalBalance,
|
||||
) -> Option<TreeTransaction<AddressFor<S>>> {
|
||||
PendingBranch::try_recv(txn, key.to_bytes().as_ref(), balance)
|
||||
.map(|bytes| TreeTransaction::<AddressFor<S>>::deserialize(&mut bytes.as_slice()).unwrap())
|
||||
PendingBranch::<S>::try_recv(txn, key.to_bytes().as_ref(), balance)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user