Trait TxSenderDatabase

Source
pub trait TxSenderDatabase:
    Send
    + Sync
    + Clone {
    type Transaction: Send;

Show 27 methods // Required methods fn begin_transaction<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Transaction, BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn commit_transaction<'life0, 'async_trait>( &'life0 self, dbtx: Self::Transaction, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn save_tx_debug_submission_error<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, error: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_sendable_txs<'life0, 'async_trait>( &'life0 self, fee_rate: FeeRate, current_tip_height: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<u32>, BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_try_to_send_tx<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, ) -> Pin<Box<dyn Future<Output = Result<(Option<TxMetadata>, Transaction, FeePayingType, Option<u32>, Option<RbfSigningInfo>), BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update_tx_debug_sending_state<'life0, 'life1, 'async_trait>( &'life0 self, id: u32, state: &'life1 str, is_error: bool, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_all_unconfirmed_fee_payer_txs<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, ) -> Pin<Box<dyn Future<Output = Result<Vec<(u32, u32, Txid, u32, Amount, Option<u32>)>, BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_unconfirmed_fee_payer_txs<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, bumped_id: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<(u32, Txid, u32, Amount)>, BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn mark_fee_payer_utxo_as_evicted<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_confirmed_fee_payer_utxos<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<(Txid, u32, Amount)>, BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn save_fee_payer_tx<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, try_to_send_id: Option<u32>, bumped_id: u32, fee_payer_txid: Txid, vout: u32, amount: Amount, replacement_of_id: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_last_rbf_txid<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, ) -> Pin<Box<dyn Future<Output = Result<Option<Txid>, BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn save_rbf_txid<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, txid: Txid, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn save_cancelled_outpoint<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, cancelled_id: u32, outpoint: OutPoint, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn save_cancelled_txid<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, cancelled_id: u32, txid: Txid, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn save_activated_txid<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, activated_id: u32, prerequisite_tx: &'life2 ActivatedWithTxid, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn save_activated_outpoint<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, activated_id: u32, activated_outpoint: &'life2 ActivatedWithOutpoint, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn update_effective_fee_rate<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, effective_fee_rate: FeeRate, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn check_if_tx_exists_on_txsender<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, txid: Txid, ) -> Pin<Box<dyn Future<Output = Result<Option<u32>, BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn save_tx<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, tx_metadata: Option<TxMetadata>, tx: &'life2 Transaction, fee_paying_type: FeePayingType, txid: Txid, rbf_signing_info: Option<RbfSigningInfo>, ) -> Pin<Box<dyn Future<Output = Result<u32, BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_tx_debug_info<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_tx_debug_submission_errors<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>, BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_tx_debug_fee_payer_utxos<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<(Txid, u32, Amount, bool)>, BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn fetch_next_bitcoin_syncer_evt<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: &'life1 mut Self::Transaction, consumer_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<BitcoinSyncerEvent>, BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_block_info_from_id<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, block_id: u32, ) -> Pin<Box<dyn Future<Output = Result<Option<(BlockHash, u32)>, BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn confirm_transactions<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: &'life1 mut Self::Transaction, block_id: u32, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn unconfirm_transactions<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: &'life1 mut Self::Transaction, block_id: u32, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait;
}
Expand description

Trait for database operations required by the transaction sender.

Required Associated Types§

Source

type Transaction: Send

Type for database transactions.

Required Methods§

Source

fn begin_transaction<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Transaction, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Begin a new database transaction.

Source

