diff --git a/lez/sequencer/core/src/block_store.rs b/lez/sequencer/core/src/block_store.rs index e58ac644..3a2de375 100644 --- a/lez/sequencer/core/src/block_store.rs +++ b/lez/sequencer/core/src/block_store.rs @@ -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> { - 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> { diff --git a/lez/storage/src/sequencer/mod.rs b/lez/storage/src/sequencer/mod.rs index 8910b044..47ebc41b 100644 --- a/lez/storage/src/sequencer/mod.rs +++ b/lez/storage/src/sequencer/mod.rs @@ -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::(()) } - pub fn get_zone_cursor(&self) -> DbResult> { - Ok(self.get_opt::(())?.map(|cell| cell.0)) + pub fn get_zone_anchor(&self) -> DbResult> { + Ok(self.get_opt::(())?.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> { diff --git a/lez/storage/src/sequencer/sequencer_cells.rs b/lez/storage/src/sequencer/sequencer_cells.rs index 302a0b97..368fb648 100644 --- a/lez/storage/src/sequencer/sequencer_cells.rs +++ b/lez/storage/src/sequencer/sequencer_cells.rs @@ -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> { borsh::to_vec(&self).map_err(|err| { DbError::borsh_cast_message(err, Some("Failed to serialize zone cursor".to_owned()))