mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
test: add unit test for non-standard txs with wrong nVersion
This commit is contained in:
parent
ae6943620a
commit
76303f65f9
1 changed files with 23 additions and 0 deletions
|
@ -713,6 +713,29 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
|
|||
t.vout[0].nValue = nDustThreshold;
|
||||
BOOST_CHECK(IsStandardTx(CTransaction(t), reason));
|
||||
|
||||
// Disallowed nVersion
|
||||
t.nVersion = -1;
|
||||
reason.clear();
|
||||
BOOST_CHECK(!IsStandardTx(CTransaction(t), reason));
|
||||
BOOST_CHECK_EQUAL(reason, "version");
|
||||
|
||||
t.nVersion = 0;
|
||||
reason.clear();
|
||||
BOOST_CHECK(!IsStandardTx(CTransaction(t), reason));
|
||||
BOOST_CHECK_EQUAL(reason, "version");
|
||||
|
||||
t.nVersion = 3;
|
||||
reason.clear();
|
||||
BOOST_CHECK(!IsStandardTx(CTransaction(t), reason));
|
||||
BOOST_CHECK_EQUAL(reason, "version");
|
||||
|
||||
// Allowed nVersion
|
||||
t.nVersion = 1;
|
||||
BOOST_CHECK(IsStandardTx(CTransaction(t), reason));
|
||||
|
||||
t.nVersion = 2;
|
||||
BOOST_CHECK(IsStandardTx(CTransaction(t), reason));
|
||||
|
||||
// Check dust with odd relay fee to verify rounding:
|
||||
// nDustThreshold = 182 * 3702 / 1000
|
||||
dustRelayFee = CFeeRate(3702);
|
||||
|
|
Loading…
Reference in a new issue