mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05: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:
parent
b8067cd435
commit
2a428c7989
1 changed files with 4 additions and 4 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue