pub struct OffboardForfeitContext<'a, V> { /* private fields */ }Implementations§
Source§impl<'a, V> OffboardForfeitContext<'a, V>
impl<'a, V> OffboardForfeitContext<'a, V>
Sourcepub fn new(input_vtxos: &'a [V], offboard_tx: &'a Transaction) -> Self
pub fn new(input_vtxos: &'a [V], offboard_tx: &'a Transaction) -> Self
Create a new OffboardForfeitContext with given input VTXOs and offboard tx
Number of input VTXOs must not be zero.
Sourcepub fn validate_offboard_tx(
&self,
req: &OffboardRequest,
) -> Result<(), InvalidOffboardTxError>
pub fn validate_offboard_tx( &self, req: &OffboardRequest, ) -> Result<(), InvalidOffboardTxError>
Validate offboard tx matches offboard request
Sourcepub fn user_sign_forfeits(
&self,
keys: &[impl Borrow<Keypair>],
server_nonces: &[PublicNonce],
) -> OffboardForfeitSignatures
pub fn user_sign_forfeits( &self, keys: &[impl Borrow<Keypair>], server_nonces: &[PublicNonce], ) -> OffboardForfeitSignatures
Sign forfeit transactions for all input VTXOs
Provide the keys for the VTXO pubkeys in order of the input VTXOs.
Panics if wrong number of keys or nonces, or if Self::validate_offboard_tx would have returned an error. The caller should call that method first.
Sourcepub fn check_finalize_transactions(
&self,
server_key: &Keypair,
connector_key: &Keypair,
server_pub_nonces: &[PublicNonce],
server_sec_nonces: Vec<SecretNonce>,
user_pub_nonces: &[PublicNonce],
user_partial_sigs: &[PartialSignature],
) -> Result<Vec<Transaction>, InvalidUserPartialSignatureError>
pub fn check_finalize_transactions( &self, server_key: &Keypair, connector_key: &Keypair, server_pub_nonces: &[PublicNonce], server_sec_nonces: Vec<SecretNonce>, user_pub_nonces: &[PublicNonce], user_partial_sigs: &[PartialSignature], ) -> Result<Vec<Transaction>, InvalidUserPartialSignatureError>
Check the user’s partial signatures and finalize the forfeit txs
Panics if wrong number of secret nonces or partial signatures, or if Self::validate_offboard_tx would have returned an error. The caller should call that method first.
Auto Trait Implementations§
impl<'a, V> Freeze for OffboardForfeitContext<'a, V>
impl<'a, V> RefUnwindSafe for OffboardForfeitContext<'a, V>where
V: RefUnwindSafe,
impl<'a, V> Send for OffboardForfeitContext<'a, V>where
V: Sync,
impl<'a, V> Sync for OffboardForfeitContext<'a, V>where
V: Sync,
impl<'a, V> Unpin for OffboardForfeitContext<'a, V>
impl<'a, V> UnwindSafe for OffboardForfeitContext<'a, V>where
V: RefUnwindSafe,
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
Mutably borrows from an owned value. Read more