mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
[validation] Add CValidationState subclasses
Split CValidationState into TxValidationState and BlockValidationState to store validation results for transactions and blocks respectively.
This commit is contained in:
@@ -152,7 +152,7 @@ BOOST_AUTO_TEST_CASE(tx_valid)
|
||||
CDataStream stream(ParseHex(transaction), SER_NETWORK, PROTOCOL_VERSION);
|
||||
CTransaction tx(deserialize, stream);
|
||||
|
||||
CValidationState state;
|
||||
TxValidationState state;
|
||||
BOOST_CHECK_MESSAGE(CheckTransaction(tx, state), strTest);
|
||||
BOOST_CHECK(state.IsValid());
|
||||
|
||||
@@ -239,7 +239,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
|
||||
CDataStream stream(ParseHex(transaction), SER_NETWORK, PROTOCOL_VERSION );
|
||||
CTransaction tx(deserialize, stream);
|
||||
|
||||
CValidationState state;
|
||||
TxValidationState state;
|
||||
fValid = CheckTransaction(tx, state) && state.IsValid();
|
||||
|
||||
PrecomputedTransactionData txdata(tx);
|
||||
@@ -274,7 +274,7 @@ BOOST_AUTO_TEST_CASE(basic_transaction_tests)
|
||||
CDataStream stream(vch, SER_DISK, CLIENT_VERSION);
|
||||
CMutableTransaction tx;
|
||||
stream >> tx;
|
||||
CValidationState state;
|
||||
TxValidationState state;
|
||||
BOOST_CHECK_MESSAGE(CheckTransaction(CTransaction(tx), state) && state.IsValid(), "Simple deserialized transaction should be valid.");
|
||||
|
||||
// Check that duplicate txins fail
|
||||
|
||||
Reference in New Issue
Block a user