Skip to content

Commit

Permalink
Unpacking variable for cleaner code for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
rbndg authored and cdecker committed May 4, 2020
1 parent 3c3144f commit e4f0721
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions contrib/plugins/helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,14 @@ def on_disconnect(plugin, id, **kwargs):

@plugin.subscribe("invoice_payment")
def on_payment(plugin, invoice_payment, **kwargs):
plugin.log("Received invoice_payment event for label {}, preimage {},"
" and amount of {}".format(invoice_payment.get("label"),
invoice_payment.get("preimage"),
invoice_payment.get("msat")))
plugin.log("Received invoice_payment event for label {label}, preimage {preimage},"
" and amount of {msat}".format(**invoice_payment))


@plugin.subscribe("invoice_creation")
def on_invoice_creation(plugin, invoice_creation, **kwargs):
plugin.log("Received invoice_creation event for label {}, preimage {},"
" and amount of {}".format(invoice_creation.get("label"),
invoice_creation.get("preimage"),
invoice_creation.get("msat")))
plugin.log("Received invoice_creation event for label {label}, preimage {preimage},"
" and amount of {msat}".format(**invoice_creation))


@plugin.hook("htlc_accepted")
Expand Down

0 comments on commit e4f0721

Please sign in to comment.