From 611436a9431b4fdc7860cb6ef996672455b47054 Mon Sep 17 00:00:00 2001 From: Rostyslav Tyshko Date: Fri, 23 May 2025 15:50:16 -0400 Subject: [PATCH] add getters for account --- storage/src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/storage/src/lib.rs b/storage/src/lib.rs index 625f19fe..0df1515d 100644 --- a/storage/src/lib.rs +++ b/storage/src/lib.rs @@ -468,6 +468,22 @@ impl RocksDBIO { } } + pub fn get_snapshot_account(&self) -> DbResult> { + let cf_snapshot = self.snapshot_column(); + let res = self + .db + .get_cf(&cf_snapshot, DB_SNAPSHOT_ACCOUNT_KEY) + .map_err(|rerr| DbError::rocksdb_cast_message(rerr, None))?; + + if let Some(data) = res { + Ok(data) + } else { + Err(DbError::db_interaction_error( + "Snapshot account not found".to_string(), + )) + } + } + } ///Creates address for sc data blob at corresponding id