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

26 lines
564 B

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)
}
if !privateKey.IsEqual(anotherPriKey) {
t.Error("Error when generating bls key.")
}
// Clean up the testing file.
os.Remove(fileName)
}