Skip to content

Commit

Permalink
Problem: No test to validate duplicate inputs (#2425)
Browse files Browse the repository at this point in the history
Solution: Update tests
  • Loading branch information
kansi authored and ttmc committed Jul 31, 2018
1 parent f13c9a9 commit 533030c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/tendermint/test_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 533030c

Please sign in to comment.