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

Method broadcast_challenge

bridge/src/client/client.rs:1126–1156  ·  view source on GitHub ↗
(
        &mut self,
        peg_out_graph_id: &String,
        crowdfundng_inputs: &Vec<InputWithScript<'_>>,
        output_script_pubkey: ScriptBuf,
    )

Source from the content-addressed store, hash-verified

1124 }
1125
1126 pub async fn broadcast_challenge(
1127 &mut self,
1128 peg_out_graph_id: &String,
1129 crowdfundng_inputs: &Vec<InputWithScript<'_>>,
1130 output_script_pubkey: ScriptBuf,
1131 ) -> Result<Txid, Error> {
1132 let graph = Self::find_peg_out_or_fail(&mut self.data, peg_out_graph_id)?;
1133
1134 let keypair = match (
1135 self.depositor_context.as_ref(),
1136 self.operator_context.as_ref(),
1137 self.verifier_context.as_ref(),
1138 self.withdrawer_context.as_ref(),
1139 ) {
1140 (Some(c), _, _, _) => &c.depositor_keypair,
1141 (_, Some(c), _, _) => &c.operator_keypair,
1142 (_, _, Some(c), _) => &c.verifier_keypair,
1143 (_, _, _, Some(c)) => &c.withdrawer_keypair,
1144 _ => Err(Error::Client(ClientError::NoUserContextDefined))?,
1145 };
1146
1147 let tx = graph
1148 .challenge(
1149 &self.esplora,
1150 crowdfundng_inputs,
1151 keypair,
1152 output_script_pubkey,
1153 )
1154 .await?;
1155 self.broadcast_tx(&tx).await
1156 }
1157
1158 pub async fn broadcast_assert_initial(
1159 &mut self,

Calls 3

as_refMethod · 0.80
challengeMethod · 0.80
broadcast_txMethod · 0.80