1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 05:28:40 +00:00

core/sign_tx: Minor updates based on code review.

This commit is contained in:
Andrew Kozlik 2020-04-24 16:22:06 +02:00 committed by Andrew Kozlik
parent be39f271b0
commit d58cd3987b
3 changed files with 4 additions and 7 deletions

View File

@ -349,7 +349,7 @@ class Bitcoin:
FailureType.ProcessError, "Transaction has changed during signing"
)
# if multisig, check if signing with a key that is included in multisig
# if multisig, do a sanity check to ensure we are signing with a key that is included in the multisig
if txi_sign.multisig:
multisig.multisig_pubkey_index(txi_sign.multisig, key_sign_pub)

View File

@ -58,7 +58,7 @@ class Bitcoinlike(Bitcoin):
key_sign = self.keychain.derive(txi_sign.address_n, self.coin.curve_name)
key_sign_pub = key_sign.public_key()
self.hash143_hash = self.hash143.preimage_hash(
hash143_hash = self.hash143.preimage_hash(
self.coin,
self.tx,
txi_sign,
@ -66,11 +66,11 @@ class Bitcoinlike(Bitcoin):
self.get_hash_type(),
)
# if multisig, check if signing with a key that is included in multisig
# if multisig, do a sanity check to ensure we are signing with a key that is included in the multisig
if txi_sign.multisig:
multisig.multisig_pubkey_index(txi_sign.multisig, key_sign_pub)
signature = ecdsa_sign(key_sign, self.hash143_hash)
signature = ecdsa_sign(key_sign, hash143_hash)
# serialize input with correct signature
gc.collect()

View File

@ -120,9 +120,6 @@ class Zip143(Bip143):
class Zip243(Zip143):
def __init__(self, branch_id: int) -> None:
super().__init__(branch_id)
def preimage_hash(
self,
coin: CoinInfo,