From 465befdccd4fc1165bb7d486d639cb5e4a782b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Eckel?= Date: Thu, 26 Jan 2023 17:14:25 +0100 Subject: [PATCH] blackified MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jürgen Eckel --- planetmint/lib.py | 7 +++---- tests/assets/test_digital_assets.py | 5 ++--- tests/validation/test_validation.py | 3 ++- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/planetmint/lib.py b/planetmint/lib.py index 51cfc68..2bcb850 100644 --- a/planetmint/lib.py +++ b/planetmint/lib.py @@ -386,9 +386,9 @@ class Planetmint(object): duplicates = any(txn for txn in current_transactions if txn.id == tx.id) if self.is_committed(tx.id) or duplicates: raise DuplicateTransaction("transaction `{}` already exists".format(tx.id)) - + fulfilling_inputs = [i for i in tx.inputs if i.fulfills is not None and i.fulfills.txid is not None] - + if len(fulfilling_inputs) > 0: input_txs, input_conditions = self.get_input_txs_and_conditions(fulfilling_inputs, current_transactions) create_asset = tx.assets[0] @@ -397,9 +397,8 @@ class Planetmint(object): raise ValidationError("CREATE must have matching asset description with input transaction") if input_txs[0].operation != Transaction.DECOMPOSE: raise SchemaValidationError("CREATE can only consume DECOMPOSE outputs") - + return True - def validate_transfer_inputs(self, tx, current_transactions=[]) -> bool: input_txs, input_conditions = self.get_input_txs_and_conditions(tx.inputs, current_transactions) diff --git a/tests/assets/test_digital_assets.py b/tests/assets/test_digital_assets.py index 58afd05..87a8964 100644 --- a/tests/assets/test_digital_assets.py +++ b/tests/assets/test_digital_assets.py @@ -117,13 +117,12 @@ def test_create_decompose_output(b, user_pk, user_sk, signed_create_tx, _bdb): decompose_transaction.sign([user_sk]) validated_decompose = b.validate_transaction(decompose_transaction) b.store_bulk_transactions([validated_decompose]) - + create_inputs = decompose_transaction.to_inputs([0]) create_tx = Create.generate([user_pk], recipients=[([user_pk], 1)], assets=[assets[0]], inputs=create_inputs) signed_decompose_create_tx = create_tx.sign([user_sk]) assert b.validate_transaction(signed_decompose_create_tx) - - + def test_create_valid_divisible_asset(b, user_pk, user_sk, _bdb): tx = Create.generate([user_pk], [([user_pk], 2)]) diff --git a/tests/validation/test_validation.py b/tests/validation/test_validation.py index 2d235ee..e6bd9df 100644 --- a/tests/validation/test_validation.py +++ b/tests/validation/test_validation.py @@ -5,5 +5,6 @@ import pytest + def test_something(): - return True \ No newline at end of file + return True