Trait BridgeRpcQueries

Source
pub trait BridgeRpcQueries {
    // Required method
    fn collateral_check<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        operator_data: &'life1 OperatorData,
        kickoff_wpks: &'life2 KickoffWinternitzKeys,
        paramset: &'static ProtocolParamset,
    ) -> Pin<Box<dyn Future<Output = Result<bool, BridgeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Extension trait for bridge-specific RPC queries.

These methods are kept in clementine-core because they depend on bridge-specific types like KickoffWinternitzKeys and OperatorData.

Required Methods§

Source

fn collateral_check<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, operator_data: &'life1 OperatorData, kickoff_wpks: &'life2 KickoffWinternitzKeys, paramset: &'static ProtocolParamset, ) -> Pin<Box<dyn Future<Output = Result<bool, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Checks if an operator’s collateral is valid and available for use.

This function validates the operator’s collateral by:

  1. Verifying the collateral UTXO exists and has the correct amount
  2. Creating the round transaction chain to track current collateral position
  3. Determining if the current collateral UTXO in the chain is spent in a non-protocol tx, signaling the exit of operator from the protocol
§Parameters
  • operator_data: Data about the operator including collateral funding outpoint
  • kickoff_wpks: Kickoff Winternitz public keys for round transaction creation
  • paramset: Protocol parameters
§Returns
  • bool: true if the collateral is still usable, thus operator is still in protocol, false if the collateral is spent, thus operator is not in protocol anymore
§Errors
  • [BridgeError]: If there was an error retrieving transaction data, creating round transactions, or checking UTXO status

Implementors§