Misc tidying of serai-db calls

This commit is contained in:
Luke Parker
2024-09-11 09:12:00 -04:00
parent 59fa49f750
commit 9b8c8f8231
6 changed files with 46 additions and 49 deletions

View File

@@ -54,9 +54,7 @@ impl<S: ScannerFeed> ReportDb<S> {
}
pub(crate) fn take_block_number_for_batch(txn: &mut impl DbTxn, id: u32) -> Option<u64> {
let block_number = BlockNumberForBatch::get(txn, id)?;
BlockNumberForBatch::del(txn, id);
Some(block_number)
BlockNumberForBatch::take(txn, id)
}
pub(crate) fn save_external_key_for_session_to_sign_batch(
@@ -103,8 +101,7 @@ impl<S: ScannerFeed> ReportDb<S> {
txn: &mut impl DbTxn,
id: u32,
) -> Option<Vec<Option<ReturnInformation<S>>>> {
let buf = SerializedReturnAddresses::get(txn, id)?;
SerializedReturnAddresses::del(txn, id);
let buf = SerializedReturnAddresses::take(txn, id)?;
let mut buf = buf.as_slice();
let mut res = Vec::with_capacity(buf.len() / (32 + 1 + 8));