Skip to content

Commit

Permalink
Remove check for zerohash (#1481)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhkimqd committed May 9, 2023
1 parent 062414f commit 055e0ae
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
4 changes: 0 additions & 4 deletions crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ func RecoverPubkey(signature, hash []byte) (*ecdsa.PublicKey, error) {
return nil, errHashOfInvalidLength
}

if types.BytesToHash(hash) == types.ZeroHash {
return nil, errZeroHash
}

size := len(signature)
term := byte(27)

Expand Down
7 changes: 0 additions & 7 deletions crypto/crypto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,13 +456,6 @@ func TestRecoverPublicKey(t *testing.T) {
require.ErrorIs(t, err, errHashOfInvalidLength)
})

t.Run("Zero hash", func(t *testing.T) {
t.Parallel()

_, err := RecoverPubkey(testSignature, types.ZeroHash[:])
require.ErrorIs(t, err, errZeroHash)
})

t.Run("Ok signature and hash", func(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit 055e0ae

Please sign in to comment.