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

Method sign

bridge/src/transactions/assert_transactions/assert_commit_1.rs:99–126  ·  view source on GitHub ↗
(&mut self, connectors_e: &AssertCommit1ConnectorsE, witnesses: Vec<RawWitness>)

Source from the content-addressed store, hash-verified

97 }
98
99 pub fn sign(&mut self, connectors_e: &AssertCommit1ConnectorsE, witnesses: Vec<RawWitness>) {
100 assert_eq!(witnesses.len(), connectors_e.connectors_num());
101 for (input_index, witness) in (0..connectors_e.connectors_num()).zip(witnesses) {
102 let taproot_spend_info = connectors_e
103 .get_connector_e(input_index)
104 .generate_taproot_spend_info();
105 let script = &self.prev_scripts()[input_index].clone();
106 let res = execute_raw_script_with_inputs(script.clone().to_bytes(), witness.clone());
107 assert!(
108 res.success,
109 "script: {:?}, res: {:?}: stack: {:?}, variable name: {:?}",
110 script,
111 res,
112 res.final_stack,
113 connectors_e
114 .get_connector_e(input_index)
115 .commitment_public_keys
116 .keys()
117 );
118 populate_taproot_input_witness(
119 self.tx_mut(),
120 input_index,
121 &taproot_spend_info,
122 script,
123 witness,
124 );
125 }
126 }
127
128 pub fn merge(&mut self, assert_commit_1: &AssertCommit1Transaction) {
129 merge_transactions(&mut self.tx, &assert_commit_1.tx);

Callers

nothing calls this directly

Calls 9

connectors_numMethod · 0.80
get_connector_eMethod · 0.80
cloneMethod · 0.80
zipMethod · 0.45
prev_scriptsMethod · 0.45
tx_mutMethod · 0.45

Tested by

no test coverage detected