MCPcopy Create free account
hub / github.com/LUX-Core/lux / RandomScript

Function RandomScript

src/test/sighash_tests.cpp:88–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88void static RandomScript(CScript &script) {
89 static const opcodetype oplist[] = {OP_FALSE, OP_1, OP_2, OP_3, OP_CHECKSIG, OP_IF, OP_VERIF, OP_RETURN, OP_CODESEPARATOR};
90 script = CScript();
91 int ops = (insecure_rand() % 10);
92 for (int i=0; i<ops; i++)
93 script << oplist[insecure_rand() % (sizeof(oplist)/sizeof(oplist[0]))];
94}
95
96void static RandomTransaction(CMutableTransaction &tx, bool fSingle) {
97 tx.nVersion = insecure_rand();

Callers 2

RandomTransactionFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 2

insecure_randFunction · 0.85
CScriptClass · 0.50

Tested by

no test coverage detected