tests: Test that PSBT_OUT_TAP_TREE is combined correctly

This commit is contained in:
Andrew Chow
2022-10-06 15:32:33 -04:00
parent 7df6e1bb77
commit 22c051ca70
2 changed files with 29 additions and 2 deletions

View File

@ -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")