MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_bolt11_null_after_pay

Function test_bolt11_null_after_pay

tests/test_pay.py:4046–4073  ·  view source on GitHub ↗
(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

4044
4045
4046def test_bolt11_null_after_pay(node_factory, bitcoind):
4047 l1, l2 = node_factory.get_nodes(2)
4048
4049 amount_sat = 10 ** 6
4050 # pay a generic bolt11 and test if the label bol11 is null
4051 # inside the command listpays
4052
4053 # create l2->l1 channel.
4054 l2.fundwallet(amount_sat * 5)
4055 l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
4056 # Make sure l2 considers it fully connected too!
4057 wait_for(lambda: l2.rpc.listpeers(l1.info['id']) != {'peers': []})
4058 l2.rpc.fundchannel(l1.info['id'], amount_sat * 3)
4059
4060 # Let the channel confirm.
4061 bitcoind.generate_block(6)
4062 sync_blockheight(bitcoind, [l1, l2])
4063 wait_for(lambda: only_one(l1.rpc.listpeerchannels()['channels'])['state'] == 'CHANNELD_NORMAL')
4064
4065 amt = Millisatoshi(amount_sat * 2 * 1000)
4066 invl1 = l1.rpc.invoice(amt, 'j', 'j')['bolt11']
4067 l2.rpc.pay(invl1)
4068
4069 pays = l2.rpc.listpays()["pays"]
4070 assert(pays[0]["bolt11"] == invl1)
4071 assert('amount_msat' in pays[0] and pays[0]['amount_msat'] == amt)
4072 assert('created_at' in pays[0])
4073 assert('completed_at' in pays[0])
4074
4075
4076def test_delpay_argument_invalid(node_factory, bitcoind):

Callers

nothing calls this directly

Calls 14

wait_forFunction · 0.90
sync_blockheightFunction · 0.90
only_oneFunction · 0.90
MillisatoshiClass · 0.90
get_nodesMethod · 0.80
fundwalletMethod · 0.80
generate_blockMethod · 0.80
listpeerchannelsMethod · 0.80
listpaysMethod · 0.80
connectMethod · 0.45
listpeersMethod · 0.45
fundchannelMethod · 0.45

Tested by

no test coverage detected