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

27 lines
564 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.Error("Error when generating bls key.")
}
// Clean up the testing file.
os.Remove(fileName)
}