1
0

bitcoin.py/transaction.py: API changes: rm most hex usage

Instead of some functions operating with hex strings,
and others using bytes, this consolidates most things to use bytes.

This mainly focuses on bitcoin.py and transaction.py,
and then adapts the API usages in other files.

Notably,
- scripts,
- pubkeys,
- signatures
should be bytes in almost all places now.
This commit is contained in:
SomberNight
2024-04-26 20:09:00 +00:00
parent 5e08d6e486
commit 2f1095510c
33 changed files with 429 additions and 465 deletions

View File

@@ -291,7 +291,7 @@ class PaymentRequest:
paymnt.merchant_data = pay_det.merchant_data
paymnt.transactions.append(bfh(raw_tx))
ref_out = paymnt.refund_to.add()
ref_out.script = util.bfh(address_to_script(refund_addr))
ref_out.script = address_to_script(refund_addr)
paymnt.memo = "Paid using Electrum"
pm = paymnt.SerializeToString()
payurl = urllib.parse.urlparse(pay_det.payment_url)
@@ -334,7 +334,7 @@ def make_unsigned_request(req: 'Invoice'):
if amount is None:
amount = 0
memo = req.message
script = bfh(address_to_script(addr))
script = address_to_script(addr)
outputs = [(script, amount)]
pd = pb2.PaymentDetails()
if constants.net.TESTNET: