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§
- Claim
Along Route Args - Dedicated
Entropy - For use with
OnionMessengerotherwisetest_restored_packages_retrywill fail. This is because that test uses older serialized data produced by callingEntropySourcein a specific manner. Using the sameEntropySourcewithOnionMessengerwould introduce another call, causing the produced data to no longer match. - Expected
Close Event - 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 theNodeare not safe to use (i.e. the ones behind anRc), but that’s left to the caller to figure out. - Pass
Along Path Args - 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_
closed_ events - Check that multiple channel closing events have 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_ackresponse. i.e.do_main_commitment_signed_danceplus therevoke_and_ackresponse 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 - connect_
dummy_ node - 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 - disconnect_
dummy_ node - do_
check_ spends - do_
claim_ payment_ along_ route - do_
commitment_ signed_ dance - Runs a full commitment_signed dance, delivering a commitment_signed, the responding
revoke_and_ackandcommitment_signed, and then the finalrevoke_and_ackresponse. - do_
main_ commitment_ signed_ dance - Does the main logic in the commitment_signed dance. After the first
commitment_signedhas been delivered, this method picks up and delivers the responserevoke_and_ackandcommitment_signed, returning the recipient’srevoke_and_ackand any extra message it may have included. - do_
pass_ along_ path - exchange_
open_ accept_ chan - expect_
channel_ pending_ event - expect_
channel_ ready_ event - expect_
payment_ failed_ conditions - expect_
payment_ failed_ conditions_ event - expect_
payment_ forwarded - Returns the total fee earned by this HTLC forward, in msat.
- expect_
payment_ sent - expect_
pending_ htlcs_ forwardable_ conditions - Checks that an
Event::PendingHTLCsForwardableis available in the given events and, if there are anyEvent::HTLCHandlingFailedevents theirHTLCDestinationis included in theexpected_failuresset. - expect_
probe_ successful_ events - fail_
payment - fail_
payment_ along_ route - find_
route - Like
get_routeabove, but adds a random CLTV offset to the final hop. - 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_eventto the passednode_idin the passedmsg_eventsvec. Returns themsg_event. - route_
over_ limit - route_
payment - send_
along_ route - send_
along_ route_ with_ secret - send_
payment - send_
probe_ along_ route - 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