Commit e10c515a authored by Moul's avatar Moul

[mod] Tx document: drop vensions 3 management

parent c8403bee
Pipeline #5411 passed with stages
in 3 minutes and 1 second
......@@ -486,8 +486,7 @@ class Transaction(Document):
tx_data["currency"] = currency
for data_list in ('issuers', 'outputs', 'inputs', 'unlocks', 'signatures'):
tx_data['multiline_{0}'.format(data_list)] = '\n'.join(tx_data[data_list])
if tx_data["version"] >= 3:
signed_raw = """Version: {version}
return cls.from_signed_raw("""Version: {version}
Type: Transaction
Currency: {currency}
Blockstamp: {blockstamp}
......@@ -502,24 +501,7 @@ Outputs:
{multiline_outputs}
Comment: {comment}
{multiline_signatures}
""".format(**tx_data)
else:
signed_raw = """Version: {version}
Type: Transaction
Currency: {currency}
Locktime: {locktime}
Issuers:
{multiline_issuers}
Inputs:
{multiline_inputs}
Unlocks:
{multiline_unlocks}
Outputs:
{multiline_outputs}
Comment: {comment}
{multiline_signatures}
""".format(**tx_data)
return cls.from_signed_raw(signed_raw)
""".format(**tx_data))
@classmethod
def from_compact(cls: Type[TransactionType], currency: str, compact: str) -> TransactionType:
......@@ -613,8 +595,6 @@ Comment: {comment}
currency = Transaction.parse_field("Currency", lines[n])
n += 1
blockstamp = None # type: Optional[BlockUID]
if version >= 3:
blockstamp = BlockUID.from_str(Transaction.parse_field("Blockstamp", lines[n]))
n += 1
......@@ -679,7 +659,6 @@ Currency: {1}
""".format(self.version,
self.currency)
if self.version >= 3:
doc += "Blockstamp: {0}\n".format(self.blockstamp)
doc += "Locktime: {0}\n".format(self.locktime)
......@@ -727,7 +706,6 @@ COMMENT
len(self.outputs),
'1' if self.comment != "" else '0',
self.locktime)
if self.version >= 3:
doc += "{0}\n".format(self.blockstamp)
for pubkey in self.issuers:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment