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

Method fetch_object

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

Source from the content-addressed store, hash-verified

136 }
137
138 async fn fetch_object(
139 &self,
140 file_name: &str,
141 file_path: Option<&str>,
142 ) -> Result<String, String> {
143 let response = self.get_object(file_name, file_path).await;
144 match response {
145 Ok(buffer) => {
146 let json = String::from_utf8(buffer);
147 match json {
148 Ok(json) => Ok(json),
149 Err(err) => Err(format!("Failed to parse json: {}", err)),
150 }
151 }
152 Err(err) => Err(format!("Failed to get json file: {}", err)),
153 }
154 }
155
156 async fn upload_object(
157 &self,

Callers

nothing calls this directly

Calls 1

get_objectMethod · 0.45

Tested by

no test coverage detected