Changeset View
Changeset View
Standalone View
Standalone View
src/test/transaction_tests.cpp
Show First 20 Lines • Show All 780 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(test_IsStandard) { | ||||
t.vout[0].scriptPubKey = CScript() << OP_RETURN; | t.vout[0].scriptPubKey = CScript() << OP_RETURN; | ||||
t.vout[1].scriptPubKey = CScript() << OP_RETURN; | t.vout[1].scriptPubKey = CScript() << OP_RETURN; | ||||
BOOST_CHECK(!IsStandardTx(CTransaction(t), reason)); | BOOST_CHECK(!IsStandardTx(CTransaction(t), reason)); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(txsize_activation_test) { | BOOST_AUTO_TEST_CASE(txsize_activation_test) { | ||||
const Config &config = GetConfig(); | const Config &config = GetConfig(); | ||||
const Consensus::Params ¶ms = config.GetChainParams().GetConsensus(); | |||||
const int32_t magneticAnomalyActivationHeight = | const int32_t magneticAnomalyActivationHeight = | ||||
config.GetChainParams().GetConsensus().magneticAnomalyHeight; | params.magneticAnomalyHeight; | ||||
// A minimaly sized transction. | // A minimaly sized transction. | ||||
CTransaction minTx; | CTransaction minTx; | ||||
CValidationState state; | CValidationState state; | ||||
BOOST_CHECK(ContextualCheckTransaction( | BOOST_CHECK(ContextualCheckTransaction( | ||||
config, minTx, state, magneticAnomalyActivationHeight - 1, 5678, 1234)); | params, minTx, state, magneticAnomalyActivationHeight - 1, 5678, 1234)); | ||||
BOOST_CHECK(!ContextualCheckTransaction( | BOOST_CHECK(!ContextualCheckTransaction( | ||||
config, minTx, state, magneticAnomalyActivationHeight, 5678, 1234)); | params, minTx, state, magneticAnomalyActivationHeight, 5678, 1234)); | ||||
BOOST_CHECK_EQUAL(state.GetRejectCode(), REJECT_INVALID); | BOOST_CHECK_EQUAL(state.GetRejectCode(), REJECT_INVALID); | ||||
BOOST_CHECK_EQUAL(state.GetRejectReason(), "bad-txns-undersize"); | BOOST_CHECK_EQUAL(state.GetRejectReason(), "bad-txns-undersize"); | ||||
} | } | ||||
BOOST_AUTO_TEST_SUITE_END() | BOOST_AUTO_TEST_SUITE_END() |