MCPcopy Create free account
hub / github.com/ddimaria/rust-blockchain-tutorial / _destroy

Method _destroy

chain/src/storage.rs:68–74  ·  view source on GitHub ↗
(database_name: Option<&str>)

Source from the content-addressed store, hash-verified

66 }
67
68 pub(crate) fn _destroy(database_name: Option<&str>) -> Result<()> {
69 let database_name = database_name.unwrap_or(DATABASE_NAME);
70 DB::destroy(&Options::default(), Storage::path(database_name))
71 .map_err(|e| ChainError::StorageDestroyError(e.into()))?;
72
73 Ok(())
74 }
75
76 pub(crate) fn key_string<K: AsRef<[u8]>>(key: K) -> String {
77 String::from_utf8(key.as_ref().to_vec()).unwrap_or_else(|_| "UNKNOWN".into())

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected