Remove unused ID -> number lookup

This commit is contained in:
Luke Parker 2024-08-30 00:11:31 -04:00
parent 775824f373
commit d429a0bae6

View file

@ -4,8 +4,6 @@ create_db!(
ScannerIndex {
// A lookup of a block's number to its ID
BlockId: (number: u64) -> [u8; 32],
// A lookup of a block's ID to its number
BlockNumber: (id: [u8; 32]) -> u64,
// The latest finalized block to appear on the blockchain
LatestFinalizedBlock: () -> u64,
@ -16,14 +14,10 @@ pub(crate) struct IndexDb;
impl IndexDb {
pub(crate) fn set_block(txn: &mut impl DbTxn, number: u64, id: [u8; 32]) {
BlockId::set(txn, number, &id);
BlockNumber::set(txn, id, &number);
}
pub(crate) fn block_id(getter: &impl Get, number: u64) -> Option<[u8; 32]> {
BlockId::get(getter, number)
}
pub(crate) fn block_number(getter: &impl Get, id: [u8; 32]) -> Option<u64> {
BlockNumber::get(getter, id)
}
pub(crate) fn set_latest_finalized_block(txn: &mut impl DbTxn, latest_finalized_block: u64) {
LatestFinalizedBlock::set(txn, &latest_finalized_block);