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
gzliudan committed Jan 22, 2025
1 parent 5b15400 commit 19a866b
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 @@ -208,7 +208,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 19a866b

Please sign in to comment.