Skip to content

Instantly share code, notes, and snippets.

View bshramin's full-sized avatar

Amin Bashiri bshramin

View GitHub Profile
0')
FAILED tests/test_bolt2-01-close_channel.py::test_close_channel_shutdown_msg_wrong_script_pubkey_receiver_side - AssertionError: (<lnprototest.event.Block object at 0x7f29ee953670>, 'Cannot generate block #102 at height 0')
FAILED tests/test_bolt2-01-open_channel.py::test_open_channel_announce_features - AssertionError: (<lnprototest.event.Block object at 0x7f29ee1840a0>, 'Cannot generate block #102 at height 0')
FAILED tests/test_bolt2-01-open_channel.py::test_open_channel_from_accepter_side - AssertionError: (<lnprototest.event.Block object at 0x7f29ec706050>, 'Cannot generate block #102 at height 0')
FAILED tests/test_bolt2-02-reestablish.py::test_reestablish - AssertionError: (<lnprototest.event.Block object at 0x7f29eee2f640>, 'Cannot generate block #102 at height 0')
FAILED tests/test_bolt2-10-add-htlc.py::test_htlc_add - lnprototest.errors.SpecFileError: (<lnprototest.event.Block object at 0x7f29ec7601c0>, 'Cannot generate block #102 at height 0')
FAILED tests/test_bolt7-01-channel_announcement-su
@bshramin
bshramin / gist:6fe6cfe3b67908331a703a788f9b51f0
Created March 6, 2023 04:06
Add a hop to rust-lightning test
#[test]
fn test_onchain_to_onchain_claim() {
// Test that in case of channel closure, we detect the state of output and claim HTLC
// on downstream peer's remote commitment tx.
// First, have C claim an HTLC against its own latest commitment transaction.
// Then, broadcast these to B, which should update the monitor downstream on the A<->B
// channel.
// Finally, check that B will claim the HTLC output if A's latest commitment transaction
// gets broadcast.
@bshramin
bshramin / gist:79db938acb8c71d3a1981e1eb87cb3fe
Created March 4, 2023 23:09
rust-lightning add a node to test_onchain_to_onchain_claim test
#[test]
fn test_onchain_to_onchain_claim() {
// Test that in case of channel closure, we detect the state of output and claim HTLC
// on downstream peer's remote commitment tx.
// First, have C claim an HTLC against its own latest commitment transaction.
// Then, broadcast these to B, which should update the monitor downstream on the A<->B
// channel.
// Finally, check that B will claim the HTLC output if A's latest commitment transaction
// gets broadcast.
@bshramin
bshramin / gist:9a26a9dfefc23f8c22bf898fa623f247
Created March 4, 2023 21:59
LND multi-hop payment test
func testSingleHopInvoice(ht *lntemp.HarnessTest) {
// Open a channel with 100k satoshis between Alice and Bob with Alice
// being the sole funder of the channel.
chanAmt := btcutil.Amount(100000)
alice, bob := ht.Alice, ht.Bob
carol := ht.NewNode("Carol", nil)
cp := ht.OpenChannel(
alice, bob, lntemp.OpenChannelParams{Amt: chanAmt},
)