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

Method fetch_compressed_object

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

Source from the content-addressed store, hash-verified

169 }
170
171 async fn fetch_compressed_object(
172 &self,
173 file_name: &str,
174 file_path: Option<&str>,
175 ) -> Result<(Vec<u8>, usize), String> {
176 let response = self.get_object(file_name, file_path).await;
177 match response {
178 Ok(buffer) => {
179 let size = buffer.len();
180 Ok((decompress(&buffer).map_err(err_to_string)?, size))
181 }
182 Err(err) => Err(format!("Failed to get json file: {}", err)),
183 }
184 }
185
186 async fn upload_compressed_object(
187 &self,

Callers

nothing calls this directly

Calls 3

decompressFunction · 0.85
lenMethod · 0.80
get_objectMethod · 0.45

Tested by

no test coverage detected