feat(bindings): generate a random private key (#2446)

This commit is contained in:
richΛrd 2024-02-20 11:18:03 -04:00 committed by GitHub
parent 501c92e2c3
commit 56ff30ca75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -17,8 +17,8 @@ proc parsePrivateKey(jsonNode: JsonNode,
jsonResp: var JsonEvent): bool =
if not jsonNode.contains("key"):
jsonResp = JsonErrorEvent.new("The node key is missing.");
return false
privateKey = PrivateKey.random(Secp256k1, newRng()[]).tryGet()
return true
if jsonNode["key"].kind != JsonNodeKind.JString:
jsonResp = JsonErrorEvent.new("The node key should be a string.");