| 7 | |
| 8 | @plugin.method("echo") |
| 9 | def echo(plugin, msat: Millisatoshi, not_an_msat): |
| 10 | plugin.log("got echo for {} {} (types {} and {})" |
| 11 | .format(msat, not_an_msat, type(msat), type(not_an_msat))) |
| 12 | if not isinstance(msat, Millisatoshi): |
| 13 | raise TypeError("msat must be Millisatoshi not {}".format(type(msat))) |
| 14 | if isinstance(not_an_msat, Millisatoshi): |
| 15 | raise TypeError("not_an_msat must not be Millisatoshi") |
| 16 | plugin.log("got echo for {} (type {})".format(msat, type(msat))) |
| 17 | if not isinstance(msat, Millisatoshi): |
| 18 | raise TypeError("msat must be Millisatoshi not {}".format(type(msat))) |
| 19 | plugin.log("Returning {}".format(msat)) |
| 20 | return {'echo_msat': msat} |
| 21 | |
| 22 | |
| 23 | plugin.run() |