Add missing param in middleware for sign
This commit is contained in:
parent
07bdbe9999
commit
0afacff6c6
@ -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
|
||||
|
@ -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__))
|
||||
|
@ -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'))
|
||||
|
2
setup.py
2
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",
|
||||
|
@ -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__':
|
||||
|
Loading…
Reference in New Issue
Block a user