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

Method handle_mock_l2_pegout_event_command

bridge/src/client/cli/client_command.rs:351–377  ·  view source on GitHub ↗
(
        &mut self,
        sub_matches: &ArgMatches,
    )

Source from the content-addressed store, hash-verified

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")

Callers 2

mainFunction · 0.80

Calls 6

get_mock_chain_serviceFunction · 0.85
set_chain_serviceMethod · 0.80
sync_l2Method · 0.80
syncMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected