MCPcopy Index your code
hub / github.com/BitVM/BitVM / sign

Method sign

bridge/src/transactions/assert_transactions/assert_commit_2.rs:100–127  ·  view source on GitHub ↗
(&mut self, connectors_e: &AssertCommit2ConnectorsE, witnesses: Vec<RawWitness>)

Source from the content-addressed store, hash-verified

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