Skip to content

Commit

Permalink
Validate transaction without inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
l0rinc committed Jun 18, 2024
1 parent c3a8843 commit 1984187
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/transaction_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,15 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
}
}

BOOST_AUTO_TEST_CASE(tx_no_inputs)
{
CMutableTransaction empty;

TxValidationState state;
BOOST_CHECK_MESSAGE(!CheckTransaction(CTransaction(empty), state), "Transaction with no inputs should be invalid.");
BOOST_CHECK(state.GetRejectReason() == "bad-txns-vin-empty");
}

BOOST_AUTO_TEST_CASE(basic_transaction_tests)
{
// Random real transaction (e2769b09e784f32f62ef849763d4f45b98e07ba658647343b915ff832b110436)
Expand Down

0 comments on commit 1984187

Please sign in to comment.