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/crypto/pki/utils_test.go

21 lines
476 B

package pki
import (
"encoding/binary"
"testing"
"time"
"github.com/harmony-one/bls/ffi/go/bls"
)
func TestGetBLSPrivateKeyFromInt(test *testing.T) {
t := time.Now().UnixNano()
privateKey1 := GetBLSPrivateKeyFromInt(int(t))
priKey := [32]byte{}
binary.LittleEndian.PutUint32(priKey[:], uint32(t))
var privateKey2 bls.SecretKey
privateKey2.SetLittleEndian(priKey[:])
if !privateKey1.IsEqual(&privateKey2) {
test.Error("two public address should be equal")
}
}