Rename getKey -> getPublicKey (#621)

* rename getKey to getPublicKey

* use publicKey directly in gossipsub

* update error messages
This commit is contained in:
Tanguy Cizain
2021-09-02 12:03:40 +02:00
committed by GitHub
parent 62ca6dd9a0
commit 8cddfde837
17 changed files with 55 additions and 59 deletions

View File

@@ -141,7 +141,7 @@ proc init*(t: typedesc[SkSignature], data: string): SkResult[SkSignature] =
var sig: SkSignature
sig.init(data) and ok(sig)
proc getKey*(key: SkPrivateKey): SkPublicKey =
proc getPublicKey*(key: SkPrivateKey): SkPublicKey =
## Calculate and return Secp256k1 `public key` from `private key` ``key``.
SkPublicKey(SkSecretKey(key).toPublicKey())
@@ -211,4 +211,4 @@ proc `$`*(key: SkKeyPair): string {.borrow.}
proc `==`*(a, b: SkPrivateKey): bool {.borrow.}
proc `==`*(a, b: SkPublicKey): bool {.borrow.}
proc `==`*(a, b: SkSignature): bool {.borrow.}
proc `==`*(a, b: SkKeyPair): bool {.borrow.}
proc `==`*(a, b: SkKeyPair): bool {.borrow.}