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

Method new_for_validation

bridge/src/transactions/kick_off_timeout.rs:84–118  ·  view source on GitHub ↗
(network: Network, connector_1: &Connector1, input_0: Input)

Source from the content-addressed store, hash-verified

82 }
83
84 pub fn new_for_validation(network: Network, connector_1: &Connector1, input_0: Input) -> Self {
85 let input_0_leaf = 1;
86 let _input_0 = connector_1.generate_taproot_leaf_tx_in(input_0_leaf, &input_0);
87
88 let total_output_amount = input_0.amount - Amount::from_sat(MIN_RELAY_FEE_KICK_OFF_TIMEOUT);
89
90 let _output_0 = TxOut {
91 value: total_output_amount * 95 / 100,
92 script_pubkey: generate_burn_script_address(network).script_pubkey(),
93 };
94
95 let reward_output_amount = total_output_amount - (total_output_amount * 95 / 100);
96 let _output_1 = TxOut {
97 value: reward_output_amount,
98 script_pubkey: ScriptBuf::default(),
99 };
100
101 KickOffTimeoutTransaction {
102 tx: Transaction {
103 version: bitcoin::transaction::Version(2),
104 lock_time: absolute::LockTime::ZERO,
105 input: vec![_input_0],
106 output: vec![_output_0, _output_1],
107 },
108 prev_outs: vec![TxOut {
109 value: input_0.amount,
110 script_pubkey: connector_1.generate_taproot_address().script_pubkey(),
111 }],
112 prev_scripts: vec![connector_1.generate_taproot_leaf_script(input_0_leaf)],
113 reward_output_amount,
114 musig2_nonces: HashMap::new(),
115 musig2_nonce_signatures: HashMap::new(),
116 musig2_signatures: HashMap::new(),
117 }
118 }
119
120 fn sign_input_0(
121 &mut self,

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected