Commit 889a5e0c authored by Péter Szilágyi's avatar Péter Szilágyi Committed by GitHub

Merge pull request #3368 from bas-vk/sha3

node: improve error handling for web3_sha3 RPC method
parents 9f8bc00c 1fc5cc1b
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/discover"
...@@ -331,6 +331,6 @@ func (s *PublicWeb3API) ClientVersion() string { ...@@ -331,6 +331,6 @@ func (s *PublicWeb3API) ClientVersion() string {
// Sha3 applies the ethereum sha3 implementation on the input. // Sha3 applies the ethereum sha3 implementation on the input.
// It assumes the input is hex encoded. // It assumes the input is hex encoded.
func (s *PublicWeb3API) Sha3(input string) string { func (s *PublicWeb3API) Sha3(input hexutil.Bytes) hexutil.Bytes {
return common.ToHex(crypto.Keccak256(common.FromHex(input))) return crypto.Keccak256(input)
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment