Skip to main content

Crate lnv2_module_tests

Crate lnv2_module_tests 

Source

ModulesΒ§

common πŸ”’

StructsΒ§

Cli πŸ”’
LnUrlPayInvoiceResponse πŸ”’
LnUrlPayResponse πŸ”’

EnumsΒ§

Commands πŸ”’

ConstantsΒ§

FEE_TOLERANCE_MSAT πŸ”’
The fees of the steps below are not quoted up front, so a balance that moved is checked against its expected value with this much slack. The balances that must not move are checked exactly.
LNURL_BALANCE_WAIT_ATTEMPTS πŸ”’
REFUSED_SEND_WATCH πŸ”’
How long a send refused by the gateway is watched to stay unresolved.

FunctionsΒ§

account_balances πŸ”’
The balance of every account, so a step can show it moved only the accounts it was meant to.
add_gateway πŸ”’
assert_duplicates_refunded πŸ”’
The duplicate-payment assertions for gateways that claim the payment image only after paying and forfeit the duplicates: one settles, two are refunded.
assert_duplicates_refused πŸ”’
The duplicate-payment assertions for gateways that claim the payment image at intake: one send settles, the gateway refuses the other two without paying or forfeiting anything, so they stay unresolved until their contracts expire, and the gateway is reimbursed exactly once.
assert_module_sanity πŸ”’
await_htlc_settled πŸ”’
await_send_within πŸ”’
Waits up to watch for a send to reach its final state, returning None if it is still unresolved by then.
create_htlc πŸ”’
Fund an HTLC of one thousand sats locked to claim_pk, wait for the funding transaction to be accepted and return the funding txid and the contract JSON as the claimer receives them out of band.
ensure_close πŸ”’
ensure_untouched πŸ”’
Every account outside touched holds exactly what it held before.
fetch_invoice πŸ”’
generate_lnurl πŸ”’
join_client πŸ”’
Creates a fresh client and joins it to the federation identified by invite_code, unlike Federation::new_joined_client which always joins whichever federation last wrote the shared invite-code file.
json_string πŸ”’
lnv2_receive_into πŸ”’
lnv2_send_from πŸ”’
main πŸ”’
module_is_present πŸ”’
pegin_gateways πŸ”’
remove_all_gateways πŸ”’
Remove all currently registered gateways, including the ones devimint adds on startup, from the given peers.
remove_gateway πŸ”’
test_accounts πŸ”’
Every module runs against the real mintv2 here, so money bound to a non-primary account has to stay in it across a Lightning refund and claim, an on-chain deposit and withdrawal, and a recovery from seed. The gateways must not be funded when this starts: the refund relies on it.
test_direct_htlc πŸ”’
Exercise the direct HTLC CLI between two clients of the same federation, with the full out-of-band handoff as strings: the claimer’s key, the funder’s funding txid and contract JSON, and the forfeit signature. The claimer’s secret key and preimage are passed through files and stdin.
test_duplicate_payment πŸ”’
Three independent clients β€” two in the primary federation and one in a second federation, all served by the same gateway β€” race to pay the same invoice. The gateway pays the invoice only once, so it may claim only one of the three outgoing contracts regardless of which federation funded them. Exactly one payment settles; how the other two end depends on the gateway version, see assert_duplicates_refunded and assert_duplicates_refused.
test_federation_outage πŸ”’
Stops enough guardians that no threshold of them can answer, checks that a receive is refused without the gateway funding anything, then checks that receives work again once the guardians are back.
test_fees πŸ”’
test_gateway_registration πŸ”’
test_iroh_payment πŸ”’
test_lnurl_pay πŸ”’
test_lnurl_recovery πŸ”’
Tests LNURL receives after recovery from seed.
test_payments πŸ”’
verify_payment πŸ”’
verify_payment_wait πŸ”’
verify_preimage πŸ”’
wait_for_lnurl_balance πŸ”’