(database_name: Option<&str>)
| 47 | |
| 48 | impl Storage { |
| 49 | pub(crate) fn new(database_name: Option<&str>) -> Result<Self> { |
| 50 | let database_name = database_name.unwrap_or(DATABASE_NAME); |
| 51 | let db = DB::open_default(Storage::path(database_name)) |
| 52 | .map_err(|e| ChainError::StorageCannotOpenDb(e.to_string()))?; |
| 53 | |
| 54 | Ok(Self { db }) |
| 55 | } |
| 56 | |
| 57 | pub(crate) fn _get_all_keys<K: AsRef<[u8]>>(&self) -> Result<Vec<Box<[u8]>>> { |
| 58 | let value: Vec<Box<[u8]>> = self |
nothing calls this directly
no outgoing calls
no test coverage detected