mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 23:08:14 +00:00
feat(common): Add no_script_type option to SignMessage.
This commit is contained in:
parent
0870befe58
commit
c2f1850abb
@ -152,6 +152,7 @@ message SignMessage {
|
||||
required bytes message = 2; // message to be signed
|
||||
optional string coin_name = 3 [default='Bitcoin']; // coin to use for signing
|
||||
optional InputScriptType script_type = 4 [default=SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.)
|
||||
optional bool no_script_type = 5; // don't include script type information in the recovery byte of the signature, same as in Bitcoin Core
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -526,6 +526,7 @@ if TYPE_CHECKING:
|
||||
message: "bytes"
|
||||
coin_name: "str"
|
||||
script_type: "InputScriptType"
|
||||
no_script_type: "bool | None"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -534,6 +535,7 @@ if TYPE_CHECKING:
|
||||
address_n: "list[int] | None" = None,
|
||||
coin_name: "str | None" = None,
|
||||
script_type: "InputScriptType | None" = None,
|
||||
no_script_type: "bool | None" = None,
|
||||
) -> None:
|
||||
pass
|
||||
|
||||
|
1
python/.changelog.d/1586.added
Normal file
1
python/.changelog.d/1586.added
Normal file
@ -0,0 +1 @@
|
||||
Support no_script_type option in SignMessage.
|
@ -1067,6 +1067,7 @@ class SignMessage(protobuf.MessageType):
|
||||
2: protobuf.Field("message", "bytes", repeated=False, required=True),
|
||||
3: protobuf.Field("coin_name", "string", repeated=False, required=False),
|
||||
4: protobuf.Field("script_type", "InputScriptType", repeated=False, required=False),
|
||||
5: protobuf.Field("no_script_type", "bool", repeated=False, required=False),
|
||||
}
|
||||
|
||||
def __init__(
|
||||
@ -1076,11 +1077,13 @@ class SignMessage(protobuf.MessageType):
|
||||
address_n: Optional[List["int"]] = None,
|
||||
coin_name: Optional["str"] = 'Bitcoin',
|
||||
script_type: Optional["InputScriptType"] = InputScriptType.SPENDADDRESS,
|
||||
no_script_type: Optional["bool"] = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.message = message
|
||||
self.coin_name = coin_name
|
||||
self.script_type = script_type
|
||||
self.no_script_type = no_script_type
|
||||
|
||||
|
||||
class MessageSignature(protobuf.MessageType):
|
||||
|
Loading…
Reference in New Issue
Block a user