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

Method fetch_object

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

Source from the content-addressed store, hash-verified

193 }
194
195 async fn fetch_object(
196 &self,
197 file_name: &str,
198 file_path: Option<&str>,
199 ) -> Result<String, String> {
200 let response = self.get_object(file_name, file_path).await;
201 match response {
202 Ok(buffer) => {
203 let json = String::from_utf8(buffer);
204 match json {
205 Ok(json) => Ok(json),
206 Err(err) => Err(format!("Failed to parse json: {}", err)),
207 }
208 }
209 Err(err) => Err(format!("Failed to get json file: {}", err)),
210 }
211 }
212
213 async fn upload_object(
214 &self,

Callers 4

fetch_data_by_keyMethod · 0.45
test_sftpFunction · 0.45
test_ftpFunction · 0.45
test_ftpsFunction · 0.45

Calls 1

get_objectMethod · 0.45

Tested by 3

test_sftpFunction · 0.36
test_ftpFunction · 0.36
test_ftpsFunction · 0.36