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

Function upload_object

bridge/src/client/data_store/ftp/lib.rs:94–108  ·  view source on GitHub ↗
(
    credentials: &FtpCredentials,
    file_name: &str,
    contents: &str,
    file_path: Option<&str>,
)

Source from the content-addressed store, hash-verified

92}
93
94pub async fn upload_object(
95 credentials: &FtpCredentials,
96 file_name: &str,
97 contents: &str,
98 file_path: Option<&str>,
99) -> Result<usize, String> {
100 let size = contents.len();
101
102 println!("Writing data file to {} (size: {})", file_name, size);
103
104 match upload_file(credentials, file_name, contents.as_bytes(), file_path).await {
105 Ok(_) => Ok(size),
106 Err(err) => Err(format!("Failed to save json file: {}", err)),
107 }
108}
109
110pub async fn fetch_compressed_object(
111 credentials: &FtpCredentials,

Callers 2

upload_objectMethod · 0.85
upload_objectMethod · 0.85

Calls 2

upload_fileFunction · 0.85
lenMethod · 0.80

Tested by

no test coverage detected