mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 21:22:47 +01:00
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:
@@ -96,10 +96,10 @@ class PSBTMap:
|
|||||||
class PSBT:
|
class PSBT:
|
||||||
"""Class for serializing and deserializing PSBTs"""
|
"""Class for serializing and deserializing PSBTs"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, *, g=None, i=None, o=None):
|
||||||
self.g = PSBTMap()
|
self.g = g if g is not None else PSBTMap()
|
||||||
self.i = []
|
self.i = i if i is not None else []
|
||||||
self.o = []
|
self.o = o if o is not None else []
|
||||||
self.tx = None
|
self.tx = None
|
||||||
|
|
||||||
def deserialize(self, f):
|
def deserialize(self, f):
|
||||||
|
|||||||
Reference in New Issue
Block a user