Commit 5fdec140 authored by jiangpeng's avatar jiangpeng Committed by 33cn

fix privacy test

parent a9e3544c
......@@ -51,11 +51,17 @@ func (*signatureMock) Equals(crypto.Signature) bool {
return true
}
func formatByte32(b []byte) []byte {
var b32 [32]byte
copy(b32[:], b)
return b32[:]
}
type privKeyMock struct {
}
func (mock *privKeyMock) Bytes() []byte {
return []byte("1234")
return formatByte32([]byte("1234"))
}
func (mock *privKeyMock) Sign(msg []byte) crypto.Signature {
......@@ -82,7 +88,7 @@ func TestNewPrivacy(t *testing.T) {
}
func test_RecoverOnetimePriKey(t *testing.T) {
R := []byte("1234")
R := formatByte32([]byte("1234"))
pkm := privKeyMock{}
privKey, err := RecoverOnetimePriKey(R, &pkm, &pkm, 0)
assert.Nil(t, err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment