Skip to content

Commit 1984187

Browse files
committed
Validate transaction without inputs
1 parent c3a8843 commit 1984187

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/transaction_tests.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,15 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
369369
}
370370
}
371371

372+
BOOST_AUTO_TEST_CASE(tx_no_inputs)
373+
{
374+
CMutableTransaction empty;
375+
376+
TxValidationState state;
377+
BOOST_CHECK_MESSAGE(!CheckTransaction(CTransaction(empty), state), "Transaction with no inputs should be invalid.");
378+
BOOST_CHECK(state.GetRejectReason() == "bad-txns-vin-empty");
379+
}
380+
372381
BOOST_AUTO_TEST_CASE(basic_transaction_tests)
373382
{
374383
// Random real transaction (e2769b09e784f32f62ef849763d4f45b98e07ba658647343b915ff832b110436)

0 commit comments

Comments
 (0)