mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
Merge bitcoin/bitcoin#30254: test: doc: fix units in tx-size standardness test (s/vbytes/weight units)
d1581c6048
test: doc: fix units in tx size standardness test (s/vbytes/weight units) (Sebastian Falbesoner) Pull request description: This small fixup PR is a late follow-up for #17947 (commit4537ba5f21
), where the wrong units has been used in the comments for the large tx composition. ACKs for top commit: tdb3: ACKd1581c6048
ismaelsadeeq: ACKd1581c6048
glozow: ACKd1581c6048
Tree-SHA512: ea2de42174f9dca0608275ea377c852ebddc5a04a2b32248ce808aea33d7e00cdee3a225b24c0cf426c69646cccbbc31273c62f7bc1647bb3443a61de3b15670
This commit is contained in:
commit
ba5dd96298
1 changed files with 6 additions and 6 deletions
|
@ -904,15 +904,15 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
|
||||||
t.vin.clear();
|
t.vin.clear();
|
||||||
t.vin.resize(2438); // size per input (empty scriptSig): 41 bytes
|
t.vin.resize(2438); // size per input (empty scriptSig): 41 bytes
|
||||||
t.vout[0].scriptPubKey = CScript() << OP_RETURN << std::vector<unsigned char>(19, 0); // output size: 30 bytes
|
t.vout[0].scriptPubKey = CScript() << OP_RETURN << std::vector<unsigned char>(19, 0); // output size: 30 bytes
|
||||||
// tx header: 12 bytes => 48 vbytes
|
// tx header: 12 bytes => 48 weight units
|
||||||
// 2438 inputs: 2438*41 = 99958 bytes => 399832 vbytes
|
// 2438 inputs: 2438*41 = 99958 bytes => 399832 weight units
|
||||||
// 1 output: 30 bytes => 120 vbytes
|
// 1 output: 30 bytes => 120 weight units
|
||||||
// ===============================
|
// ======================================
|
||||||
// total: 400000 vbytes
|
// total: 400000 weight units
|
||||||
BOOST_CHECK_EQUAL(GetTransactionWeight(CTransaction(t)), 400000);
|
BOOST_CHECK_EQUAL(GetTransactionWeight(CTransaction(t)), 400000);
|
||||||
CheckIsStandard(t);
|
CheckIsStandard(t);
|
||||||
|
|
||||||
// increase output size by one byte, so we end up with 400004 vbytes
|
// increase output size by one byte, so we end up with 400004 weight units
|
||||||
t.vout[0].scriptPubKey = CScript() << OP_RETURN << std::vector<unsigned char>(20, 0); // output size: 31 bytes
|
t.vout[0].scriptPubKey = CScript() << OP_RETURN << std::vector<unsigned char>(20, 0); // output size: 31 bytes
|
||||||
BOOST_CHECK_EQUAL(GetTransactionWeight(CTransaction(t)), 400004);
|
BOOST_CHECK_EQUAL(GetTransactionWeight(CTransaction(t)), 400004);
|
||||||
CheckIsNotStandard(t, "tx-size");
|
CheckIsNotStandard(t, "tx-size");
|
||||||
|
|
Loading…
Add table
Reference in a new issue