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

Function test_millisatoshi_passthrough

tests/test_plugin.py:189–201  ·  view source on GitHub ↗

Ensure that Millisatoshi arguments and return work.

(node_factory)

Source from the content-addressed store, hash-verified

187
188
189def test_millisatoshi_passthrough(node_factory):
190 """ Ensure that Millisatoshi arguments and return work.
191 """
192 plugin_path = os.path.join(os.getcwd(), 'tests/plugins/millisatoshis.py')
193 n = node_factory.get_node(options={'plugin': plugin_path, 'log-level': 'io'})
194
195 # By keyword (plugin literally returns Millisatoshi, which becomes a string)
196 ret = n.rpc.call('echo', {'msat': Millisatoshi(17), 'not_an_msat': '22msat'})['echo_msat']
197 assert Millisatoshi(ret) == Millisatoshi(17)
198
199 # By position
200 ret = n.rpc.call('echo', [Millisatoshi(18), '22msat'])['echo_msat']
201 assert Millisatoshi(ret) == Millisatoshi(18)
202
203
204def test_rpc_passthrough(node_factory):

Callers

nothing calls this directly

Calls 4

MillisatoshiClass · 0.90
joinMethod · 0.80
get_nodeMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected