Remove serai from the cosign evaluator

This commit is contained in:
Luke Parker
2024-12-25 23:21:25 -05:00
parent 56af6c44eb
commit 2aebfb21af
4 changed files with 146 additions and 176 deletions

View File

@@ -143,6 +143,19 @@ macro_rules! db_channel {
Self::set(txn, $($arg,)* index_to_use, value);
}
pub(crate) fn peek(
txn: &mut impl DbTxn
$(, $arg: $arg_type)*
) -> Option<$field_type> {
let messages_recvd_key = Self::key($($arg,)* 1);
let messages_recvd = txn.get(&messages_recvd_key).map(|counter| {
u32::from_le_bytes(counter.try_into().unwrap())
}).unwrap_or(0);
let index_to_read = messages_recvd + 2;
Self::get(txn, $($arg,)* index_to_read)
}
pub(crate) fn try_recv(
txn: &mut impl DbTxn
$(, $arg: $arg_type)*