mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 15:04:19 +01:00
lightningd: fix handling of truncated config options.
Do the same thing '--help' does with them; append `...`. Valgrind noticed that we weren't NUL-terminarting if answer was over 78 characters. Changelog-Fixed: JSONRPC: listconfigs appends '...' to truncated config options.
This commit is contained in:
@@ -732,13 +732,16 @@ def test_address(node_factory):
|
||||
|
||||
|
||||
def test_listconfigs(node_factory, bitcoind, chainparams):
|
||||
l1 = node_factory.get_node()
|
||||
# Make extremely long entry, check it works
|
||||
l1 = node_factory.get_node(options={'log-prefix': 'lightning1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'})
|
||||
|
||||
configs = l1.rpc.listconfigs()
|
||||
# See utils.py
|
||||
assert configs['allow-deprecated-apis'] is False
|
||||
assert configs['network'] == chainparams['name']
|
||||
assert configs['ignore-fee-limits'] is False
|
||||
assert configs['ignore-fee-limits'] is False
|
||||
assert configs['log-prefix'] == 'lightning1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...'
|
||||
|
||||
# Test one at a time.
|
||||
for c in configs.keys():
|
||||
|
||||
Reference in New Issue
Block a user