Ensure that Millisatoshi arguments and return work.
(node_factory)
| 187 | |
| 188 | |
| 189 | def 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 | |
| 204 | def test_rpc_passthrough(node_factory): |
nothing calls this directly
no test coverage detected