1
0

keystore.sign_message: add optional script_type argument

this is used by trezor
(and also by bitbox02, which was using a workaround previously)

fixes https://github.com/spesmilo/electrum/issues/7670
This commit is contained in:
SomberNight
2022-02-22 19:20:03 +01:00
parent 6603359c20
commit 376fc01b27
11 changed files with 37 additions and 21 deletions

View File

@@ -127,7 +127,14 @@ class KeyStore(Logger, ABC):
pass
@abstractmethod
def sign_message(self, sequence: 'AddressIndexGeneric', message, password) -> bytes:
def sign_message(
self,
sequence: 'AddressIndexGeneric',
message: str,
password,
*,
script_type: Optional[str] = None,
) -> bytes:
pass
@abstractmethod
@@ -175,7 +182,7 @@ class Software_KeyStore(KeyStore):
def may_have_password(self):
return not self.is_watching_only()
def sign_message(self, sequence, message, password) -> bytes:
def sign_message(self, sequence, message, password, *, script_type=None) -> bytes:
privkey, compressed = self.get_private_key(sequence, password)
key = ecc.ECPrivkey(privkey)
return key.sign_message(message, compressed)