Handle string message input for message signing

This commit is contained in:
nolash 2020-12-25 11:56:33 +01:00
parent 5810ce25a3
commit e7820de17f
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,5 @@
* 0.4.9
- Accept string message format for message signing
* 0.4.8
- Fix server crash on sign request for unknown key
* 0.4.7

View File

@ -117,7 +117,10 @@ def eth_signTransaction(tx):
def eth_sign(address, message):
logg.debug('got message {} to sign'.format(p[0]))
return signer.signEthereumMessage(address, message)
message_type = type(message).__name__
if message_type != 'str':
raise ValueError('invalid message format, must be {}, not {}'.format(message_type))
return signer.signEthereumMessage(address, message.encode('utf-8'))
methods = {

View File

@ -24,7 +24,7 @@ f.close()
setup(
name="crypto-dev-signer",
version="0.4.8",
version="0.4.9",
description="A signer and keystore daemon and library for cryptocurrency software development",
author="Louis Holbrook",
author_email="dev@holbrook.no",