MCPcopy Create free account
hub / github.com/BitVM/BitVM / fetch_data_by_key

Method fetch_data_by_key

bridge/src/client/data_store/data_store.rs:89–107  ·  view source on GitHub ↗
(
        &self,
        key: &String,
        file_path: Option<&str>,
    )

Source from the content-addressed store, hash-verified

87 }
88
89 pub async fn fetch_data_by_key(
90 &self,
91 key: &String,
92 file_path: Option<&str>,
93 ) -> Result<Option<String>, String> {
94 match self.get_driver() {
95 Ok(driver) => {
96 let json = driver.fetch_object(key, file_path).await;
97 if let Ok(data) = json {
98 // println!("Fetched data file: {}", key);
99 return Ok(Some(data));
100 }
101
102 println!("No data file {} found", key);
103 Ok(None)
104 }
105 Err(err) => Err(err.to_string()),
106 }
107 }
108
109 pub async fn write_data(
110 &self,

Callers

nothing calls this directly

Calls 2

get_driverMethod · 0.80
fetch_objectMethod · 0.45

Tested by

no test coverage detected