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

Function read_scripts_from_file

bitvm/src/chunk/api.rs:448–462  ·  view source on GitHub ↗
(file: &str)

Source from the content-addressed store, hash-verified

446 }
447
448 pub fn read_scripts_from_file(file: &str) -> HashMap<u32, Vec<ScriptBuf>> {
449 let mut scr: HashMap<u32, Vec<ScriptBuf>> = HashMap::new();
450 let f = read_map_from_file(file).unwrap();
451 for (k, v) in f {
452 let vs: Vec<ScriptBuf> = v
453 .into_iter()
454 .map(|x| {
455 let bf = ScriptBuf::from_bytes(x);
456 bf
457 })
458 .collect();
459 scr.insert(k, vs);
460 }
461 scr
462 }
463
464 pub fn write_asserts_to_file(proof_asserts: Assertions, filename: &str) {
465 //let proof_asserts = mock_asserts();

Calls 1

read_map_from_fileFunction · 0.85