lightningd: use ccan/json_out.

This is now a fairly simple transition, which only effects the internals
of json_stream.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-06-12 10:08:55 +09:30
parent 7f75043ab2
commit d817735dc2
3 changed files with 59 additions and 182 deletions

View File

@@ -636,13 +636,14 @@ def test_cli(node_factory):
except Exception:
pass
# Test it escapes JSON properly in both method and params.
# Test it escapes JSON completely in both method and params.
# cli turns " into \", reply turns that into \\\".
out = subprocess.run(['cli/lightning-cli',
'--lightning-dir={}'
.format(l1.daemon.lightning_dir),
'x"[]{}'],
stdout=subprocess.PIPE)
assert 'Unknown command \'x\\"[]{}\'' in out.stdout.decode('utf-8')
assert 'Unknown command \'x\\\\\\"[]{}\'' in out.stdout.decode('utf-8')
subprocess.check_output(['cli/lightning-cli',
'--lightning-dir={}'