pub struct TxSenderDb {
pool: Pool<Postgres>,
}Expand description
A thin Postgres wrapper dedicated to tx-sender tables.
Fields§
§pool: Pool<Postgres>Implementations§
Source§impl TxSenderDb
impl TxSenderDb
Sourcepub async fn insert_citrea_raw_tx_single(
&self,
tx: TxSenderDbTx<'_>,
transaction_kind: TransactionKind,
body: &[u8],
) -> Result<i64, BridgeError>
pub async fn insert_citrea_raw_tx_single( &self, tx: TxSenderDbTx<'_>, transaction_kind: TransactionKind, body: &[u8], ) -> Result<i64, BridgeError>
Inserts a single non-chunked Citrea raw tx row.
Uses the row body itself as the body_hash dedupe input.
Returns the insertion_id assigned to this row.
Sourcepub(crate) async fn insert_citrea_raw_tx_single_with_hash(
&self,
tx: TxSenderDbTx<'_>,
transaction_kind: TransactionKind,
body: &[u8],
body_hash: &[u8],
) -> Result<i64, BridgeError>
pub(crate) async fn insert_citrea_raw_tx_single_with_hash( &self, tx: TxSenderDbTx<'_>, transaction_kind: TransactionKind, body: &[u8], body_hash: &[u8], ) -> Result<i64, BridgeError>
Inserts a single Citrea raw tx row using an explicit body_hash.
This is used for BatchProof so Complete and chunked encodings of the
same proof share one dedupe key, even though the stored row body differs.
Returns the insertion_id assigned to this row.
Sourceasync fn insert_citrea_raw_tx_with_hash_status(
&self,
tx: TxSenderDbTx<'_>,
transaction_kind: TransactionKind,
body: Option<&[u8]>,
body_hash: &[u8],
) -> Result<(i64, bool), BridgeError>
async fn insert_citrea_raw_tx_with_hash_status( &self, tx: TxSenderDbTx<'_>, transaction_kind: TransactionKind, body: Option<&[u8]>, body_hash: &[u8], ) -> Result<(i64, bool), BridgeError>
Inserts a Citrea raw tx row and returns whether it was newly inserted.
body_hash is the unique dedupe key. It usually hashes this row’s body,
but callers may pass the hash of a larger logical payload when several rows
represent one request.
If the body hash already exists, returns the existing insertion_id with inserted = false.
Sourcepub async fn set_citrea_commit_outpoint(
&self,
tx: Option<TxSenderDbTx<'_>>,
id: i64,
outpoint: OutPoint,
) -> Result<(), BridgeError>
pub async fn set_citrea_commit_outpoint( &self, tx: Option<TxSenderDbTx<'_>>, id: i64, outpoint: OutPoint, ) -> Result<(), BridgeError>
Sets the commit outpoint for a specific Citrea raw tx row.
Sourcepub async fn insert_citrea_raw_tx_chunks(
&self,
tx: TxSenderDbTx<'_>,
chunks: &[Vec<u8>],
full_body_hash: &[u8],
) -> Result<i64, BridgeError>
pub async fn insert_citrea_raw_tx_chunks( &self, tx: TxSenderDbTx<'_>, chunks: &[Vec<u8>], full_body_hash: &[u8], ) -> Result<i64, BridgeError>
Inserts chunked Citrea raw tx data: N chunk rows + 1 aggregate row. All rows share the same insertion_id.
The aggregate placeholder carries full_body_hash as the dedupe key for
the original proof. Chunk rows intentionally keep body_hash NULL; we do
not dedupe individual chunks against unrelated requests.
Returns the insertion_id assigned to this group.
Sourcepub async fn get_citrea_txs_with_null_commit_outpoint(
&self,
tx: Option<TxSenderDbTx<'_>>,
) -> Result<Vec<CitreaRawTxRow>, BridgeError>
pub async fn get_citrea_txs_with_null_commit_outpoint( &self, tx: Option<TxSenderDbTx<'_>>, ) -> Result<Vec<CitreaRawTxRow>, BridgeError>
Returns non-aggregate citrea transactions with null commit_outpoint. Excludes aggregate transactions (transaction_kind = 1).
Sourcepub async fn get_citrea_txs_with_commit_outpoint_no_try_to_send(
&self,
tx: Option<TxSenderDbTx<'_>>,
) -> Result<Vec<CitreaRawTxRow>, BridgeError>
pub async fn get_citrea_txs_with_commit_outpoint_no_try_to_send( &self, tx: Option<TxSenderDbTx<'_>>, ) -> Result<Vec<CitreaRawTxRow>, BridgeError>
Returns non-aggregate citrea transactions with commit_outpoint but no try_to_send_id. Excludes aggregate transactions (transaction_kind = 1).
Sourcepub async fn get_citrea_txs_with_commit_outpoint(
&self,
tx: Option<TxSenderDbTx<'_>>,
) -> Result<Vec<CitreaRawTxRow>, BridgeError>
pub async fn get_citrea_txs_with_commit_outpoint( &self, tx: Option<TxSenderDbTx<'_>>, ) -> Result<Vec<CitreaRawTxRow>, BridgeError>
Returns citrea transactions with commit_outpoint (regardless of try_to_send_id).
Sourcepub async fn get_citrea_txs_with_commit_outpoint_unseen_try_to_send(
&self,
tx: Option<TxSenderDbTx<'_>>,
) -> Result<Vec<CitreaRawTxRow>, BridgeError>
pub async fn get_citrea_txs_with_commit_outpoint_unseen_try_to_send( &self, tx: Option<TxSenderDbTx<'_>>, ) -> Result<Vec<CitreaRawTxRow>, BridgeError>
Returns Citrea transactions with commit_outpoint where try_to_send_id is NULL or the try-to-send tx has not been seen yet.
Sourcepub async fn clear_citrea_commit_and_try_to_send_by_ids(
&self,
tx: Option<TxSenderDbTx<'_>>,
ids: &[i64],
) -> Result<(), BridgeError>
pub async fn clear_citrea_commit_and_try_to_send_by_ids( &self, tx: Option<TxSenderDbTx<'_>>, ids: &[i64], ) -> Result<(), BridgeError>
Clears commit_outpoint and try_to_send_id for specific Citrea rows.
Sourcepub async fn set_citrea_try_to_send_id(
&self,
tx: TxSenderDbTx<'_>,
id: i64,
try_to_send_id: i32,
) -> Result<(), BridgeError>
pub async fn set_citrea_try_to_send_id( &self, tx: TxSenderDbTx<'_>, id: i64, try_to_send_id: i32, ) -> Result<(), BridgeError>
Sets the try_to_send_id for a specific Citrea raw tx row.
Sourcepub async fn get_citrea_aggregate_rows_pending(
&self,
tx: Option<TxSenderDbTx<'_>>,
) -> Result<Vec<CitreaRawTxRow>, BridgeError>
pub async fn get_citrea_aggregate_rows_pending( &self, tx: Option<TxSenderDbTx<'_>>, ) -> Result<Vec<CitreaRawTxRow>, BridgeError>
Returns aggregate placeholder rows that are not finalized.
Sourcepub async fn get_citrea_chunk_rows_by_insertion_id(
&self,
tx: Option<TxSenderDbTx<'_>>,
insertion_id: i64,
) -> Result<Vec<CitreaRawTxRow>, BridgeError>
pub async fn get_citrea_chunk_rows_by_insertion_id( &self, tx: Option<TxSenderDbTx<'_>>, insertion_id: i64, ) -> Result<Vec<CitreaRawTxRow>, BridgeError>
Returns chunk rows for a given insertion_id, ordered by row id.
Sourcepub async fn update_citrea_aggregate_body_and_reset(
&self,
tx: Option<TxSenderDbTx<'_>>,
id: i64,
body: &[u8],
) -> Result<(), BridgeError>
pub async fn update_citrea_aggregate_body_and_reset( &self, tx: Option<TxSenderDbTx<'_>>, id: i64, body: &[u8], ) -> Result<(), BridgeError>
Updates the body for an aggregate Citrea row, resetting commit/try_to_send state.
The body_hash remains the original full proof hash rather than being
recomputed from the aggregate body, so repeated BatchProof submissions
still dedupe to this insertion group.
Sourcepub async fn set_citrea_aggregate_finalized(
&self,
tx: Option<TxSenderDbTx<'_>>,
id: i64,
) -> Result<(), BridgeError>
pub async fn set_citrea_aggregate_finalized( &self, tx: Option<TxSenderDbTx<'_>>, id: i64, ) -> Result<(), BridgeError>
Marks an aggregate row as finalized.
Source§impl TxSenderDb
impl TxSenderDb
Sourcepub async fn save_fee_payer_tx(
&self,
tx: Option<TxSenderDbTx<'_>>,
bumped_id: u32,
fee_payer_txid: Txid,
vout: u32,
amount: Amount,
replacement_of_id: Option<u32>,
) -> Result<(), BridgeError>
pub async fn save_fee_payer_tx( &self, tx: Option<TxSenderDbTx<'_>>, bumped_id: u32, fee_payer_txid: Txid, vout: u32, amount: Amount, replacement_of_id: Option<u32>, ) -> Result<(), BridgeError>
Saves a fee payer transaction to the database.
§Arguments
bumped_id- The id of the transaction funded by this fee payer.fee_payer_txid- The txid of the fee payer transaction.vout- The output index of the fee payer UTXO.amount- The amount in satoshis.replacement_of_id- The fee payer UTXO this row replaces, if any.
Sourcepub async fn get_all_unconfirmed_fee_payer_txs(
&self,
tx: Option<TxSenderDbTx<'_>>,
) -> Result<Vec<(u32, u32, Txid, u32, Amount, Option<u32>)>, BridgeError>
pub async fn get_all_unconfirmed_fee_payer_txs( &self, tx: Option<TxSenderDbTx<'_>>, ) -> Result<Vec<(u32, u32, Txid, u32, Amount, Option<u32>)>, BridgeError>
Returns all unconfirmed fee payer UTXOs.
UTXOs whose replacement chain already has a confirmed member are excluded. If no replacement in the chain is confirmed, all unconfirmed replacements are returned.
§Returns
A vector of fee payer UTXO details:
u32: id of the fee payer UTXO row.u32: id of the bumped transaction.- [
Txid]: txid of the fee payer transaction. u32: output index of the UTXO.- [
Amount]: amount in satoshis. Option<u32>: replaced fee payer UTXO id, if this is a replacement.
Sourcepub async fn get_unconfirmed_fee_payer_txs(
&self,
tx: Option<TxSenderDbTx<'_>>,
bumped_id: u32,
) -> Result<Vec<(u32, Txid, u32, Amount)>, BridgeError>
pub async fn get_unconfirmed_fee_payer_txs( &self, tx: Option<TxSenderDbTx<'_>>, bumped_id: u32, ) -> Result<Vec<(u32, Txid, u32, Amount)>, BridgeError>
Returns unconfirmed fee payer UTXOs for one try-to-send transaction.
UTXOs whose replacement chain already has a confirmed member are excluded. If no replacement in the chain is confirmed, all unconfirmed replacements are returned.
§Arguments
bumped_id- The id of the transaction funded by the fee payer UTXOs.
§Returns
A vector of fee payer UTXO details:
Sourcepub async fn mark_fee_payer_utxo_as_evicted(
&self,
tx: Option<TxSenderDbTx<'_>>,
id: u32,
) -> Result<(), BridgeError>
pub async fn mark_fee_payer_utxo_as_evicted( &self, tx: Option<TxSenderDbTx<'_>>, id: u32, ) -> Result<(), BridgeError>
Marks a fee payer UTXO and all of its replacements as evicted.
Evicted fee payer UTXOs are no longer selected for bumps, because their wallet inputs may already have been reused elsewhere.
pub async fn get_confirmed_fee_payer_utxos( &self, tx: Option<TxSenderDbTx<'_>>, id: u32, ) -> Result<Vec<(Txid, u32, Amount)>, BridgeError>
Sourcepub async fn check_if_tx_exists_on_txsender(
&self,
tx: Option<TxSenderDbTx<'_>>,
txid: Txid,
) -> Result<Option<u32>, BridgeError>
pub async fn check_if_tx_exists_on_txsender( &self, tx: Option<TxSenderDbTx<'_>>, txid: Txid, ) -> Result<Option<u32>, BridgeError>
Returns the tx-sender row id for txid if it already exists.
This is used before inserting to avoid adding duplicate transactions to the queue.
pub async fn save_tx( &self, tx: TxSenderDbTx<'_>, tx_metadata: Option<TxMetadata>, raw_tx: &Transaction, fee_paying_type: FeePayingType, txid: Txid, rbf_signing_info: Option<RbfSigningInfo>, ) -> Result<u32, BridgeError>
pub async fn save_rbf_txid( &self, tx: Option<TxSenderDbTx<'_>>, id: u32, txid: Txid, ) -> Result<(), BridgeError>
pub async fn get_last_rbf_txid( &self, tx: Option<TxSenderDbTx<'_>>, id: u32, ) -> Result<Option<Txid>, BridgeError>
pub async fn list_rbf_txids_for_id( &self, tx: Option<TxSenderDbTx<'_>>, id: u32, ) -> Result<Vec<Txid>, BridgeError>
pub async fn save_cancelled_outpoint( &self, tx: TxSenderDbTx<'_>, cancelled_id: u32, outpoint: OutPoint, ) -> Result<(), BridgeError>
pub async fn save_cancelled_txid( &self, tx: TxSenderDbTx<'_>, cancelled_id: u32, txid: Txid, ) -> Result<(), BridgeError>
pub async fn save_activated_txid( &self, tx: TxSenderDbTx<'_>, activated_id: u32, prerequisite_tx: &ActivatedWithTxid, ) -> Result<(), BridgeError>
pub async fn save_activated_outpoint( &self, tx: TxSenderDbTx<'_>, activated_id: u32, activated_outpoint: &ActivatedWithOutpoint, ) -> Result<(), BridgeError>
Sourcepub async fn get_sendable_txs(
&self,
tx: Option<TxSenderDbTx<'_>>,
fee_rate: FeeRateKvb,
current_tip_height: u32,
) -> Result<Vec<u32>, BridgeError>
pub async fn get_sendable_txs( &self, tx: Option<TxSenderDbTx<'_>>, fee_rate: FeeRateKvb, current_tip_height: u32, ) -> Result<Vec<u32>, BridgeError>
Returns unconfirmed try-to-send transactions that satisfy all queue conditions.
A transaction is sendable when:
- all activation dependencies have been seen and their relative block timelocks passed;
- zero-timelock txid activations are either seen on-chain or currently in mempool;
- no cancellation dependency has been seen;
- the transaction itself has not been seen on-chain;
- its previous effective fee rate is lower than
fee_rate, or it has never been sent.
Passing a very high fee_rate is used by callers to retrieve all active transactions
after a new block, even when the market fee did not increase.
§Returns
A vector of tx-sender database ids that are ready to send or bump.
Sourcepub async fn get_effective_fee_rate(
&self,
tx: Option<TxSenderDbTx<'_>>,
id: u32,
) -> Result<(Option<FeeRateKvb>, Option<u32>), BridgeError>
pub async fn get_effective_fee_rate( &self, tx: Option<TxSenderDbTx<'_>>, id: u32, ) -> Result<(Option<FeeRateKvb>, Option<u32>), BridgeError>
Returns the effective fee rate and block height from the last actual fee bump.
Returns (None, None) if no effective fee rate has been recorded yet.
Sourcepub async fn update_effective_fee_rate(
&self,
tx: Option<TxSenderDbTx<'_>>,
id: u32,
effective_fee_rate: FeeRateKvb,
block_height: u32,
) -> Result<(), BridgeError>
pub async fn update_effective_fee_rate( &self, tx: Option<TxSenderDbTx<'_>>, id: u32, effective_fee_rate: FeeRateKvb, block_height: u32, ) -> Result<(), BridgeError>
Updates the effective fee rate and last bump block height for a transaction.
The row is updated only when the fee rate changes, or when the previous fee rate
is NULL. This preserves last_bump_block_height across retries at the same
fee rate, so the stuck-for-N-blocks counter continues from the last real bump.
effective_fee_rate is stored in sat/kvB.
pub async fn get_try_to_send_tx( &self, tx: Option<TxSenderDbTx<'_>>, id: u32, ) -> Result<(Option<TxMetadata>, Transaction, FeePayingType, Option<u32>, Option<RbfSigningInfo>), BridgeError>
Sourcepub async fn save_tx_debug_submission_error(
&self,
tx: Option<TxSenderDbTx<'_>>,
tx_id: u32,
error_message: &str,
) -> Result<(), BridgeError>
pub async fn save_tx_debug_submission_error( &self, tx: Option<TxSenderDbTx<'_>>, tx_id: u32, error_message: &str, ) -> Result<(), BridgeError>
Saves a transaction submission error to the debug table.
Sourcepub async fn update_tx_debug_sending_state(
&self,
tx_id: u32,
state: &str,
activated: bool,
) -> Result<(), BridgeError>
pub async fn update_tx_debug_sending_state( &self, tx_id: u32, state: &str, activated: bool, ) -> Result<(), BridgeError>
Updates or inserts the transaction’s current debug sending state.
This intentionally does not accept a database transaction. It is debug-only metadata and callers should use it after the tx-sender row has been committed.
Sourcepub async fn get_tx_debug_info(
&self,
tx: Option<TxSenderDbTx<'_>>,
tx_id: u32,
) -> Result<Option<String>, BridgeError>
pub async fn get_tx_debug_info( &self, tx: Option<TxSenderDbTx<'_>>, tx_id: u32, ) -> Result<Option<String>, BridgeError>
Returns the current debug sending state for a transaction.
Sourcepub async fn get_tx_debug_submission_errors(
&self,
tx: Option<TxSenderDbTx<'_>>,
tx_id: u32,
) -> Result<Vec<(String, String)>, BridgeError>
pub async fn get_tx_debug_submission_errors( &self, tx: Option<TxSenderDbTx<'_>>, tx_id: u32, ) -> Result<Vec<(String, String)>, BridgeError>
Returns all recorded submission errors for a transaction, ordered by timestamp.
Sourcepub async fn get_tx_debug_fee_payer_utxos(
&self,
tx: Option<TxSenderDbTx<'_>>,
tx_id: u32,
) -> Result<Vec<(Txid, u32, Amount, bool)>, BridgeError>
pub async fn get_tx_debug_fee_payer_utxos( &self, tx: Option<TxSenderDbTx<'_>>, tx_id: u32, ) -> Result<Vec<(Txid, u32, Amount, bool)>, BridgeError>
Returns all fee payer UTXOs for a transaction with their confirmation status.
Sourcepub async fn debug_inactive_txs(
&self,
fee_rate: FeeRateKvb,
current_tip_height: u32,
)
pub async fn debug_inactive_txs( &self, fee_rate: FeeRateKvb, current_tip_height: u32, )
Debug-only helper: log why some txs are inactive (not sendable).
Sourcepub async fn list_unfinalized_try_to_send_txs(
&self,
tx: Option<TxSenderDbTx<'_>>,
) -> Result<Vec<(u32, FeePayingType, Txid, Option<u32>)>, BridgeError>
pub async fn list_unfinalized_try_to_send_txs( &self, tx: Option<TxSenderDbTx<'_>>, ) -> Result<Vec<(u32, FeePayingType, Txid, Option<u32>)>, BridgeError>
Lists all unfinalized try-to-send transactions that should be checked for confirmation.
This function excludes transactions that have been permanently cancelled (i.e., any cancellation
from tx_sender_cancel_try_to_send_txids or tx_sender_cancel_try_to_send_outpoints is finalized).
Once a cancellation is finalized, the transaction can never be sent, so there’s no point in
repeatedly checking it via RPC. This prevents unnecessary RPC calls for transactions that are
permanently cancelled.
pub async fn list_rbf_txids_for_ids( &self, tx: Option<TxSenderDbTx<'_>>, ids: &[u32], ) -> Result<Vec<(u32, Txid)>, BridgeError>
pub async fn set_try_to_send_seen_at_height( &self, tx: Option<TxSenderDbTx<'_>>, id: u32, seen_at_height: Option<u32>, ) -> Result<(), BridgeError>
Sourcepub async fn list_try_to_send_statuses_by_ids(
&self,
tx: Option<TxSenderDbTx<'_>>,
ids: &[u32],
) -> Result<HashMap<u32, (Option<u32>, bool)>, BridgeError>
pub async fn list_try_to_send_statuses_by_ids( &self, tx: Option<TxSenderDbTx<'_>>, ids: &[u32], ) -> Result<HashMap<u32, (Option<u32>, bool)>, BridgeError>
Returns seen_at_height and is_finalized for a set of try_to_send ids.
pub async fn set_try_to_send_finalized( &self, tx: Option<TxSenderDbTx<'_>>, id: u32, is_finalized: bool, ) -> Result<(), BridgeError>
Sourcepub async fn list_unfinalized_fee_payer_utxos(
&self,
tx: Option<TxSenderDbTx<'_>>,
) -> Result<Vec<(u32, Txid, Option<u32>)>, BridgeError>
pub async fn list_unfinalized_fee_payer_utxos( &self, tx: Option<TxSenderDbTx<'_>>, ) -> Result<Vec<(u32, Txid, Option<u32>)>, BridgeError>
Lists all unfinalized fee payer UTXOs that should be checked for confirmation.
Fee payer UTXOs form replacement chains via replacement_of_id:
- The first created UTXO in a chain has
replacement_of_id IS NULLand itsidis the canonical parent id for the chain. - All replacements in that chain have
replacement_of_id = <parent id>.
This function excludes fee payer UTXOs where any UTXO in the same replacement chain (canonical parent or any of its replacements) is already finalized. Once a chain has a finalized fee payer UTXO, there’s no need to check the others, preventing unnecessary RPC calls.
pub async fn set_fee_payer_seen_at_height( &self, tx: Option<TxSenderDbTx<'_>>, fee_payer_utxo_id: u32, seen_at_height: Option<u32>, ) -> Result<(), BridgeError>
pub async fn set_fee_payer_finalized( &self, tx: Option<TxSenderDbTx<'_>>, fee_payer_utxo_id: u32, is_finalized: bool, ) -> Result<(), BridgeError>
pub async fn list_unfinalized_cancel_txids( &self, tx: Option<TxSenderDbTx<'_>>, ) -> Result<Vec<(u32, Txid, Option<u32>)>, BridgeError>
pub async fn set_cancel_txid_seen_at_height( &self, tx: Option<TxSenderDbTx<'_>>, cancelled_id: u32, txid: Txid, seen_at_height: Option<u32>, ) -> Result<(), BridgeError>
pub async fn set_cancel_txid_finalized( &self, tx: Option<TxSenderDbTx<'_>>, cancelled_id: u32, txid: Txid, is_finalized: bool, ) -> Result<(), BridgeError>
pub async fn list_unfinalized_activate_txids( &self, tx: Option<TxSenderDbTx<'_>>, ) -> Result<Vec<(u32, Txid, Option<u32>, bool)>, BridgeError>
pub async fn set_activate_txid_seen_at_height( &self, tx: Option<TxSenderDbTx<'_>>, activated_id: u32, txid: Txid, seen_at_height: Option<u32>, ) -> Result<(), BridgeError>
pub async fn set_activate_txid_finalized( &self, tx: Option<TxSenderDbTx<'_>>, activated_id: u32, txid: Txid, is_finalized: bool, ) -> Result<(), BridgeError>
pub async fn set_activate_txid_mempool_status( &self, tx: Option<TxSenderDbTx<'_>>, activated_id: u32, txid: Txid, in_mempool: bool, ) -> Result<(), BridgeError>
pub async fn get_activate_txid_status( &self, tx: Option<TxSenderDbTx<'_>>, txid: Txid, ) -> Result<Option<(bool, Option<u32>)>, BridgeError>
pub async fn delete_try_to_send_tx( &self, tx: Option<TxSenderDbTx<'_>>, id: u32, ) -> Result<(), BridgeError>
pub async fn list_unfinalized_cancel_outpoints( &self, tx: Option<TxSenderDbTx<'_>>, ) -> Result<Vec<(u32, OutPoint, Option<u32>)>, BridgeError>
pub async fn set_cancel_outpoint_seen_at_height( &self, tx: Option<TxSenderDbTx<'_>>, cancelled_id: u32, outpoint: OutPoint, seen_at_height: Option<u32>, ) -> Result<(), BridgeError>
pub async fn set_cancel_outpoint_finalized( &self, tx: Option<TxSenderDbTx<'_>>, cancelled_id: u32, outpoint: OutPoint, is_finalized: bool, ) -> Result<(), BridgeError>
pub async fn list_unfinalized_activate_outpoints( &self, tx: Option<TxSenderDbTx<'_>>, ) -> Result<Vec<(u32, OutPoint, Option<u32>)>, BridgeError>
pub async fn set_activate_outpoint_seen_at_height( &self, tx: Option<TxSenderDbTx<'_>>, activated_id: u32, outpoint: OutPoint, seen_at_height: Option<u32>, ) -> Result<(), BridgeError>
pub async fn set_activate_outpoint_finalized( &self, tx: Option<TxSenderDbTx<'_>>, activated_id: u32, outpoint: OutPoint, is_finalized: bool, ) -> Result<(), BridgeError>
pub async fn update_synced_height(&self, height: u32) -> Result<(), BridgeError>
pub async fn get_synced_height(&self) -> Result<Option<u32>, BridgeError>
Source§impl TxSenderDb
impl TxSenderDb
pub fn from_pool(pool: Pool<Postgres>) -> Self
pub fn pool(&self) -> &Pool<Postgres>
pub async fn connect(cfg: &TxSenderPostgresConfig) -> Result<Self, BridgeError>
pub async fn begin_transaction( &self, ) -> Result<TxSenderTransaction, BridgeError>
pub async fn commit_transaction( &self, tx: TxSenderTransaction, ) -> Result<(), BridgeError>
Sourcepub async fn run_migrations(&self) -> Result<(), BridgeError>
pub async fn run_migrations(&self) -> Result<(), BridgeError>
Runs tx-sender schema initialization/migrations.
Trait Implementations§
Source§impl Clone for TxSenderDb
impl Clone for TxSenderDb
Source§fn clone(&self) -> TxSenderDb
fn clone(&self) -> TxSenderDb
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TxSenderDb
impl !RefUnwindSafe for TxSenderDb
impl Send for TxSenderDb
impl Sync for TxSenderDb
impl Unpin for TxSenderDb
impl !UnwindSafe for TxSenderDb
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.