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

Method fetch_object

bridge/src/client/data_store/local_file.rs:102–118  ·  view source on GitHub ↗
(
        &self,
        file_name: &str,
        file_path: Option<&str>,
    )

Source from the content-addressed store, hash-verified

100 }
101
102 async fn fetch_object(
103 &self,
104 file_name: &str,
105 file_path: Option<&str>,
106 ) -> Result<String, String> {
107 let response = self.get_object(file_name, file_path).await;
108 match response {
109 Ok(buffer) => {
110 let json = String::from_utf8(buffer);
111 match json {
112 Ok(json) => Ok(json),
113 Err(err) => Err(format!("Failed to parse json: {}", err)),
114 }
115 }
116 Err(err) => Err(format!("Failed to get json file: {}", err)),
117 }
118 }
119
120 async fn upload_object(
121 &self,

Callers

nothing calls this directly

Calls 1

get_objectMethod · 0.45

Tested by

no test coverage detected