Problem: No test to validate duplicate inputs (#2425)

Solution: Update tests
This commit is contained in:
Vanshdeep Singh 2018-07-31 14:33:28 +02:00 committed by Troy McConaghy
parent f13c9a9d57
commit 533030cdae

View File

@ -382,8 +382,16 @@ def test_get_spent_transaction_critical_double_spend(b, alice, bob, carol):
asset_id=tx.id)\
.sign([alice.private_key])
same_input_double_spend = Transaction.transfer(tx.to_inputs() + tx.to_inputs(),
[([bob.public_key], 1)],
asset_id=tx.id)\
.sign([alice.private_key])
b.store_bulk_transactions([tx])
with pytest.raises(DoubleSpend):
same_input_double_spend.validate(b)
assert b.get_spent(tx.id, tx_transfer.inputs[0].fulfills.output, [tx_transfer])
with pytest.raises(DoubleSpend):