mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-22 07:34:20 +01:00
chore: some cleanups and minor fixes
This removes debug output and corrects some code nits that have been introduced by the big CI restoration PR #418
This commit is contained in:
committed by
Christian Decker
parent
7f8d4356ed
commit
f3d741e7af
@@ -25,5 +25,4 @@ def test_main(node_factory):
|
||||
l1, l2 = node_factory.line_graph(2, wait_for_announce=True, opts=plugin_opt)
|
||||
# just call main function
|
||||
res = l1.rpc.autopilot_run_once(dryrun=True)
|
||||
#l1.daemon.wait_for_log("I'd like to open [0-9]* new channels with [0-9]* satoshis each")
|
||||
print(res)
|
||||
l1.daemon.wait_for_log("I'd like to open [0-9]+ new channels with [0-9]+msat satoshis each")
|
||||
|
||||
@@ -2,7 +2,7 @@ from backend import Backend
|
||||
import socketbackend
|
||||
from flaky import flaky
|
||||
from pyln.testing.fixtures import * # noqa: F401,F403
|
||||
from pyln.testing.utils import wait_for, sync_blockheight
|
||||
from pyln.testing.utils import sync_blockheight
|
||||
import os
|
||||
import pytest
|
||||
import subprocess
|
||||
@@ -37,7 +37,7 @@ def test_start(node_factory, directory):
|
||||
assert "backup.py" in plugins
|
||||
|
||||
|
||||
def test_start_no_init(node_factory, directory, executor):
|
||||
def test_start_no_init(node_factory, directory):
|
||||
"""The plugin should refuse to start if we haven't initialized the backup
|
||||
"""
|
||||
bpath = os.path.join(directory, 'lightning-1', 'regtest')
|
||||
|
||||
@@ -54,9 +54,10 @@ class Payment(object):
|
||||
def serialize_payload(n, blockheight):
|
||||
block, tx, out = n['channel'].split('x')
|
||||
scid = int(block) << 40 | int(tx) << 16 | int(out)
|
||||
|
||||
def minint(i):
|
||||
if i < 2**8:
|
||||
return struct.pack("!b", i)
|
||||
return struct.pack("!B", i)
|
||||
elif i < 2**16:
|
||||
return struct.pack('!H', i)
|
||||
elif i < 2**32:
|
||||
@@ -213,9 +214,6 @@ def on_htlc_accepted(onion, htlc, plugin, **kwargs):
|
||||
msg.verified = sigcheck['verified']
|
||||
|
||||
preimage = payload.get(TLV_KEYSEND_PREIMAGE)
|
||||
print("YYY")
|
||||
print(htlc)
|
||||
print(onion)
|
||||
if preimage is not None:
|
||||
msg.payment = Payment(preimage.value, htlc['amount_msat'])
|
||||
res = {
|
||||
@@ -226,9 +224,6 @@ def on_htlc_accepted(onion, htlc, plugin, **kwargs):
|
||||
res = {'result': 'continue'}
|
||||
|
||||
plugin.messages.append(msg)
|
||||
print("Delivering message to {c} waiters".format(
|
||||
c=len(plugin.receive_waiters)
|
||||
))
|
||||
for r in plugin.receive_waiters:
|
||||
m = msg.to_dict()
|
||||
m['total_messages'] = len(plugin.messages)
|
||||
|
||||
Reference in New Issue
Block a user