Module functional_test_utils
Expand description
A bunch of useful utilities for building networks of nodes and exchanging messages between nodes for functional tests.
Structs§
- Node
- NodeCfg
- NodePtr
- 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. - Payment
Failed Conditions - Reconnect
Args - Send
Event - Test
Chan MonCfg
Enums§
- Connect
Style - The possible ways we may notify a ChannelManager of a new block
- HTLC
Type
Constants§
Traits§
Functions§
- _reload_
node - check_
added_ monitors - Check whether N channel monitor(s) have been added.
- check_
claimed_ htlc_ channel - Checks whether the claimed HTLC for the specified path has the correct channel information.
- check_
closed_ broadcast - Check that a channel’s closing channel update has been broadcasted, and optionally check whether an error message event has occurred.
- check_
closed_ event - Check that a channel’s closing channel events has been issued
- check_
payment_ claimable - check_
preimage_ claim - claim_
payment - claim_
payment_ along_ route - close_
channel - commitment_
signed_ dance_ through_ cp_ raa - 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. - confirm_
transaction - 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.
- confirm_
transaction_ at - confirm_
transactions_ at - Mine the given transaction at the given height, mining blocks as required to build to that height
- connect_
block - connect_
blocks - create_
announced_ chan_ between_ nodes - create_
announced_ chan_ between_ nodes_ with_ value - create_
batch_ channel_ funding - 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.
- create_
chan_ between_ nodes - create_
chan_ between_ nodes_ with_ value - create_
chan_ between_ nodes_ with_ value_ a - create_
chan_ between_ nodes_ with_ value_ b - create_
chan_ between_ nodes_ with_ value_ confirm - create_
chan_ between_ nodes_ with_ value_ confirm_ first - create_
chan_ between_ nodes_ with_ value_ confirm_ second - create_
chan_ between_ nodes_ with_ value_ init - create_
chanmon_ cfgs - create_
coinbase_ funding_ transaction - create_
dummy_ block - create_
dummy_ header - create_
funding_ transaction - create_
network - create_
node_ cfgs - create_
node_ cfgs_ with_ persisters - create_
node_ chanmgrs - create_
unannounced_ chan_ between_ nodes_ with_ value - disconnect_
all_ blocks - disconnect_
blocks - do_
check_ spends - do_
claim_ payment_ along_ route - do_
claim_ payment_ along_ route_ with_ extra_ penultimate_ hop_ fees - do_
commitment_ signed_ dance - Runs a full commitment_signed dance, delivering a commitment_signed, the responding
revoke_and_ack
andcommitment_signed
, and then the finalrevoke_and_ack
response. - do_
main_ commitment_ signed_ dance - 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. - do_
pass_ along_ path - expect_
channel_ pending_ event - expect_
channel_ ready_ event - expect_
payment_ failed_ conditions - expect_
payment_ failed_ conditions_ event - expect_
payment_ forwarded - expect_
payment_ sent - expect_
pending_ htlcs_ forwardable_ conditions - 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. - fail_
payment - fail_
payment_ along_ route - get_
announce_ close_ broadcast_ events - get_
err_ msg - Get an error message from the pending events queue.
- get_
htlc_ update_ msgs - Gets an UpdateHTLCs MessageSendEvent
- get_
payment_ preimage_ hash - Get a payment preimage and hash.
- get_
revoke_ commit_ msgs - Gets an RAA and CS which were sent in response to a commitment update
- get_
route - Gets a route from the given sender to the node described in
payment_params
. - handle_
announce_ close_ broadcast_ events - handle_
bump_ htlc_ event - mine_
transaction - Mine a single block containing the given transaction
- mine_
transaction_ without_ consistency_ checks - Mine a single block containing the given transaction without extra consistency checks which may impact ChannelManager state.
- mine_
transactions - Mine a single block containing the given transactions
- open_
zero_ conf_ channel - pass_
along_ path - pass_
along_ route - pass_
claimed_ payment_ along_ route - pass_
failed_ payment_ back - reconnect_
nodes - pending_htlc_adds includes both the holding cell and in-flight update_add_htlcs, whereas for claims/fails they are separated out.
- remove_
first_ msg_ event_ to_ node - Fetches the first
msg_event
to the passednode_id
in the passedmsg_events
vec. Returns themsg_event
. - route_
over_ limit - route_
payment - send_
along_ route - send_
along_ route_ with_ secret - send_
payment - sign_
funding_ transaction - test_
default_ channel_ config - test_
revoked_ htlc_ claim_ txn_ broadcast - Tests that the given node has broadcast a claim transaction against the provided revoked HTLC transaction.
- test_
txn_ broadcast - Tests that the given node has broadcast transactions for the given Channel
- update_
nodes_ with_ chan_ announce