use this when possible broadcast assert commits together to save groth16 verifying time
(
&mut self,
peg_out_graph_id: &String,
proof: &RawProof,
)
| 1203 | // use this when possible |
| 1204 | // broadcast assert commits together to save groth16 verifying time |
| 1205 | pub async fn broadcast_assert_commits( |
| 1206 | &mut self, |
| 1207 | peg_out_graph_id: &String, |
| 1208 | proof: &RawProof, |
| 1209 | ) -> Result<(Txid, Txid), Error> { |
| 1210 | let graph = Self::find_peg_out_or_fail(&mut self.data, peg_out_graph_id)?; |
| 1211 | let (commit1_tx, commit2_tx) = graph |
| 1212 | .assert_commits( |
| 1213 | &self.esplora, |
| 1214 | &self.private_data.commitment_secrets |
| 1215 | [&self.operator_context.as_ref().unwrap().operator_public_key] |
| 1216 | [peg_out_graph_id], |
| 1217 | proof, |
| 1218 | ) |
| 1219 | .await?; |
| 1220 | Ok(( |
| 1221 | self.broadcast_tx(&commit1_tx).await?, |
| 1222 | self.broadcast_tx(&commit2_tx).await?, |
| 1223 | )) |
| 1224 | } |
| 1225 | |
| 1226 | pub async fn broadcast_assert_final( |
| 1227 | &mut self, |