(
&mut self,
client: &AsyncClient,
commitment_secrets: &HashMap<CommitmentMessageId, WinternitzSecret>,
proof: &RawProof,
)
| 1733 | } |
| 1734 | |
| 1735 | pub async fn assert_commit_1( |
| 1736 | &mut self, |
| 1737 | client: &AsyncClient, |
| 1738 | commitment_secrets: &HashMap<CommitmentMessageId, WinternitzSecret>, |
| 1739 | proof: &RawProof, |
| 1740 | ) -> Result<Transaction, Error> { |
| 1741 | verify_if_not_mined(client, self.assert_commit_1_transaction.tx().compute_txid()).await?; |
| 1742 | |
| 1743 | let assert_initial_txid = self.assert_initial_transaction.tx().compute_txid(); |
| 1744 | let assert_initial_status = client.get_tx_status(&assert_initial_txid).await; |
| 1745 | |
| 1746 | match assert_initial_status { |
| 1747 | Ok(status) => match status.confirmed { |
| 1748 | true => { |
| 1749 | let (witness_for_commit1, _) = |
| 1750 | sign_assert_tx_with_groth16_proof(commitment_secrets, proof); |
| 1751 | self.assert_commit_1_transaction |
| 1752 | .sign(&self.connector_e_1, witness_for_commit1); |
| 1753 | Ok(self.assert_commit_1_transaction.finalize()) |
| 1754 | } |
| 1755 | false => Err(Error::Graph(GraphError::PrecedingTxNotConfirmed(vec![ |
| 1756 | NamedTx::for_tx(&self.assert_initial_transaction, status.confirmed), |
| 1757 | ]))), |
| 1758 | }, |
| 1759 | Err(e) => Err(Error::Esplora(e)), |
| 1760 | } |
| 1761 | } |
| 1762 | |
| 1763 | pub async fn assert_commit_2( |
| 1764 | &mut self, |
no test coverage detected