(
&mut self,
sub_matches: &ArgMatches,
)
| 349 | } |
| 350 | |
| 351 | pub async fn handle_mock_l2_pegout_event_command( |
| 352 | &mut self, |
| 353 | sub_matches: &ArgMatches, |
| 354 | ) -> io::Result<()> { |
| 355 | let utxo = sub_matches.get_one::<String>("utxo").unwrap(); |
| 356 | let outpoint = OutPoint::from_str(utxo).expect( |
| 357 | "Could not parse the provided UTXO, please see help for the correct format: {e}.", |
| 358 | ); |
| 359 | |
| 360 | if let Some(operator_secret) = &self.config.keys.operator { |
| 361 | let (_, operator_public_key) = |
| 362 | generate_keys_from_secret(self.client.source_network, operator_secret); |
| 363 | |
| 364 | self.client.sync().await; |
| 365 | let mock_chain_service = get_mock_chain_service(outpoint, operator_public_key); |
| 366 | self.client.set_chain_service(mock_chain_service); |
| 367 | self.client.sync_l2().await; |
| 368 | self.client.flush().await; |
| 369 | } else { |
| 370 | return Err(io::Error::new( |
| 371 | io::ErrorKind::Other, |
| 372 | "Failed to set chain service, missing operator configuration", |
| 373 | )); |
| 374 | } |
| 375 | |
| 376 | Ok(()) |
| 377 | } |
| 378 | |
| 379 | pub fn get_automatic_command() -> Command { |
| 380 | Command::new("automatic") |
no test coverage detected