Skip to content

Commit 80c47aa

Browse files
committed
Merge 317ef03 into merged_master (Bitcoin PR bitcoin/bitcoin#25670)
related to the FIXME in #25625, PSBT python class needs to be reworked for elements
2 parents e6e789d + 317ef03 commit 80c47aa

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

test/functional/rpc_psbt.py

+11
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,17 @@ def test_psbt_input_keys(psbt_input, keys):
13281328
# assert hash.hex() in res_input[preimage_key]
13291329
# assert_equal(res_input[preimage_key][hash.hex()], preimage.hex())
13301330

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

13321343
if __name__ == '__main__':
13331344
PSBTTest().main()

test/functional/test_framework/psbt.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ def serialize(self):
9696
class PSBT:
9797
"""Class for serializing and deserializing PSBTs"""
9898

99-
def __init__(self):
100-
self.g = PSBTMap()
101-
self.i = []
102-
self.o = []
99+
def __init__(self, *, g=None, i=None, o=None):
100+
self.g = g if g is not None else PSBTMap()
101+
self.i = i if i is not None else []
102+
self.o = o if o is not None else []
103103
self.tx = None
104104

105105
def deserialize(self, f):

0 commit comments

Comments
 (0)