Skip to content

Commit 56ff30c

Browse files
feat(bindings): generate a random private key (#2446)
1 parent 501c92e commit 56ff30c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/waku_thread/config.nim

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ proc parsePrivateKey(jsonNode: JsonNode,
1717
jsonResp: var JsonEvent): bool =
1818

1919
if not jsonNode.contains("key"):
20-
jsonResp = JsonErrorEvent.new("The node key is missing.");
21-
return false
20+
privateKey = PrivateKey.random(Secp256k1, newRng()[]).tryGet()
21+
return true
2222

2323
if jsonNode["key"].kind != JsonNodeKind.JString:
2424
jsonResp = JsonErrorEvent.new("The node key should be a string.");

0 commit comments

Comments
 (0)