commit 13fe8e466dbc1e7100b2f24db94a8cadd83317e8
parent 54d2fa0e7ddd2d9f86308a3537640f45ebeb1a90
Author: SomberNight <somber.night@protonmail.com>
Date: Wed, 26 Aug 2020 19:55:05 +0200
transaction: simply PartialTransaction constructor
rm footgun (see prev commit)
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/electrum/transaction.py b/electrum/transaction.py
@@ -1539,8 +1539,8 @@ class PartialTxOutput(TxOutput, PSBTSection):
class PartialTransaction(Transaction):
- def __init__(self, raw_unsigned_tx):
- Transaction.__init__(self, raw_unsigned_tx)
+ def __init__(self):
+ Transaction.__init__(self, None)
self.xpubs = {} # type: Dict[BIP32Node, Tuple[bytes, Sequence[int]]] # intermediate bip32node -> (xfp, der_prefix)
self._inputs = [] # type: List[PartialTxInput]
self._outputs = [] # type: List[PartialTxOutput]
@@ -1557,7 +1557,7 @@ class PartialTransaction(Transaction):
@classmethod
def from_tx(cls, tx: Transaction) -> 'PartialTransaction':
- res = cls(None)
+ res = cls()
res._inputs = [PartialTxInput.from_txin(txin) for txin in tx.inputs()]
res._outputs = [PartialTxOutput.from_txout(txout) for txout in tx.outputs()]
res.version = tx.version
@@ -1664,7 +1664,7 @@ class PartialTransaction(Transaction):
@classmethod
def from_io(cls, inputs: Sequence[PartialTxInput], outputs: Sequence[PartialTxOutput], *,
locktime: int = None, version: int = None):
- self = cls(None)
+ self = cls()
self._inputs = list(inputs)
self._outputs = list(outputs)
if locktime is not None: