From ad19ce5671a7012f5ea79605dc6ae4bd55fba86b Mon Sep 17 00:00:00 2001 From: yuriy0803 <68668177+yuriy0803@users.noreply.github.com> Date: Mon, 22 Feb 2021 20:51:40 +0100 Subject: [PATCH] Update rpc.go --- rpc/rpc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc/rpc.go b/rpc/rpc.go index fc11c6d..8c9e407 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -12,7 +12,7 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/yuriy0803/open-etc-pool-friends/util" ) @@ -177,7 +177,7 @@ func (r *RPCClient) GetBalance(address string) (*big.Int, error) { func (r *RPCClient) Sign(from string, s string) (string, error) { hash := sha256.Sum256([]byte(s)) - rpcResp, err := r.doPost(r.Url, "eth_sign", []string{from, common.ToHex(hash[:])}) + rpcResp, err := r.doPost(r.Url, "eth_sign", []string{from, hexutil.Encode(hash[:])}) var reply string if err != nil { return reply, err