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