mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-05-09 10:28:46 +00:00
core/sign_tx: Minor updates based on code review.
This commit is contained in:
parent
be39f271b0
commit
d58cd3987b
@ -349,7 +349,7 @@ class Bitcoin:
|
|||||||
FailureType.ProcessError, "Transaction has changed during signing"
|
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:
|
if txi_sign.multisig:
|
||||||
multisig.multisig_pubkey_index(txi_sign.multisig, key_sign_pub)
|
multisig.multisig_pubkey_index(txi_sign.multisig, key_sign_pub)
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class Bitcoinlike(Bitcoin):
|
|||||||
|
|
||||||
key_sign = self.keychain.derive(txi_sign.address_n, self.coin.curve_name)
|
key_sign = self.keychain.derive(txi_sign.address_n, self.coin.curve_name)
|
||||||
key_sign_pub = key_sign.public_key()
|
key_sign_pub = key_sign.public_key()
|
||||||
self.hash143_hash = self.hash143.preimage_hash(
|
hash143_hash = self.hash143.preimage_hash(
|
||||||
self.coin,
|
self.coin,
|
||||||
self.tx,
|
self.tx,
|
||||||
txi_sign,
|
txi_sign,
|
||||||
@ -66,11 +66,11 @@ class Bitcoinlike(Bitcoin):
|
|||||||
self.get_hash_type(),
|
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:
|
if txi_sign.multisig:
|
||||||
multisig.multisig_pubkey_index(txi_sign.multisig, key_sign_pub)
|
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
|
# serialize input with correct signature
|
||||||
gc.collect()
|
gc.collect()
|
||||||
|
@ -120,9 +120,6 @@ class Zip143(Bip143):
|
|||||||
|
|
||||||
|
|
||||||
class Zip243(Zip143):
|
class Zip243(Zip143):
|
||||||
def __init__(self, branch_id: int) -> None:
|
|
||||||
super().__init__(branch_id)
|
|
||||||
|
|
||||||
def preimage_hash(
|
def preimage_hash(
|
||||||
self,
|
self,
|
||||||
coin: CoinInfo,
|
coin: CoinInfo,
|
||||||
|
Loading…
Reference in New Issue
Block a user