Struct TrustedClosingTransaction

Source
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§

Source§

impl<'a> TrustedClosingTransaction<'a>

Source

pub fn built_transaction(&self) -> &'a Transaction

The pre-built Bitcoin commitment transaction

Source

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.

Source

pub fn sign<T: Signing>( &self, funding_key: &SecretKey, funding_redeemscript: &Script, channel_value_satoshis: u64, secp_ctx: &Secp256k1<T>, ) -> Signature

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>§

Source

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.

Source

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.

Source

pub fn to_holder_value_sat(&self) -> u64

The value to be sent to the holder, or zero if the output will be omitted

Source

pub fn to_counterparty_value_sat(&self) -> u64

The value to be sent to the counterparty, or zero if the output will be omitted

Source

pub fn to_holder_script(&self) -> &Script

The destination of the holder’s output

Source

pub fn to_counterparty_script(&self) -> &Script

The destination of the counterparty’s output

Trait Implementations§

Source§

impl<'a> Deref for TrustedClosingTransaction<'a>

Source§

type Target = ClosingTransaction

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V