mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-29 16:31:29 +00:00
transaction.serialize_output: use namedtuple fields
This commit is contained in:
parent
5d52dc204c
commit
8b61d18a9f
1 changed files with 3 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue