1
0

transaction: tx.sign API change: rm hex usage

This commit is contained in:
SomberNight
2024-04-29 16:32:19 +00:00
parent 2f1095510c
commit 13d9677e53
11 changed files with 59 additions and 42 deletions

View File

@@ -422,9 +422,9 @@ class Commands:
sec = txin_dict.get('privkey')
if sec:
txin_type, privkey, compressed = bitcoin.deserialize_privkey(sec)
pubkey = ecc.ECPrivkey(privkey).get_public_key_hex(compressed=compressed)
keypairs[pubkey] = privkey, compressed
desc = descriptor.get_singlesig_descriptor_from_legacy_leaf(pubkey=pubkey, script_type=txin_type)
pubkey = ecc.ECPrivkey(privkey).get_public_key_bytes(compressed=compressed)
keypairs[pubkey] = privkey
desc = descriptor.get_singlesig_descriptor_from_legacy_leaf(pubkey=pubkey.hex(), script_type=txin_type)
txin.script_descriptor = desc
inputs.append(txin)
@@ -465,7 +465,7 @@ class Commands:
if address in txins_dict.keys():
for txin in txins_dict[address]:
txin.script_descriptor = desc
tx.sign({pubkey.hex(): (priv2, compressed)})
tx.sign({pubkey: priv2})
return tx.serialize()