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

Method assert_final

bridge/src/graphs/peg_out.rs:1827–1842  ·  view source on GitHub ↗
(&mut self, client: &AsyncClient)

Source from the content-addressed store, hash-verified

1825 }
1826
1827 pub async fn assert_final(&mut self, client: &AsyncClient) -> Result<Transaction, Error> {
1828 verify_if_not_mined(client, self.assert_final_transaction.tx().compute_txid()).await?;
1829
1830 let assert_initial_txid = self.assert_initial_transaction.tx().compute_txid();
1831 let assert_initial_status = client.get_tx_status(&assert_initial_txid).await;
1832
1833 match assert_initial_status {
1834 Ok(status) => match status.confirmed {
1835 true => Ok(self.assert_final_transaction.finalize()),
1836 false => Err(Error::Graph(GraphError::PrecedingTxNotConfirmed(vec![
1837 NamedTx::for_tx(&self.assert_initial_transaction, status.confirmed),
1838 ]))),
1839 },
1840 Err(e) => Err(Error::Esplora(e)),
1841 }
1842 }
1843
1844 pub async fn disprove(
1845 &mut self,

Callers 2

test_peg_out_feesFunction · 0.80

Calls 3

verify_if_not_minedFunction · 0.85
txMethod · 0.45
finalizeMethod · 0.45

Tested by 1

test_peg_out_feesFunction · 0.64