Skip to content

Commit

Permalink
accounts: remove redundant string conversion (ethereum#29184)
Browse files Browse the repository at this point in the history
  • Loading branch information
cuinix authored Mar 7, 2024
1 parent aadcb88 commit 3bebabb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion accounts/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func TextHash(data []byte) []byte {
//
// This gives context to the signed message and prevents signing of transactions.
func TextAndHash(data []byte) ([]byte, string) {
msg := fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(data), string(data))
msg := fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(data), data)
hasher := sha3.NewLegacyKeccak256()
hasher.Write([]byte(msg))
return hasher.Sum(nil), msg
Expand Down

0 comments on commit 3bebabb

Please sign in to comment.