Skip to content

Commit

Permalink
Merge 317ef03 into merged_master (Bitcoin PR bitcoin/bitcoin#25670)
Browse files Browse the repository at this point in the history
related to the FIXME in #25625, PSBT python class needs to be reworked
for elements
  • Loading branch information
delta1 committed Oct 21, 2024
2 parents e6e789d + 317ef03 commit 80c47aa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 11 additions & 0 deletions test/functional/rpc_psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,17 @@ def test_psbt_input_keys(psbt_input, keys):
# assert hash.hex() in res_input[preimage_key]
# assert_equal(res_input[preimage_key][hash.hex()], preimage.hex())

# ELEMENTS FIXME
# self.log.info("Test that combining PSBTs with different transactions fails")
# tx = CTransaction()
# tx.vin = [CTxIn(outpoint=COutPoint(hash=int('aa' * 32, 16), n=0), scriptSig=b"")]
# tx.vout = [CTxOut(nValue=0, scriptPubKey=b"")]
# psbt1 = PSBT(g=PSBTMap({PSBT_GLOBAL_UNSIGNED_TX: tx.serialize()}), i=[PSBTMap()], o=[PSBTMap()]).to_base64()
# tx.vout[0].nValue += 1 # slightly modify tx
# psbt2 = PSBT(g=PSBTMap({PSBT_GLOBAL_UNSIGNED_TX: tx.serialize()}), i=[PSBTMap()], o=[PSBTMap()]).to_base64()
# assert_raises_rpc_error(-8, "PSBTs not compatible (different transactions)", self.nodes[0].combinepsbt, [psbt1, psbt2])
# assert_equal(self.nodes[0].combinepsbt([psbt1, psbt1]), psbt1)


if __name__ == '__main__':
PSBTTest().main()
8 changes: 4 additions & 4 deletions test/functional/test_framework/psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ def serialize(self):
class PSBT:
"""Class for serializing and deserializing PSBTs"""

def __init__(self):
self.g = PSBTMap()
self.i = []
self.o = []
def __init__(self, *, g=None, i=None, o=None):
self.g = g if g is not None else PSBTMap()
self.i = i if i is not None else []
self.o = o if o is not None else []
self.tx = None

def deserialize(self, f):
Expand Down

0 comments on commit 80c47aa

Please sign in to comment.