From 8b61d18a9f252ee69f270c84738dbe82b73b6c31 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 6 Nov 2018 17:04:12 +0100 Subject: [PATCH] transaction.serialize_output: use namedtuple fields --- electrum/transaction.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/electrum/transaction.py b/electrum/transaction.py index 7a4bb8cfa..d91de2b59 100644 --- a/electrum/transaction.py +++ b/electrum/transaction.py @@ -1026,10 +1026,9 @@ class Transaction: if outputs: self._outputs.sort(key = lambda o: (o.value, self.pay_script(o.type, o.address))) - def serialize_output(self, output): - output_type, addr, amount = output - s = int_to_hex(amount, 8) - script = self.pay_script(output_type, addr) + def serialize_output(self, output: TxOutput) -> str: + s = int_to_hex(output.value, 8) + script = self.pay_script(output.type, output.address) s += var_int(len(script)//2) s += script return s