From d2d0840555075bb2a7992ae9f0e03059fb10cb33 Mon Sep 17 00:00:00 2001 From: Lorenz Herzberger Date: Tue, 26 Apr 2022 10:17:32 +0200 Subject: [PATCH] added check to fix vote test cases, requires future change Signed-off-by: Lorenz Herzberger --- planetmint/lib.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/planetmint/lib.py b/planetmint/lib.py index d9e2840..d16a6cf 100644 --- a/planetmint/lib.py +++ b/planetmint/lib.py @@ -240,11 +240,13 @@ class Planetmint(object): transaction = backend.query.get_transaction(self.connection, transaction_id) if transaction: + # TODO: get_assets is used with transaction_id this will not work with the asset change assets = backend.query.get_assets(self.connection, [transaction_id]) metadata = backend.query.get_metadata(self.connection, [transaction_id]) # NOTE: assets must not be replaced for transfer transactions # TODO: check if this holds true for other tx types, some test cases connected to election and voting are still failing - if transaction['operation'] != 'TRANSFER' and assets: + # NOTE: assets should be appended for all txs that define new assets otherwise the ids are already stored in tx + if transaction['operation'] != 'TRANSFER' and transaction['operation'] != 'VOTE' and assets: transaction['assets'] = list(assets) if 'metadata' not in transaction: