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

Method write_config

bridge/src/client/cli/key_command.rs:180–188  ·  view source on GitHub ↗
(&self, config: &Config)

Source from the content-addressed store, hash-verified

178 }
179
180 pub fn write_config(&self, config: &Config) -> io::Result<()> {
181 let toml_string = toml::to_string(config).expect("Failed to serialize config");
182 let mut file = OpenOptions::new()
183 .create(true)
184 .write(true)
185 .truncate(true)
186 .open(&self.config_path)?;
187 file.write_all(toml_string.as_bytes())
188 }
189
190 fn validate_key(&self, key: &str) -> bool {
191 key.len() == 64 && key.chars().all(|c| c.is_ascii_hexdigit())

Callers 1

handle_commandMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected