Module breez_sdk_core::lightning::ln::functional_test_utils
Expand description
A bunch of useful utilities for building networks of nodes and exchanging messages between nodes for functional tests.
Structs§
- If we need an unsafe pointer to a
Node
(ie to reference it in a thread pre-std::thread::scope), this provides that withSync
. Note that accessing some of the fields in theNode
are not safe to use (i.e. the ones behind anRc
), but that’s left to the caller to figure out.
Enums§
- The possible ways we may notify a ChannelManager of a new block
Constants§
Traits§
Functions§
- Check whether N channel monitor(s) have been added.
- Checks whether the claimed HTLC for the specified path has the correct channel information.
- Check that a channel’s closing channel update has been broadcasted, and optionally check whether an error message event has occurred.
- Check that a channel’s closing channel events has been issued
- Runs the commitment_signed dance after the initial commitment_signed is delivered through to the initiator’s
revoke_and_ack
response. i.e.do_main_commitment_signed_dance
plus therevoke_and_ack
response to it. - Mine the given transaction in the next block and then mine CHAN_CONFIRM_DEPTH - 1 blocks on top, giving the given transaction CHAN_CONFIRM_DEPTH confirmations.
- Mine the given transaction at the given height, mining blocks as required to build to that height
- Initiates channel opening and creates a single batch funding transaction. This will go through the open_channel / accept_channel flow, and return the batch funding transaction with corresponding funding_created messages.
- Runs a full commitment_signed dance, delivering a commitment_signed, the responding
revoke_and_ack
andcommitment_signed
, and then the finalrevoke_and_ack
response. - Does the main logic in the commitment_signed dance. After the first
commitment_signed
has been delivered, this method picks up and delivers the responserevoke_and_ack
andcommitment_signed
, returning the recipient’srevoke_and_ack
and any extra message it may have included. - Checks that an
Event::PendingHTLCsForwardable
is available in the given events and, if there are anyEvent::HTLCHandlingFailed
events theirHTLCDestination
is included in theexpected_failures
set. - Get an error message from the pending events queue.
- Gets an UpdateHTLCs MessageSendEvent
- Get a payment preimage and hash.
- Gets an RAA and CS which were sent in response to a commitment update
- Gets a route from the given sender to the node described in
payment_params
. - Mine a single block containing the given transaction
- Mine a single block containing the given transaction without extra consistency checks which may impact ChannelManager state.
- Mine a single block containing the given transactions
- pending_htlc_adds includes both the holding cell and in-flight update_add_htlcs, whereas for claims/fails they are separated out.
- Fetches the first
msg_event
to the passednode_id
in the passedmsg_events
vec. Returns themsg_event
. - Tests that the given node has broadcast a claim transaction against the provided revoked HTLC transaction.
- Tests that the given node has broadcast transactions for the given Channel