Remove final references to scale in coordinator/processor

Slight tweaks to processor
This commit is contained in:
Luke Parker
2025-09-02 02:41:20 -04:00
parent ada94e8c5d
commit 5736b87b57
10 changed files with 16 additions and 95 deletions

View File

@@ -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)
}
}