Browse Source

Update rpc.go

master
yuriy0803 5 years ago committed by GitHub
parent
commit
ad19ce5671
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      rpc/rpc.go

4
rpc/rpc.go

@ -12,7 +12,7 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/yuriy0803/open-etc-pool-friends/util" "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) { func (r *RPCClient) Sign(from string, s string) (string, error) {
hash := sha256.Sum256([]byte(s)) 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 var reply string
if err != nil { if err != nil {
return reply, err return reply, err

Loading…
Cancel
Save