Fix typo in public_key retrieval.
This commit is contained in:
parent
8d02024ff9
commit
5cbb5c9fe8
|
@ -2,7 +2,6 @@ package pigeon
|
|||
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"modernc.org/ql"
|
||||
|
@ -87,7 +86,7 @@ func GetConfig(key string) []byte {
|
|||
err := row.Scan(&result)
|
||||
if err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
fmt.Println("Zero rows found")
|
||||
log.Fatalf("CONFIG MISSING: %s", key)
|
||||
} else {
|
||||
panic(err)
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ func CreateIdentity() (ed25519.PublicKey, ed25519.PrivateKey) {
|
|||
if err != nil {
|
||||
log.Fatalf("Keypair creation error %s", err)
|
||||
}
|
||||
SetConfig("pubic_key", pub)
|
||||
SetConfig("public_key", pub)
|
||||
SetConfig("private_key", priv)
|
||||
return pub, priv
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package pigeon
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
@ -12,11 +11,6 @@ func TestCreateIdentity(t *testing.T) {
|
|||
dbPubKey := GetConfig("public_key")
|
||||
dbPrivKey := GetConfig("private_key")
|
||||
|
||||
fmt.Printf("pub: %s\n", B32Encode(pub))
|
||||
fmt.Printf("priv: %s\n", B32Encode(priv))
|
||||
fmt.Printf("pub: %s\n", B32Encode(dbPrivKey))
|
||||
fmt.Printf("priv: %s\n", B32Encode(dbPubKey))
|
||||
|
||||
if !bytes.Equal(pub, dbPubKey) {
|
||||
t.Fail()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue