mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
unit test: adapt to changing MAX_DUST_OUTPUTS_PER_TX
This commit is contained in:
parent
7c3490169c
commit
ca050d12e7
1 changed files with 7 additions and 5 deletions
|
@ -814,9 +814,11 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
|
||||||
CAmount nDustThreshold = 182 * g_dust.GetFeePerK() / 1000;
|
CAmount nDustThreshold = 182 * g_dust.GetFeePerK() / 1000;
|
||||||
BOOST_CHECK_EQUAL(nDustThreshold, 546);
|
BOOST_CHECK_EQUAL(nDustThreshold, 546);
|
||||||
|
|
||||||
// Add dust output to take dust slot, still standard!
|
// Add dust outputs up to allowed maximum, still standard!
|
||||||
t.vout.emplace_back(0, t.vout[0].scriptPubKey);
|
for (size_t i{0}; i < MAX_DUST_OUTPUTS_PER_TX; ++i) {
|
||||||
CheckIsStandard(t);
|
t.vout.emplace_back(0, t.vout[0].scriptPubKey);
|
||||||
|
CheckIsStandard(t);
|
||||||
|
}
|
||||||
|
|
||||||
// dust:
|
// dust:
|
||||||
t.vout[0].nValue = nDustThreshold - 1;
|
t.vout[0].nValue = nDustThreshold - 1;
|
||||||
|
@ -974,9 +976,9 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
|
||||||
CheckIsNotStandard(t, "bare-multisig");
|
CheckIsNotStandard(t, "bare-multisig");
|
||||||
g_bare_multi = DEFAULT_PERMIT_BAREMULTISIG;
|
g_bare_multi = DEFAULT_PERMIT_BAREMULTISIG;
|
||||||
|
|
||||||
// Add dust output to take dust slot
|
// Add dust outputs up to allowed maximum
|
||||||
assert(t.vout.size() == 1);
|
assert(t.vout.size() == 1);
|
||||||
t.vout.emplace_back(0, t.vout[0].scriptPubKey);
|
t.vout.insert(t.vout.end(), MAX_DUST_OUTPUTS_PER_TX, {0, t.vout[0].scriptPubKey});
|
||||||
|
|
||||||
// Check compressed P2PK outputs dust threshold (must have leading 02 or 03)
|
// Check compressed P2PK outputs dust threshold (must have leading 02 or 03)
|
||||||
t.vout[0].scriptPubKey = CScript() << std::vector<unsigned char>(33, 0x02) << OP_CHECKSIG;
|
t.vout[0].scriptPubKey = CScript() << std::vector<unsigned char>(33, 0x02) << OP_CHECKSIG;
|
||||||
|
|
Loading…
Add table
Reference in a new issue