MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / RandomScript

Function RandomScript

src/test/sighash_tests.cpp:87–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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