commit 7f8a3628ce14d6387f7a875c1b22e3247220cc8c
parent 6072a998cf51290cae9927b49288028716562cfd
Author: nolash <dev@holbrook.no>
Date: Thu, 23 Sep 2021 20:44:08 +0200
Add sign message alias
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/crypto_dev_signer/eth/signer/defaultsigner.py b/crypto_dev_signer/eth/signer/defaultsigner.py
@@ -80,3 +80,11 @@ class ReferenceSigner(Signer):
pk = coincurve.PrivateKey(secret=self.keyGetter.get(address, password))
z = pk.sign_recoverable(hasher=None, message=message)
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))