From 2a428c79897761579efc990aaf810b0eb3e572b6 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Tue, 19 Jul 2022 15:00:20 +0200 Subject: [PATCH] test: support passing PSBTMaps directly to PSBT ctor This will allow to create simple PSBTs as short one-liners, without the need to have three individual assignments (globals, inputs, outputs). --- test/functional/test_framework/psbt.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/functional/test_framework/psbt.py b/test/functional/test_framework/psbt.py index ad3fe29b62..68945e7e84 100644 --- a/test/functional/test_framework/psbt.py +++ b/test/functional/test_framework/psbt.py @@ -96,10 +96,10 @@ class PSBTMap: 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):