diff --git a/CHANGELOG b/CHANGELOG index 3fbfe7b..9959c74 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +- 0.4.10 + - Add bytes and string handling in inner signer backend * 0.4.9 - Accept string message format for message signing * 0.4.8 diff --git a/crypto_dev_signer/eth/signer/defaultsigner.py b/crypto_dev_signer/eth/signer/defaultsigner.py index 1490550..9c2a7d6 100644 --- a/crypto_dev_signer/eth/signer/defaultsigner.py +++ b/crypto_dev_signer/eth/signer/defaultsigner.py @@ -46,8 +46,10 @@ class ReferenceSigner(Signer): #z = keys.ecdsa_sign(message_hash=g, private_key=k) z = None if type(message).__name__ == 'str': + logg.debug('signing message in "str" format: {}'.format(message)) z = k.sign_msg(message.encode('utf-8')) elif type(message).__name__ == 'bytes': + logg.debug('signing message in "bytes" format: {}'.format(message.hex())) z = k.sign_msg(message) else: raise ValueError('message must be type str or bytes, received {}'.format(type(message).__name__)) diff --git a/crypto_dev_signer/eth/web3ext/middleware.py b/crypto_dev_signer/eth/web3ext/middleware.py index fd734f0..ab0df1b 100644 --- a/crypto_dev_signer/eth/web3ext/middleware.py +++ b/crypto_dev_signer/eth/web3ext/middleware.py @@ -99,7 +99,7 @@ class PlatformMiddleware: s = socket.socket(family=socket.AF_UNIX, type=socket.SOCK_STREAM, proto=0) ipc_provider_workaround = s.connect(self.ipcaddr) logg.info('redirecting method {} params {} original paramsĀ {}'.format(method, params, suspect_params)) - o = jsonrpc_request(method, params[0]) + o = jsonrpc_request(method, params[0], params[1]) j = json.dumps(o) logg.debug('send {}'.format(j)) s.send(j.encode('utf-8')) diff --git a/setup.py b/setup.py index d256851..eace084 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ f.close() setup( name="crypto-dev-signer", - version="0.4.9", + version="0.4.10", description="A signer and keystore daemon and library for cryptocurrency software development", author="Louis Holbrook", author_email="dev@holbrook.no", diff --git a/test/test_sign.py b/test/test_sign.py index 0f1026b..5ce5c23 100644 --- a/test/test_sign.py +++ b/test/test_sign.py @@ -90,6 +90,7 @@ class TestSign(unittest.TestCase): def test_sign_message(self): s = ReferenceSigner(self.pk_getter) z = s.signEthereumMessage(tx_ints['from'], 'foo') + z = s.signEthereumMessage(tx_ints['from'], b'foo') if __name__ == '__main__':