2020-08-27 12:30:15 +00:00
|
|
|
package pigeon
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestCreateIdentity(t *testing.T) {
|
2020-08-31 11:58:11 +00:00
|
|
|
resetDB()
|
2020-08-27 12:30:15 +00:00
|
|
|
pub, priv := CreateIdentity()
|
2020-08-28 12:24:50 +00:00
|
|
|
dbPubKey := GetConfig("public_key")
|
|
|
|
dbPrivKey := GetConfig("private_key")
|
2020-08-27 12:30:15 +00:00
|
|
|
|
2020-08-28 12:24:50 +00:00
|
|
|
if !bytes.Equal(pub, dbPubKey) {
|
2020-08-27 12:30:15 +00:00
|
|
|
t.Fail()
|
|
|
|
}
|
|
|
|
|
2020-08-28 12:24:50 +00:00
|
|
|
if !bytes.Equal(priv, dbPrivKey) {
|
2020-08-27 12:30:15 +00:00
|
|
|
t.Fail()
|
|
|
|
}
|
|
|
|
}
|