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).
This commit is contained in:
1 parent
b8067cd435
commit
2a428c7989
1 file changed
+4
-4
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user