aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2022-10-13 09:40:20 -0400
committerglozow <gloriajzhao@gmail.com>2022-10-13 09:40:27 -0400
commit147d64dbdf519e01ce8f2d9496993f9a4ad39ab1 (patch)
tree669738791a85e19c57aab2e3d504fdb8910b970b /test/functional/test_framework
parent75cbbfa279685f70d9f6fa71432df00862ffa865 (diff)
parent9e386afb67bf8fa71b72f730da1695eeb11828cd (diff)
downloadbitcoin-147d64dbdf519e01ce8f2d9496993f9a4ad39ab1.tar.xz
Merge bitcoin/bitcoin#25858: psbt: Only include PSBT_OUT_TAP_TREE when the output has a script path
9e386afb67bf8fa71b72f730da1695eeb11828cd tests: Test that PSBT_OUT_TAP_TREE is included correctly (Andrew Chow) 30ff25cf37eec4b09ab40424eb5d6a4a80410955 psbt: Only include m_tap_tree if it has scripts (Andrew Chow) 0577d423adda8e719d7611d03355680c8fbacab8 psbt: Change m_tap_tree to store just the tuples (Andrew Chow) 22c051ca70bae73e0430b05fb9d879591df27699 tests: Test that PSBT_OUT_TAP_TREE is combined correctly (Andrew Chow) 7df6e1bb77a96eac4fbcba424bbe780636b86650 psbt: Fix merging of m_tap_tree (Andrew Chow) 0652dc53b291bd295caff4093ec2854fd4b34645 [BugFix]: Do not allow deserializing PSBT with empty PSBT_OUT_TAP_TREE (Jeremy Rubin) Pull request description: PSBT_OUT_TAP_TREE should not be included for outputs that do not have such a tree. This should be disallowed during parsing, as well as prior to serialization when the field is populated during updating. Also added some test cases. Alternative to #25856 ACKs for top commit: instagibbs: ACK https://github.com/bitcoin/bitcoin/pull/25858/commits/9e386afb67bf8fa71b72f730da1695eeb11828cd darosior: ACK 9e386afb67bf8fa71b72f730da1695eeb11828cd Tree-SHA512: ce5c02a69752d176dbd967c1e8d30129b1905c8f186aeeef034576c1de82059271a1ee846bd040f5be4e66bb77ba711dcf14ac1e597c5707d7e7e2293f6cfefb
Diffstat (limited to 'test/functional/test_framework')
-rw-r--r--test/functional/test_framework/psbt.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/test_framework/psbt.py b/test/functional/test_framework/psbt.py
index 68945e7e84..3a5b4ec74d 100644
--- a/test/functional/test_framework/psbt.py
+++ b/test/functional/test_framework/psbt.py
@@ -123,6 +123,15 @@ class PSBT:
psbt = [x.serialize() for x in [self.g] + self.i + self.o]
return b"psbt\xff" + b"".join(psbt)
+ def make_blank(self):
+ """
+ Remove all fields except for PSBT_GLOBAL_UNSIGNED_TX
+ """
+ for m in self.i + self.o:
+ m.map.clear()
+
+ self.g = PSBTMap(map={0: self.g.map[0]})
+
def to_base64(self):
return base64.b64encode(self.serialize()).decode("utf8")