mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-07-22 07:40:18 +00:00
fix(storage): rename ZonCursor to ZoneAnchor
This commit is contained in:
parent
e3442c695f
commit
61f17612d9
@ -204,11 +204,11 @@ impl SequencerStore {
|
||||
/// The last channel block read back and verified from Bedrock (L1 slot +
|
||||
/// `id`/`hash`), or `None` before any block has been read from the channel.
|
||||
pub fn get_zone_anchor(&self) -> DbResult<Option<ZoneAnchorRecord>> {
|
||||
self.dbio.get_zone_cursor()
|
||||
self.dbio.get_zone_anchor()
|
||||
}
|
||||
|
||||
pub fn set_zone_anchor(&self, anchor: &ZoneAnchorRecord) -> DbResult<()> {
|
||||
self.dbio.put_zone_cursor(anchor)
|
||||
self.dbio.put_zone_anchor(anchor)
|
||||
}
|
||||
|
||||
pub fn get_unfulfilled_deposit_events(&self) -> DbResult<Vec<PendingDepositEventRecord>> {
|
||||
|
||||
@ -22,7 +22,7 @@ use crate::{
|
||||
LEEStateCellOwned, LEEStateCellRef, LastFinalizedBlockIdCell, LatestBlockMetaCellOwned,
|
||||
LatestBlockMetaCellRef, PendingDepositEventRecord, PendingDepositEventsCellOwned,
|
||||
PendingDepositEventsCellRef, UnseenWithdrawCountCell, WithdrawalReconciliationKey,
|
||||
ZoneAnchorRecord, ZoneCursorCell, ZoneSdkCheckpointCellOwned, ZoneSdkCheckpointCellRef,
|
||||
ZoneAnchorCell, ZoneAnchorRecord, ZoneSdkCheckpointCellOwned, ZoneSdkCheckpointCellRef,
|
||||
},
|
||||
};
|
||||
|
||||
@ -364,12 +364,12 @@ impl RocksDBIO {
|
||||
self.del::<ZoneSdkCheckpointCellOwned>(())
|
||||
}
|
||||
|
||||
pub fn get_zone_cursor(&self) -> DbResult<Option<ZoneAnchorRecord>> {
|
||||
Ok(self.get_opt::<ZoneCursorCell>(())?.map(|cell| cell.0))
|
||||
pub fn get_zone_anchor(&self) -> DbResult<Option<ZoneAnchorRecord>> {
|
||||
Ok(self.get_opt::<ZoneAnchorCell>(())?.map(|cell| cell.0))
|
||||
}
|
||||
|
||||
pub fn put_zone_cursor(&self, anchor: &ZoneAnchorRecord) -> DbResult<()> {
|
||||
self.put(&ZoneCursorCell(*anchor), ())
|
||||
pub fn put_zone_anchor(&self, anchor: &ZoneAnchorRecord) -> DbResult<()> {
|
||||
self.put(&ZoneAnchorCell(*anchor), ())
|
||||
}
|
||||
|
||||
pub fn get_pending_deposit_events(&self) -> DbResult<Vec<PendingDepositEventRecord>> {
|
||||
|
||||
@ -147,18 +147,18 @@ pub struct ZoneAnchorRecord {
|
||||
}
|
||||
|
||||
#[derive(Debug, BorshSerialize, BorshDeserialize)]
|
||||
pub struct ZoneCursorCell(pub ZoneAnchorRecord);
|
||||
pub struct ZoneAnchorCell(pub ZoneAnchorRecord);
|
||||
|
||||
impl SimpleStorableCell for ZoneCursorCell {
|
||||
impl SimpleStorableCell for ZoneAnchorCell {
|
||||
type KeyParams = ();
|
||||
|
||||
const CELL_NAME: &'static str = DB_META_ZONE_CURSOR_KEY;
|
||||
const CF_NAME: &'static str = CF_META_NAME;
|
||||
}
|
||||
|
||||
impl SimpleReadableCell for ZoneCursorCell {}
|
||||
impl SimpleReadableCell for ZoneAnchorCell {}
|
||||
|
||||
impl SimpleWritableCell for ZoneCursorCell {
|
||||
impl SimpleWritableCell for ZoneAnchorCell {
|
||||
fn value_constructor(&self) -> DbResult<Vec<u8>> {
|
||||
borsh::to_vec(&self).map_err(|err| {
|
||||
DbError::borsh_cast_message(err, Some("Failed to serialize zone cursor".to_owned()))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user