mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
lightningd: listconfigs update, using configvars code.
listconfigs is convenient, but it doesn't handle multi-options well: it outputs an object with duplicate fields in this case (e.g. log-file), nor is it extensible to show more than raw values. However, listconfigs doesn't do what other list commands do (use a sub-object "configs") so we can put the new values under that. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: JSON-RPC: `listconfigs` now has `configs` subobject with more information about each config option.
This commit is contained in:
@@ -741,11 +741,16 @@ def test_listconfigs(node_factory, bitcoind, chainparams):
|
||||
|
||||
# Test one at a time.
|
||||
for c in configs.keys():
|
||||
if c.startswith('#') or c.startswith('plugins') or c == 'important-plugins':
|
||||
if c.startswith('#') or c.startswith('plugins') or c == 'important-plugins' or c == 'configs':
|
||||
continue
|
||||
oneconfig = l1.rpc.listconfigs(config=c)
|
||||
assert(oneconfig[c] == configs[c])
|
||||
|
||||
# Test modern ones!
|
||||
for c in configs['configs'].keys():
|
||||
oneconfig = l1.rpc.listconfigs(config=c)['configs']
|
||||
assert(oneconfig[c] == configs['configs'][c])
|
||||
|
||||
|
||||
def test_listconfigs_plugins(node_factory, bitcoind, chainparams):
|
||||
l1 = node_factory.get_node()
|
||||
|
||||
Reference in New Issue
Block a user