Struct lightning_signer::util::loopback::LoopbackChannelSigner[][src]

pub struct LoopbackChannelSigner {
    pub node_id: PublicKey,
    pub channel_id: ChannelId,
    pub signer: Arc<MultiSigner>,
    pub pubkeys: ChannelPublicKeys,
    pub counterparty_pubkeys: Option<ChannelPublicKeys>,
    pub is_outbound: bool,
    pub channel_value_sat: u64,
    pub local_to_self_delay: u16,
    pub counterparty_to_self_delay: u16,
}

Fields

node_id: PublicKeychannel_id: ChannelIdsigner: Arc<MultiSigner>pubkeys: ChannelPublicKeyscounterparty_pubkeys: Option<ChannelPublicKeys>is_outbound: boolchannel_value_sat: u64local_to_self_delay: u16counterparty_to_self_delay: u16

Implementations

impl LoopbackChannelSigner[src]

pub fn make_counterparty_tx_keys(
    &self,
    per_commitment_point: &PublicKey,
    secp_ctx: &Secp256k1<All>
) -> Result<TxCreationKeys, ()>
[src]

Trait Implementations

impl BaseSign for LoopbackChannelSigner[src]

fn get_per_commitment_point(
    &self,
    idx: u64,
    _secp_ctx: &Secp256k1<All>
) -> PublicKey
[src]

Gets the per-commitment point for a specific commitment number Read more

fn release_commitment_secret(&self, commitment_number: u64) -> [u8; 32][src]

Gets the commitment secret for a specific commitment number as part of the revocation process Read more

fn pubkeys(&self) -> &ChannelPublicKeys[src]

Gets the holder’s channel public keys and basepoints

fn channel_keys_id(&self) -> [u8; 32][src]

Gets an arbitrary identifier describing the set of keys which are provided back to you in some SpendableOutputDescriptor types. This should be sufficient to identify this Sign object uniquely and lookup or re-derive its keys. Read more

fn sign_counterparty_commitment(
    &self,
    commitment_tx: &CommitmentTransaction,
    _secp_ctx: &Secp256k1<All>
) -> Result<(Signature, Vec<Signature>), ()>
[src]

Create a signature for a counterparty’s commitment transaction and associated HTLC transactions. Read more

fn sign_holder_commitment_and_htlcs(
    &self,
    hct: &HolderCommitmentTransaction,
    _secp_ctx: &Secp256k1<All>
) -> Result<(Signature, Vec<Signature>), ()>
[src]

Create a signatures for a holder’s commitment transaction and its claiming HTLC transactions. This will only ever be called with a non-revoked commitment_tx. This will be called with the latest commitment_tx when we initiate a force-close. This will be called with the previous latest, just to get claiming HTLC signatures, if we are reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to the latest. This may be called multiple times for the same transaction. Read more

fn unsafe_sign_holder_commitment_and_htlcs(
    &self,
    hct: &HolderCommitmentTransaction,
    secp_ctx: &Secp256k1<All>
) -> Result<(Signature, Vec<Signature>), ()>
[src]

Same as sign_holder_commitment, but exists only for tests to get access to holder commitment transactions which will be broadcasted later, after the channel has moved on to a newer state. Thus, needs its own method as sign_holder_commitment may enforce that we only ever get called once. Read more

fn sign_justice_transaction(
    &self,
    justice_tx: &Transaction,
    input: usize,
    amount: u64,
    per_commitment_key: &SecretKey,
    htlc: &Option<HTLCOutputInCommitment>,
    secp_ctx: &Secp256k1<All>
) -> Result<Signature, ()>
[src]

Create a signature for the given input in a transaction spending an HTLC or commitment transaction output when our counterparty broadcasts an old state. Read more

fn sign_counterparty_htlc_transaction(
    &self,
    htlc_tx: &Transaction,
    input: usize,
    amount: u64,
    per_commitment_point: &PublicKey,
    htlc: &HTLCOutputInCommitment,
    secp_ctx: &Secp256k1<All>
) -> Result<Signature, ()>
[src]

Create a signature for a claiming transaction for a HTLC output on a counterparty’s commitment transaction, either offered or received. Read more

fn sign_closing_transaction(
    &self,
    closing_tx: &Transaction,
    _secp_ctx: &Secp256k1<All>
) -> Result<Signature, ()>
[src]

Create a signature for a (proposed) closing transaction. Read more

fn sign_channel_announcement(
    &self,
    msg: &UnsignedChannelAnnouncement,
    _secp_ctx: &Secp256k1<All>
) -> Result<Signature, ()>
[src]

Signs a channel announcement message with our funding key, proving it comes from one of the channel participants. Read more

fn ready_channel(&mut self, parameters: &ChannelTransactionParameters)[src]

Set the counterparty static channel data, including basepoints, counterparty_selected/holder_selected_contest_delay and funding outpoint. This is done as soon as the funding outpoint is known. Since these are static channel data, they MUST NOT be allowed to change to different values once set. Read more

impl Clone for LoopbackChannelSigner[src]

fn clone(&self) -> LoopbackChannelSigner[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Persist<LoopbackChannelSigner> for TestPersister[src]

fn persist_new_channel(
    &self,
    _funding_txo: OutPoint,
    _data: &ChannelMonitor<LoopbackChannelSigner>
) -> Result<(), ChannelMonitorUpdateErr>
[src]

Persist a new channel’s data. The data can be stored any way you want, but the identifier provided by Rust-Lightning is the channel’s outpoint (and it is up to you to maintain a correct mapping between the outpoint and the stored channel data). Note that you must persist every new monitor to disk. See the Persist trait documentation for more details. Read more

fn update_persisted_channel(
    &self,
    _funding_txo: OutPoint,
    _update: &ChannelMonitorUpdate,
    _data: &ChannelMonitor<LoopbackChannelSigner>
) -> Result<(), ChannelMonitorUpdateErr>
[src]

Update one channel’s data. The provided ChannelMonitor has already applied the given update. Read more

impl<'a> Watch<LoopbackChannelSigner> for TestChainMonitor<'a>[src]

fn watch_channel(
    &self,
    funding_txo: OutPoint,
    monitor: ChannelMonitor<LoopbackChannelSigner>
) -> Result<(), ChannelMonitorUpdateErr>
[src]

Watches a channel identified by funding_txo using monitor. Read more

fn update_channel(
    &self,
    funding_txo: OutPoint,
    update: ChannelMonitorUpdate
) -> Result<(), ChannelMonitorUpdateErr>
[src]

Updates a channel identified by funding_txo by applying update to its monitor. Read more

fn release_pending_monitor_events(&self) -> Vec<MonitorEvent>[src]

Returns any monitor events since the last call. Subsequent calls must only return new events. Read more

impl Writeable for LoopbackChannelSigner[src]

fn write<W: Writer>(&self, _writer: &mut W) -> Result<(), IOError>[src]

Writes self out to the given Writer

fn encode(&self) -> Vec<u8, Global>[src]

Writes self out to a Vec

fn encode_with_len(&self) -> Vec<u8, Global>[src]

Writes self out to a Vec

impl Sign for LoopbackChannelSigner[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.