Skip to content

Commit 44adaea

Browse files
authored
refactor: use a more direct and less error-prone return value (#5036)
1 parent 2f1c9e3 commit 44adaea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/crypto/crypto.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func NewEthereumAddress(p ecdsa.PublicKey) ([]byte, error) {
120120
if err != nil {
121121
return nil, err
122122
}
123-
return pubHash[12:], err
123+
return pubHash[12:], nil
124124
}
125125

126126
func LegacyKeccak256(data []byte) ([]byte, error) {
@@ -130,5 +130,5 @@ func LegacyKeccak256(data []byte) ([]byte, error) {
130130
if err != nil {
131131
return nil, err
132132
}
133-
return hasher.Sum(nil), err
133+
return hasher.Sum(nil), nil
134134
}

0 commit comments

Comments
 (0)