mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-09 03:01:19 +00:00
14f77449ce
* next compatible, tests pass * terence feedback * skip comment * fixes * misc fix * on block * parse from unencrypted keys json * mod val client * launching unencrypted workssss * fix broken build * fix up build * rem prints * unencrypted keys file generator * generate json * unencrypted keys gen files * tool done * function abstractions * removed docker img stuff * lint
26 lines
500 B
Go
26 lines
500 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"crypto/rand"
|
|
"encoding/json"
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestSavesUnencryptedKeys(t *testing.T) {
|
|
ctnr := generateUnencryptedKeys(rand.Reader)
|
|
buf := new(bytes.Buffer)
|
|
if err := saveUnencryptedKeysToFile(buf, ctnr); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
enc := buf.Bytes()
|
|
dec := &unencryptedKeysContainer{}
|
|
if err := json.Unmarshal(enc, dec); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if !reflect.DeepEqual(ctnr, dec) {
|
|
t.Errorf("Wanted %v, received %v", ctnr, dec)
|
|
}
|
|
}
|