MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_makesecret

Function test_makesecret

tests/test_misc.py:3010–3030  ·  view source on GitHub ↗

Test makesecret command.

(node_factory)

Source from the content-addressed store, hash-verified

3008
3009
3010def test_makesecret(node_factory):
3011 """
3012 Test makesecret command.
3013 """
3014
3015 l1 = node_factory.get_node(options={"dev-force-privkey": "1212121212121212121212121212121212121212121212121212121212121212"})
3016 secret = l1.rpc.makesecret("73636220736563726574")["secret"]
3017
3018 assert (secret == "498a16a6c6b82b7280de7f5b0afa0478b29d3a1cbe52c376249cf46abb6c03da")
3019
3020 # Same if we do it by parameter name
3021 assert l1.rpc.makesecret(hex="73636220736563726574")["secret"] == secret
3022
3023 # Changing seed changes secret!
3024 assert l1.rpc.makesecret(hex="73636220736563726575")["secret"] != secret
3025 assert l1.rpc.makesecret(hex="736362207365637265")["secret"] != secret
3026 assert l1.rpc.makesecret(hex="7363622073656372657401")["secret"] != secret
3027
3028 # Using string works!
3029 assert l1.rpc.makesecret(string="scb secret")["secret"] == secret
3030 assert l1.rpc.makesecret(None, "scb secret")["secret"] == secret
3031
3032
3033def test_staticbackup(node_factory):

Callers

nothing calls this directly

Calls 1

get_nodeMethod · 0.45

Tested by

no test coverage detected