diff options
author | Lőrinc <pap.lorinc@gmail.com> | 2024-04-12 14:37:22 +0200 |
---|---|---|
committer | Lőrinc <pap.lorinc@gmail.com> | 2024-06-18 19:43:33 +0200 |
commit | 1984187840972a455f4c210f0cb576633ef5bddb (patch) | |
tree | 5504264e4aa387839e0feabdc901c8c4be492d32 | |
parent | c3a884318981c7ebabd0b8e8023a14519e26c72b (diff) |
Validate transaction without inputs
-rw-r--r-- | src/test/transaction_tests.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 25127e000f..d4b97b0ecb 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -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) |