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

Function bad_topology

tests/test_pay.py:7427–7446  ·  view source on GitHub ↗

A plugin that sets an arbitary fee for incoming channels. Helper to test encrypted recepient data handling.

(plugin)

Source from the content-addressed store, hash-verified

7425 FINAL_AMT = 1000000
7426
7427 def bad_topology(plugin):
7428 """A plugin that sets an arbitary fee for incoming channels. Helper to
7429 test encrypted recepient data handling."""
7430
7431 @plugin.init()
7432 def init(configuration, options, plugin):
7433 plugin.incoming = None
7434
7435 @plugin.hook("rpc_command")
7436 def on_rpc_command(plugin, rpc_command, **kwargs):
7437 if rpc_command["method"] == "listincoming" and plugin.incoming:
7438 plugin.log(
7439 "Producing fake listincoming with {}".format(plugin.incoming)
7440 )
7441 return {"return": {"result": {"incoming": [plugin.incoming]}}}
7442 return {"result": "continue"}
7443
7444 @plugin.method("setincoming")
7445 def setincoming(plugin, channel):
7446 plugin.incoming = channel
7447
7448 def get_onion(
7449 rpc, invoice, blockheight, my_node, entry_point, scid, in_amount, final_amount

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected