mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 21:19:24 +00:00
Requires splitting `serai-cosign` into `serai-cosign` and `serai-cosign-types` so the processor don't require `serai-client/serai` (not correct yet).
27 lines
675 B
Rust
27 lines
675 B
Rust
use serai_db::{Get, DbTxn, create_db};
|
|
|
|
use serai_primitives::validator_sets::Session;
|
|
|
|
create_db!(
|
|
ScannerBatch {
|
|
// The last session to sign a Batch and their first Batch signed
|
|
LastSessionToSignBatchAndFirstBatch: () -> (Session, u32),
|
|
}
|
|
);
|
|
|
|
pub(crate) struct BatchDb;
|
|
impl BatchDb {
|
|
pub(crate) fn set_last_session_to_sign_batch_and_first_batch(
|
|
txn: &mut impl DbTxn,
|
|
session: Session,
|
|
id: u32,
|
|
) {
|
|
LastSessionToSignBatchAndFirstBatch::set(txn, &(session, id));
|
|
}
|
|
pub(crate) fn last_session_to_sign_batch_and_first_batch(
|
|
getter: &impl Get,
|
|
) -> Option<(Session, u32)> {
|
|
LastSessionToSignBatchAndFirstBatch::get(getter)
|
|
}
|
|
}
|