Skip to content

Commit 2a428c7

Browse files
committed
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).
1 parent b8067cd commit 2a428c7

File tree

1 file changed

+4
-4
lines changed
  • test/functional/test_framework

1 file changed

+4
-4
lines changed

test/functional/test_framework/psbt.py

Lines changed: 4 additions & 4 deletions
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)