Handle string message input for message signing
This commit is contained in:
parent
5810ce25a3
commit
e7820de17f
@ -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
|
||||
|
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user