Add sign message alias

This commit is contained in:
nolash 2021-09-23 20:44:08 +02:00
parent 6072a998cf
commit 7f8a3628ce
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -80,3 +80,11 @@ class ReferenceSigner(Signer):
pk = coincurve.PrivateKey(secret=self.keyGetter.get(address, password)) pk = coincurve.PrivateKey(secret=self.keyGetter.get(address, password))
z = pk.sign_recoverable(hasher=None, message=message) z = pk.sign_recoverable(hasher=None, message=message)
return z return z
def sign_message(self, address, message, password=None, dialect='eth'):
if dialect == None:
return self.sign_pure(address, message, password=password)
elif dialect == 'eth':
return self.sign_ethereum_message(address, message, password=password)
raise ValueError('Unknown message sign dialect "{}"'.format(dialect))