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

Method handle_signatures

bridge/src/client/cli/query_command.rs:427–496  ·  view source on GitHub ↗
(
        &mut self,
        matches: &ArgMatches,
        destination_network: DestinationNetwork,
    )

Source from the content-addressed store, hash-verified

425 }
426
427 pub async fn handle_signatures(
428 &mut self,
429 matches: &ArgMatches,
430 destination_network: DestinationNetwork,
431 ) -> Response {
432 let args = vec![
433 "DEPOSITOR_PUBLIC_KEY".to_string(),
434 "DESTINATION_CHAIN_ADDRESS".into(),
435 "OUTPOINT".into(),
436 "SATS".into(),
437 "DEPOSIT".into(),
438 "CONFIRM".into(),
439 "REFUND".into(),
440 ];
441 let validate_result = match validate(matches, args, destination_network) {
442 Ok(result) => result,
443 Err(err) => return err,
444 };
445 let (pubkey, chain_address, outpoint, satoshis, deposit, confirm, refund) =
446 match &validate_result[..] {
447 [arg1, arg2, arg3, arg4, arg5, arg6, arg7, ..] => {
448 match (arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
449 (
450 ArgType::DepositorPublicKey(pubkey),
451 ArgType::ChainAddress(chain_address),
452 ArgType::OutPoint(outpoint),
453 ArgType::Satoshis(satoshis),
454 ArgType::EcdsaSignature(deposit),
455 ArgType::TaprootSignature(confirm),
456 ArgType::TaprootSignature(refund),
457 ) => (
458 pubkey,
459 chain_address,
460 outpoint,
461 satoshis,
462 deposit,
463 confirm,
464 refund,
465 ),
466 _ => unreachable!(),
467 }
468 }
469 _ => unreachable!(),
470 };
471 let x_only_pubkey = XOnlyPublicKey::from(*pubkey);
472
473 self.sync().await;
474 let result = self
475 .client
476 .create_peg_in_graph_with_depositor_signatures(
477 pubkey,
478 &x_only_pubkey,
479 Input {
480 outpoint: *outpoint,
481 amount: *satoshis,
482 },
483 chain_address.to_string().as_str(),
484 &DepositorSignatures {

Callers 1

mainFunction · 0.80

Calls 3

validateFunction · 0.85
syncMethod · 0.45

Tested by

no test coverage detected