mirror of https://github.com/status-im/nim-eth.git
Added PrivateKey.toKeyPair
This commit is contained in:
parent
b7ebf8ed54
commit
fc327718fb
|
@ -135,6 +135,9 @@ proc getPublicKey*(seckey: PrivateKey): PublicKey =
|
|||
cast[ptr cuchar](unsafeAddr seckey)) != 1:
|
||||
raiseSecp256k1Error()
|
||||
|
||||
proc toKeyPair*(key: PrivateKey): KeyPair =
|
||||
KeyPair(seckey: key, pubkey: key.getPublicKey())
|
||||
|
||||
proc newKeyPair*(): KeyPair =
|
||||
## Generates new private and public key.
|
||||
result.seckey = newPrivateKey()
|
||||
|
|
Loading…
Reference in New Issue