The core protocol of WoopChain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
woop/internal/blsgen/lib_test.go

31 lines
667 B

6 years ago
package blsgen
import (
"os"
"testing"
)
// TestUpdateStakingList creates a bls key with passphrase and compare it with the one loaded from the generated file.
func TestUpdateStakingList(t *testing.T) {
var err error
privateKey, fileName, err := GenBLSKeyWithPassPhrase("abcd")
if err != nil {
t.Error(err)
}
anotherPriKey, err := LoadBLSKeyWithPassPhrase(fileName, "abcd")
if err != nil {
t.Error(err)
}
6 years ago
if !privateKey.IsEqual(anotherPriKey) {
t.Errorf("Error when generating bls key \n%s\n%s\n%s",
fileName,
privateKey.SerializeToHexStr(),
anotherPriKey.SerializeToHexStr(),
)
6 years ago
}
// Clean up the testing file.
os.Remove(fileName)
}