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

Function get_private_data_from_file

bridge/src/client/files.rs:45–54  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

43}
44
45pub fn get_private_data_from_file(path: &Path) -> BitVMClientPrivateData {
46 match read_file(path) {
47 Some(data) => try_deserialize::<BitVMClientPrivateData>(&data)
48 .expect("Could not deserialize private data"),
49 None => BitVMClientPrivateData {
50 secret_nonces: HashMap::new(),
51 commitment_secrets: HashMap::new(),
52 },
53 }
54}
55
56fn read_file(path: &Path) -> Option<String> {
57 match fs::read_to_string(path) {

Callers 1

newMethod · 0.85

Calls 1

read_fileFunction · 0.85

Tested by

no test coverage detected