@@ -51,36 +51,25 @@ BlockAssembler MinerTestingSetup::AssemblerForTest(const CChainParams& params)
5151constexpr static struct {
5252 unsigned char extranonce;
5353 unsigned int nonce;
54- } blockinfo[] = {
55- {4 , 0xa4a3e223 }, {2 , 0x15c32f9e }, {1 , 0x0375b547 }, {1 , 0x7004a8a5 },
56- {2 , 0xce440296 }, {2 , 0x52cfe198 }, {1 , 0x77a72cd0 }, {2 , 0xbb5d6f84 },
57- {2 , 0x83f30c2c }, {1 , 0x48a73d5b }, {1 , 0xef7dcd01 }, {2 , 0x6809c6c4 },
58- {2 , 0x0883ab3c }, {1 , 0x087bbbe2 }, {2 , 0x2104a814 }, {2 , 0xdffb6daa },
59- {1 , 0xee8a0a08 }, {2 , 0xba4237c1 }, {1 , 0xa70349dc }, {1 , 0x344722bb },
60- {3 , 0xd6294733 }, {2 , 0xec9f5c94 }, {2 , 0xca2fbc28 }, {1 , 0x6ba4f406 },
61- {2 , 0x015d4532 }, {1 , 0x6e119b7c }, {2 , 0x43e8f314 }, {2 , 0x27962f38 },
62- {2 , 0xb571b51b }, {2 , 0xb36bee23 }, {2 , 0xd17924a8 }, {2 , 0x6bc212d9 },
63- {1 , 0x630d4948 }, {2 , 0x9a4c4ebb }, {2 , 0x554be537 }, {1 , 0xd63ddfc7 },
64- {2 , 0xa10acc11 }, {1 , 0x759a8363 }, {2 , 0xfb73090d }, {1 , 0xe82c6a34 },
65- {1 , 0xe33e92d7 }, {3 , 0x658ef5cb }, {2 , 0xba32ff22 }, {5 , 0x0227a10c },
66- {1 , 0xa9a70155 }, {5 , 0xd096d809 }, {1 , 0x37176174 }, {1 , 0x830b8d0f },
67- {1 , 0xc6e3910e }, {2 , 0x823f3ca8 }, {1 , 0x99850849 }, {1 , 0x7521fb81 },
68- {1 , 0xaacaabab }, {1 , 0xd645a2eb }, {5 , 0x7aea1781 }, {5 , 0x9d6e4b78 },
69- {1 , 0x4ce90fd8 }, {1 , 0xabdc832d }, {6 , 0x4a34f32a }, {2 , 0xf2524c1c },
70- {2 , 0x1bbeb08a }, {1 , 0xad47f480 }, {1 , 0x9f026aeb }, {1 , 0x15a95049 },
71- {2 , 0xd1cb95b2 }, {2 , 0xf84bbda5 }, {1 , 0x0fa62cd1 }, {1 , 0xe05f9169 },
72- {1 , 0x78d194a9 }, {5 , 0x3e38147b }, {5 , 0x737ba0d4 }, {1 , 0x63378e10 },
73- {1 , 0x6d5f91cf }, {2 , 0x88612eb8 }, {2 , 0xe9639484 }, {1 , 0xb7fabc9d },
74- {2 , 0x19b01592 }, {1 , 0x5a90dd31 }, {2 , 0x5bd7e028 }, {2 , 0x94d00323 },
75- {1 , 0xa9b9c01a }, {1 , 0x3a40de61 }, {1 , 0x56e7eec7 }, {5 , 0x859f7ef6 },
76- {1 , 0xfd8e5630 }, {1 , 0x2b0c9f7f }, {1 , 0xba700e26 }, {1 , 0x7170a408 },
77- {1 , 0x70de86a8 }, {1 , 0x74d64cd5 }, {1 , 0x49e738a1 }, {2 , 0x6910b602 },
78- {0 , 0x643c565f }, {1 , 0x54264b3f }, {2 , 0x97ea6396 }, {2 , 0x55174459 },
79- {2 , 0x03e8779a }, {1 , 0x98f34d8f }, {1 , 0xc07b2b07 }, {1 , 0xdfe29668 },
80- {1 , 0x3141c7c1 }, {1 , 0xb3b595f4 }, {1 , 0x735abf08 }, {5 , 0x623bfbce },
81- {2 , 0xd351e722 }, {1 , 0xf4ca48c9 }, {1 , 0x5b19c670 }, {1 , 0xa164bf0e },
82- {2 , 0xbbbeb305 }, {2 , 0xfe1c810a },
83- };
54+ } BLOCKINFO[]{{8 , 582909131 }, {0 , 971462344 }, {2 , 1169481553 }, {6 , 66147495 }, {7 , 427785981 }, {8 , 80538907 },
55+ {8 , 207348013 }, {2 , 1951240923 }, {4 , 215054351 }, {1 , 491520534 }, {8 , 1282281282 }, {4 , 639565734 },
56+ {3 , 248274685 }, {8 , 1160085976 }, {6 , 396349768 }, {5 , 393780549 }, {5 , 1096899528 }, {4 , 965381630 },
57+ {0 , 728758712 }, {5 , 318638310 }, {3 , 164591898 }, {2 , 274234550 }, {2 , 254411237 }, {7 , 561761812 },
58+ {2 , 268342573 }, {0 , 402816691 }, {1 , 221006382 }, {6 , 538872455 }, {7 , 393315655 }, {4 , 814555937 },
59+ {7 , 504879194 }, {6 , 467769648 }, {3 , 925972193 }, {2 , 200581872 }, {3 , 168915404 }, {8 , 430446262 },
60+ {5 , 773507406 }, {3 , 1195366164 }, {0 , 433361157 }, {3 , 297051771 }, {0 , 558856551 }, {2 , 501614039 },
61+ {3 , 528488272 }, {2 , 473587734 }, {8 , 230125274 }, {2 , 494084400 }, {4 , 357314010 }, {8 , 60361686 },
62+ {7 , 640624687 }, {3 , 480441695 }, {8 , 1424447925 }, {4 , 752745419 }, {1 , 288532283 }, {6 , 669170574 },
63+ {5 , 1900907591 }, {3 , 555326037 }, {3 , 1121014051 }, {0 , 545835650 }, {8 , 189196651 }, {5 , 252371575 },
64+ {0 , 199163095 }, {6 , 558895874 }, {6 , 1656839784 }, {6 , 815175452 }, {6 , 718677851 }, {5 , 544000334 },
65+ {0 , 340113484 }, {6 , 850744437 }, {4 , 496721063 }, {8 , 524715182 }, {6 , 574361898 }, {6 , 1642305743 },
66+ {6 , 355110149 }, {5 , 1647379658 }, {8 , 1103005356 }, {7 , 556460625 }, {3 , 1139533992 }, {5 , 304736030 },
67+ {2 , 361539446 }, {2 , 143720360 }, {6 , 201939025 }, {7 , 423141476 }, {4 , 574633709 }, {3 , 1412254823 },
68+ {4 , 873254135 }, {0 , 341817335 }, {6 , 53501687 }, {3 , 179755410 }, {5 , 172209688 }, {8 , 516810279 },
69+ {4 , 1228391489 }, {8 , 325372589 }, {6 , 550367589 }, {0 , 876291812 }, {7 , 412454120 }, {7 , 717202854 },
70+ {2 , 222677843 }, {6 , 251778867 }, {7 , 842004420 }, {7 , 194762829 }, {4 , 96668841 }, {1 , 925485796 },
71+ {0 , 792342903 }, {6 , 678455063 }, {6 , 773251385 }, {5 , 186617471 }, {6 , 883189502 }, {7 , 396077336 },
72+ {8 , 254702874 }, {0 , 455592851 }};
8473
8574static CBlockIndex CreateBlockIndex (int nHeight, CBlockIndex* active_chain_tip) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
8675{
@@ -220,20 +209,18 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
220209
221210 // We can't make transactions until we have inputs
222211 // Therefore, load 110 blocks :)
223- static_assert (std::size (blockinfo ) == 110 , " Should have 110 blocks to import" );
212+ static_assert (std::size (BLOCKINFO ) == 110 , " Should have 110 blocks to import" );
224213 int baseheight = 0 ;
225214 std::vector<CTransactionRef> txFirst;
226- for (const auto & bi : blockinfo ) {
215+ for (const auto & bi : BLOCKINFO ) {
227216 CBlock *pblock = &pblocktemplate->block ; // pointer for convenience
228217 {
229218 LOCK (cs_main);
230- pblock->nVersion = 1 ;
219+ pblock->nVersion = VERSIONBITS_TOP_BITS ;
231220 pblock->nTime = m_node.chainman ->ActiveChain ().Tip ()->GetMedianTimePast ()+1 ;
232221 CMutableTransaction txCoinbase (*pblock->vtx [0 ]);
233222 txCoinbase.nVersion = 1 ;
234- txCoinbase.vin [0 ].scriptSig = CScript ();
235- txCoinbase.vin [0 ].scriptSig .push_back (bi.extranonce );
236- txCoinbase.vin [0 ].scriptSig .push_back (m_node.chainman ->ActiveChain ().Height ());
223+ txCoinbase.vin [0 ].scriptSig = CScript{} << (m_node.chainman ->ActiveChain ().Height () + 1 ) << bi.extranonce ;
237224 txCoinbase.vout .resize (1 ); // Ignore the (optional) segwit commitment added by CreateNewBlock (as the hardcoded nonces don't account for this)
238225 txCoinbase.vout [0 ].scriptPubKey = CScript ();
239226 pblock->vtx [0 ] = MakeTransactionRef (std::move (txCoinbase));
0 commit comments