Struct TrustedClosingTransaction
pub struct TrustedClosingTransaction<'a> { /* private fields */ }
Expand description
A wrapper on ClosingTransaction indicating that the built bitcoin transaction is trusted.
See trust() and verify() functions on CommitmentTransaction.
This structure implements Deref.
Implementations§
§impl<'a> TrustedClosingTransaction<'a>
impl<'a> TrustedClosingTransaction<'a>
pub fn built_transaction(&self) -> &'a Transaction
pub fn built_transaction(&self) -> &'a Transaction
The pre-built Bitcoin commitment transaction
pub fn get_sighash_all(
&self,
funding_redeemscript: &Script,
channel_value_satoshis: u64,
) -> Message
pub fn get_sighash_all( &self, funding_redeemscript: &Script, channel_value_satoshis: u64, ) -> Message
Get the SIGHASH_ALL sighash value of the transaction.
This can be used to verify a signature.
pub fn sign<T>(
&self,
funding_key: &SecretKey,
funding_redeemscript: &Script,
channel_value_satoshis: u64,
secp_ctx: &Secp256k1<T>,
) -> Signaturewhere
T: Signing,
pub fn sign<T>(
&self,
funding_key: &SecretKey,
funding_redeemscript: &Script,
channel_value_satoshis: u64,
secp_ctx: &Secp256k1<T>,
) -> Signaturewhere
T: Signing,
Sign a transaction, either because we are counter-signing the counterparty’s transaction or because we are about to broadcast a holder transaction.
Methods from Deref<Target = ClosingTransaction>§
pub fn trust(&self) -> TrustedClosingTransaction<'_>
pub fn trust(&self) -> TrustedClosingTransaction<'_>
Trust our pre-built transaction.
Applies a wrapper which allows access to the transaction.
This should only be used if you fully trust the builder of this object. It should not be used by an external signer - instead use the verify function.
pub fn verify(
&self,
funding_outpoint: OutPoint,
) -> Result<TrustedClosingTransaction<'_>, ()>
pub fn verify( &self, funding_outpoint: OutPoint, ) -> Result<TrustedClosingTransaction<'_>, ()>
Verify our pre-built transaction.
Applies a wrapper which allows access to the transaction.
An external validating signer must call this method before signing or using the built transaction.
pub fn to_holder_value_sat(&self) -> u64
pub fn to_holder_value_sat(&self) -> u64
The value to be sent to the holder, or zero if the output will be omitted
pub fn to_counterparty_value_sat(&self) -> u64
pub fn to_counterparty_value_sat(&self) -> u64
The value to be sent to the counterparty, or zero if the output will be omitted
pub fn to_holder_script(&self) -> &Script
pub fn to_holder_script(&self) -> &Script
The destination of the holder’s output
pub fn to_counterparty_script(&self) -> &Script
pub fn to_counterparty_script(&self) -> &Script
The destination of the counterparty’s output
Trait Implementations§
§impl<'a> Deref for TrustedClosingTransaction<'a>
impl<'a> Deref for TrustedClosingTransaction<'a>
§type Target = ClosingTransaction
type Target = ClosingTransaction
§fn deref(&self) -> &<TrustedClosingTransaction<'a> as Deref>::Target
fn deref(&self) -> &<TrustedClosingTransaction<'a> as Deref>::Target
Auto Trait Implementations§
impl<'a> Freeze for TrustedClosingTransaction<'a>
impl<'a> RefUnwindSafe for TrustedClosingTransaction<'a>
impl<'a> Send for TrustedClosingTransaction<'a>
impl<'a> Sync for TrustedClosingTransaction<'a>
impl<'a> Unpin for TrustedClosingTransaction<'a>
impl<'a> UnwindSafe for TrustedClosingTransaction<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§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