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§
Sourcefn 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,
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:
- Verifying the collateral UTXO exists and has the correct amount
- Creating the round transaction chain to track current collateral position
- 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 outpointkickoff_wpks: Kickoff Winternitz public keys for round transaction creationparamset: Protocol parameters
§Returns
bool:trueif the collateral is still usable, thus operator is still in protocol,falseif 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