From 60c630205941976f8ab155833b93b1c51a877b85 Mon Sep 17 00:00:00 2001 From: duckducknono <65235592+duckducknono@users.noreply.github.com> Date: Mon, 5 Apr 2021 19:12:37 +0100 Subject: [PATCH 1/2] Update rpc.go Added hexutil to prevent undefined bit error on make. --- rpc/rpc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc/rpc.go b/rpc/rpc.go index 96137bb77..1a4237da5 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/sammy007/open-ethereum-pool/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 From 9a2db1e98f2e73baf1c6ee9d505a37aec678bfbd Mon Sep 17 00:00:00 2001 From: duckducknono <65235592+duckducknono@users.noreply.github.com> Date: Mon, 5 Apr 2021 19:14:07 +0100 Subject: [PATCH 2/2] Update util.go --- util/util.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/util.go b/util/util.go index b4219c52e..bfcd600a5 100644 --- a/util/util.go +++ b/util/util.go @@ -8,6 +8,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/common/hexutil" + ) var Ether = math.BigPow(10, 18) @@ -35,7 +37,7 @@ func MakeTimestamp() int64 { func GetTargetHex(diff int64) string { difficulty := big.NewInt(diff) diff1 := new(big.Int).Div(pow256, difficulty) - return string(common.ToHex(diff1.Bytes())) + return string(hexutil.Encode(diff1.Bytes())) } func TargetHexToDiff(targetHex string) *big.Int {