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

Function write_scripts_to_file

bitvm/src/chunk/api.rs:422–429  ·  view source on GitHub ↗
(sig_cache: HashMap<u32, Vec<ScriptBuf>>, file: &str)

Source from the content-addressed store, hash-verified

420 }
421
422 pub fn write_scripts_to_file(sig_cache: HashMap<u32, Vec<ScriptBuf>>, file: &str) {
423 let mut buf: HashMap<u32, Vec<Vec<u8>>> = HashMap::new();
424 for (k, v) in sig_cache {
425 let vs = v.into_iter().map(|x| x.to_bytes()).collect();
426 buf.insert(k, vs);
427 }
428 write_map_to_file(&buf, file).unwrap();
429 }
430
431 pub fn write_scripts_to_separate_files(
432 sig_cache: HashMap<u32, Vec<ScriptBuf>>,

Callers 1

Calls 1

write_map_to_fileFunction · 0.85

Tested by 1