fn commit_transaction<'life0, 'async_trait>( &'life0 self, dbtx: Self::Transaction, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Commit a database transaction.

Source

fn save_tx_debug_submission_error<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, error: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Save a debug message for a transaction submission error.

Source

fn get_sendable_txs<'life0, 'async_trait>( &'life0 self, fee_rate: FeeRate, current_tip_height: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<u32>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get transactions that are ready to be sent.

Source

fn get_try_to_send_tx<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, ) -> Pin<Box<dyn Future<Output = Result<(Option<TxMetadata>, Transaction, FeePayingType, Option<u32>, Option<RbfSigningInfo>), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get details of a transaction to be sent.

Source

fn update_tx_debug_sending_state<'life0, 'life1, 'async_trait>( &'life0 self, id: u32, state: &'life1 str, is_error: bool, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update the debug sending state of a transaction.

Source

fn get_all_unconfirmed_fee_payer_txs<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, ) -> Pin<Box<dyn Future<Output = Result<Vec<(u32, u32, Txid, u32, Amount, Option<u32>)>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all unconfirmed fee payer transactions.

Source

fn get_unconfirmed_fee_payer_txs<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, bumped_id: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<(u32, Txid, u32, Amount)>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get unconfirmed fee payer transactions for a specific parent transaction.

Source

fn mark_fee_payer_utxo_as_evicted<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Mark a fee payer UTXO as evicted.

Source

fn get_confirmed_fee_payer_utxos<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<(Txid, u32, Amount)>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get confirmed fee payer UTXOs for a specific parent transaction.

Source

fn save_fee_payer_tx<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, try_to_send_id: Option<u32>, bumped_id: u32, fee_payer_txid: Txid, vout: u32, amount: Amount, replacement_of_id: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save a fee payer transaction.

Source

fn get_last_rbf_txid<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, ) -> Pin<Box<dyn Future<Output = Result<Option<Txid>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the last RBF transaction ID for a specific send attempt.

Source

fn save_rbf_txid<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, txid: Txid, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save a new RBF transaction ID.

Source

fn save_cancelled_outpoint<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, cancelled_id: u32, outpoint: OutPoint, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save a cancelled outpoint activation condition.

Source

fn save_cancelled_txid<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, cancelled_id: u32, txid: Txid, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save a cancelled transaction ID activation condition.

Source

fn save_activated_txid<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, activated_id: u32, prerequisite_tx: &'life2 ActivatedWithTxid, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Save an activated transaction ID condition.

Source

fn save_activated_outpoint<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, activated_id: u32, activated_outpoint: &'life2 ActivatedWithOutpoint, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Save an activated outpoint condition.

Source

fn update_effective_fee_rate<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, effective_fee_rate: FeeRate, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update the effective fee rate of a transaction.

Source

fn check_if_tx_exists_on_txsender<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, txid: Txid, ) -> Pin<Box<dyn Future<Output = Result<Option<u32>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a transaction already exists in the transaction sender queue.

Source

fn save_tx<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, tx_metadata: Option<TxMetadata>, tx: &'life2 Transaction, fee_paying_type: FeePayingType, txid: Txid, rbf_signing_info: Option<RbfSigningInfo>, ) -> Pin<Box<dyn Future<Output = Result<u32, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Save a transaction to the sending queue.

Source

fn get_tx_debug_info<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns debug information for a transaction.

Source

fn get_tx_debug_submission_errors<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns submission errors for a transaction.

Source

fn get_tx_debug_fee_payer_utxos<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, id: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<(Txid, u32, Amount, bool)>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns fee payer UTXOs for an attempt.

Source

fn fetch_next_bitcoin_syncer_evt<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: &'life1 mut Self::Transaction, consumer_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<BitcoinSyncerEvent>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch the next event from the Bitcoin syncer.

Source

fn get_block_info_from_id<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: Option<&'life1 mut Self::Transaction>, block_id: u32, ) -> Pin<Box<dyn Future<Output = Result<Option<(BlockHash, u32)>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get block hash and height from its ID.

Source

fn confirm_transactions<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: &'life1 mut Self::Transaction, block_id: u32, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Confirm transactions in a block.

Source

fn unconfirm_transactions<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: &'life1 mut Self::Transaction, block_id: u32, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unconfirm transactions in a block (due to reorg).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§