lightningd: have makesecret take hex or string (just like datastore)

Changelog-Added: JSON-RPC: `makesecret` can take a string argument instead of hex.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-09-29 13:18:53 +09:30
parent 6adb1e0b4b
commit 49fe1c8ed7
4 changed files with 29 additions and 13 deletions

View File

@@ -2281,6 +2281,10 @@ def test_makesecret(node_factory):
assert l1.rpc.makesecret(hex="736362207365637265")["secret"] != secret
assert l1.rpc.makesecret(hex="7363622073656372657401")["secret"] != secret
# Using string works!
assert l1.rpc.makesecret(string="scb secret")["secret"] == secret
assert l1.rpc.makesecret(None, "scb secret")["secret"] == secret
def test_staticbackup(node_factory):
"""