Updated based on feedback to check that the encumbered state does not refer to itself as the encumbrance.

This commit is contained in:
jamescarlyle 2016-08-19 17:49:53 +01:00
parent 6ba301b6b8
commit ee65d4490b

View File

@ -58,7 +58,7 @@ class TransactionEncumbranceTests {
@Test @Test
fun trivial() { fun trivial() {
// A transaction containing an input state that is encumbered must fail if the encumbrance is missing. // A transaction containing an input state that is encumbered must fail if the encumbrance is missing on the inputs.
assertFailsWith(TransactionVerificationException.TransactionMissingEncumbranceException::class) { assertFailsWith(TransactionVerificationException.TransactionMissingEncumbranceException::class) {
transaction { transaction {
input { encumberedState } input { encumberedState }
@ -83,9 +83,7 @@ class TransactionEncumbranceTests {
assertFailsWith(TransactionVerificationException.TransactionMissingEncumbranceException::class) { assertFailsWith(TransactionVerificationException.TransactionMissingEncumbranceException::class) {
transaction { transaction {
input { unencumberedState } input { unencumberedState }
input { unencumberedState } // The encumbered state refers to an encumbrance in position 1, so there should be at least 2 outputs.
output { unencumberedState }
// The encumbered state refers to an encumbrance in position 1, so what follows is wrong.
output { encumberedState } output { encumberedState }
command(DUMMY_PUBKEY_1) { Cash.Commands.Move() } command(DUMMY_PUBKEY_1) { Cash.Commands.Move() }
this.verifies() this.verifies()