mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-26 07:25:44 +00:00
blackified
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
4febf487f0
commit
465befdccd
@ -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)
|
||||
|
||||
@ -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)])
|
||||
|
||||
@ -5,5 +5,6 @@
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
def test_something():
|
||||
return True
|
||||
return True
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user