(path: &Path)
| 43 | } |
| 44 | |
| 45 | pub 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 | |
| 56 | fn read_file(path: &Path) -> Option<String> { |
| 57 | match fs::read_to_string(path) { |