Skip to content

Commit 98ea732

Browse files
committed
refactor: use a more direct and less error-prone return value
Signed-off-by: tcpdumppy <847462026@qq.com>
1 parent fb62fa4 commit 98ea732

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)