Use the raw bytes, not the libp2p protobuf container for sepc256k1 private keys (#3445)

* use the raw bytes, not the libp2p protobuf container for sepc256k1 private keys

* fix tests
This commit is contained in:
Preston Van Loon
2019-09-11 17:04:35 -07:00
committed by GitHub
parent 798bbbdc82
commit ccece73483
4 changed files with 23 additions and 18 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"crypto/ecdsa"
"crypto/rand"
"fmt"
"testing"
"time"
@@ -64,12 +65,12 @@ func TestPrivateKey_ParsesCorrectly(t *testing.T) {
if err != nil {
t.Fatal(err)
}
marshalledKey, err := crypto.MarshalPrivateKey(privKey)
pk, err := privKey.Raw()
if err != nil {
t.Fatal(err)
}
encodedKey := crypto.ConfigEncodeKey(marshalledKey)
*privateKey = encodedKey
*privateKey = fmt.Sprintf("%x", pk)
extractedKey := extractPrivateKey()