mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
965c20caae
72d103d6bb
deprecated DEVELOPER env var in favor of config.vars, but didn't update test_closing.py or test_gossip.py.5d0a54b7f0
then removed the explicit DEVELOPER= setting from Travis. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
32 lines
1.0 KiB
Python
32 lines
1.0 KiB
Python
from fixtures import * # noqa: F401,F403
|
|
|
|
import os
|
|
|
|
with open('config.vars') as configfile:
|
|
config = dict([(line.rstrip().split('=', 1)) for line in configfile])
|
|
|
|
DEVELOPER = os.getenv("DEVELOPER", config['DEVELOPER']) == "1"
|
|
|
|
|
|
def test_closing_id(node_factory):
|
|
"""Test closing using peer ID and full channel ID
|
|
"""
|
|
l1, l2 = node_factory.get_nodes(2)
|
|
|
|
# Close by full channel ID.
|
|
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
|
|
l1.fund_channel(l2, 10**6)
|
|
cid = l2.rpc.listpeers()['peers'][0]['channels'][0]['channel_id']
|
|
l2.rpc.close(cid)
|
|
l1.daemon.wait_for_log("Forgetting remote peer .*")
|
|
l2.daemon.wait_for_log("Forgetting remote peer .*")
|
|
|
|
# Close by peer ID.
|
|
l2.rpc.connect(l1.info['id'], 'localhost', l1.port)
|
|
l1.daemon.wait_for_log("hand_back_peer .*: now local again")
|
|
l2.fund_channel(l1, 10**6)
|
|
pid = l1.info['id']
|
|
l2.rpc.close(pid)
|
|
l1.daemon.wait_for_log("Forgetting remote peer .*")
|
|
l2.daemon.wait_for_log("Forgetting remote peer .*")
|