Skip to content

Commit

Permalink
pytest plugins: use the standard 'no operation' syntax for hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
darosior authored and ZmnSCPxj committed Feb 4, 2020
1 parent 6e34aa2 commit 9030e5d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/plugins/dblog.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def db_write(plugin, writes, **kwargs):

plugin.conn.execute("COMMIT;")

return True
return {"result": "continue"}


plugin.add_option('dblog-file', None, 'The db file to create.')
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/hold_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@plugin.hook('invoice_payment')
def on_payment(payment, plugin, **kwargs):
time.sleep(float(plugin.get_option('holdtime')))
return {}
return {'result': 'continue'}


plugin.add_option('holdtime', '10', 'The time to hold invoice for.')
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/reject_some_invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def on_payment(payment, plugin, **kwargs):
WIRE_TEMPORARY_NODE_FAILURE = 0x2002
return {'failure_code': WIRE_TEMPORARY_NODE_FAILURE}

return {}
return {'result': 'continue'}


plugin.run()
2 changes: 1 addition & 1 deletion tests/plugins/rpc_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def on_rpc_command(plugin, rpc_command, **kwargs):
elif request["method"] == "help":
request["method"] = "autocleaninvoice"
return {"replace": request}
return {"continue": True}
return {"result": "continue"}


plugin.run()

0 comments on commit 9030e5d

Please sign in to comment.