added check to fix vote test cases, requires future change

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
Lorenz Herzberger 2022-04-26 10:17:32 +02:00
parent 20bce1f09b
commit d2d0840555
No known key found for this signature in database
GPG Key ID: FA5EE906EB55316A

View File

@ -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: