From 14beb2b0b4b90d8bb6244d83a7c0832de49215fa Mon Sep 17 00:00:00 2001 From: Andreas Schmid Date: Wed, 19 Apr 2017 23:01:19 +0200 Subject: [PATCH 1/2] Fix eth_call by adding 0x prefix which is required by geth > 1.6 --- ethjsonrpc/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethjsonrpc/client.py b/ethjsonrpc/client.py index 89a9edb..05e777f 100644 --- a/ethjsonrpc/client.py +++ b/ethjsonrpc/client.py @@ -113,7 +113,7 @@ def call(self, address, sig, args, result_types): transaction (useful for reading data) ''' data = self._encode_function(sig, args) - data_hex = data.encode('hex') + data_hex = '0x{0}'.format(data.encode('hex')) response = self.eth_call(to_address=address, data=data_hex) return decode_abi(result_types, response[2:].decode('hex')) From 11822f3b2bd9da4a73c34b1b74c6a110417febe0 Mon Sep 17 00:00:00 2001 From: Andreas Schmid Date: Wed, 19 Apr 2017 23:03:41 +0200 Subject: [PATCH 2/2] Add support for personal_ecRecover --- ethjsonrpc/client.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ethjsonrpc/client.py b/ethjsonrpc/client.py index 05e777f..739e5c8 100644 --- a/ethjsonrpc/client.py +++ b/ethjsonrpc/client.py @@ -714,6 +714,14 @@ def shh_getMessages(self, filter_id): ''' return self._call('shh_getMessages', [filter_id]) + def personal_ecRevoer(self, message, signature): + ''' + https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_ecRecover + + NEEDS TESTED + ''' + return self._call('personal_ecRecover', [message, signature]) + class ParityEthJsonRpc(EthJsonRpc): '''