0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-01 09:35:52 -05:00

unit test: adapt to changing MAX_DUST_OUTPUTS_PER_TX

This commit is contained in:
Greg Sanders 2024-11-12 13:15:09 -05:00
parent 7c3490169c
commit ca050d12e7

View file

@ -814,9 +814,11 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
CAmount nDustThreshold = 182 * g_dust.GetFeePerK() / 1000;
BOOST_CHECK_EQUAL(nDustThreshold, 546);
// Add dust output to take dust slot, still standard!
t.vout.emplace_back(0, t.vout[0].scriptPubKey);
CheckIsStandard(t);
// Add dust outputs up to allowed maximum, still standard!
for (size_t i{0}; i < MAX_DUST_OUTPUTS_PER_TX; ++i) {
t.vout.emplace_back(0, t.vout[0].scriptPubKey);
CheckIsStandard(t);
}
// dust:
t.vout[0].nValue = nDustThreshold - 1;
@ -974,9 +976,9 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
CheckIsNotStandard(t, "bare-multisig");
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);
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)
t.vout[0].scriptPubKey = CScript() << std::vector<unsigned char>(33, 0x02) << OP_CHECKSIG;