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

Method new_for_validation

bridge/src/transactions/start_time.rs:94–128  ·  view source on GitHub ↗
(
        network: Network,
        operator_public_key: &PublicKey,
        connector_2: &Connector2,
        input_0: Input,
    )

Source from the content-addressed store, hash-verified

92 }
93
94 pub fn new_for_validation(
95 network: Network,
96 operator_public_key: &PublicKey,
97 connector_2: &Connector2,
98 input_0: Input,
99 ) -> Self {
100 let input_0_leaf = 0;
101 let _input_0 = connector_2.generate_taproot_leaf_tx_in(input_0_leaf, &input_0);
102
103 let total_output_amount = input_0.amount - Amount::from_sat(MIN_RELAY_FEE_START_TIME);
104
105 let _output_0 = TxOut {
106 value: total_output_amount,
107 script_pubkey: generate_pay_to_pubkey_script_address(network, operator_public_key)
108 .script_pubkey(),
109 };
110
111 StartTimeTransaction {
112 tx: Transaction {
113 version: bitcoin::transaction::Version(2),
114 lock_time: absolute::LockTime::ZERO,
115 input: vec![_input_0],
116 output: vec![_output_0],
117 },
118 prev_outs: vec![TxOut {
119 value: input_0.amount,
120 script_pubkey: connector_2.generate_taproot_address().script_pubkey(),
121 }],
122 prev_scripts: vec![connector_2.generate_taproot_leaf_script(input_0_leaf)],
123 start_time_witness: None,
124 musig2_nonces: HashMap::new(),
125 musig2_nonce_signatures: HashMap::new(),
126 musig2_signatures: HashMap::new(),
127 }
128 }
129
130 fn sign_input_0(
131 &mut self,

Callers

nothing calls this directly

Tested by

no test coverage detected