Explorar o código

Merge pull request #786 from tgerring/issue739

Empty Call response should return 0x instead of 0x00. Closes #739
Jeffrey Wilcke %!s(int64=10) %!d(string=hai) anos
pai
achega
67cc80ba66
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      rpc/api.go

+ 5 - 1
rpc/api.go

@@ -189,7 +189,11 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
 			return err
 		}
 		// TODO unwrap the parent method's ToHex call
-		*reply = newHexData(common.FromHex(v))
+		if v == "0x0" {
+			*reply = newHexData([]byte{})
+		} else {
+			*reply = newHexData(common.FromHex(v))
+		}
 	case "eth_flush":
 		return NewNotImplementedError(req.Method)
 	case "eth_getBlockByHash":