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

Method fetch_compressed_object

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

Source from the content-addressed store, hash-verified

133 }
134
135 async fn fetch_compressed_object(
136 &self,
137 file_name: &str,
138 file_path: Option<&str>,
139 ) -> Result<(Vec<u8>, usize), String> {
140 let response = self.get_object(file_name, file_path).await;
141 match response {
142 Ok(buffer) => {
143 let size = buffer.len();
144 Ok((decompress(&buffer).map_err(err_to_string)?, size))
145 }
146 Err(err) => Err(format!("Failed to get json file: {}", err)),
147 }
148 }
149
150 async fn upload_compressed_object(
151 &self,

Callers

nothing calls this directly

Calls 3

decompressFunction · 0.85
lenMethod · 0.80
get_objectMethod · 0.45

Tested by

no test coverage detected