Fixes commit 6b25f29a91 where opcodes where probably lost in translation.
Made two versions, the looped test using the '<<' operator also (stream api).
Fixes commit 6b25f29a91 where opcodes where probably lost in translation.
Made two versions, the looped test using the '<<' operator also (stream api).
Fixes commit 6b25f29a91 where opcodes where lost in translation.
219 | + direct.insert(direct.end(), 20, 0); // this is 160bit dummy 220 | direct.push_back(OP_EQUAL); 221 | BOOST_CHECK(CScript(direct.begin(), direct.end()).IsPayToScriptHash()); 222 | + 223 | + //---------><----- cut here 224 | + // orig version fixed by re-adding OP_PUSHDATA2/4
Can you explain what cut here and orig version means? I think those are confusion to test readers.
Oh, sorry my commit comment was a bit short.
I've made two versions of the fix since I didn't know what you prefer.
The orig version is clearer in what it fixes. The block below that is perhaps less code, though not perhaps the quickest to understand at-a-glance.
240 | 241 | + //---------><----- cut here 242 | + 243 | + // orig version loopified, and using both interfaces (string and stream) 244 | + std::vector<std::vector<unsigned char>> 245 | + scripts = {{OP_HASH160, OP_PUSHDATA1, 20}, // 8bit
Run the new code you're running through clang-format :-)
Thanks!
257 | + script.insert(script.end(), 20, 0); 258 | + script.push_back(OP_EQUAL); 259 | + BOOST_CHECK(!CScript(script.begin(), script.end()).IsPayToScriptHash()); 260 | + } 261 | + 262 | + //---------><----- cut here
Could you either please remove the comments here or remove the whole second hunk. I think the fixup should be standalone and minimal.
utACK first version
ACK, sorry this was my oversight
Good catch, sorry for missing the OP_PUSHDATA2/4 ones in my change! utACK to the first version of the fix. Perhaps you can do the second change in a follow up, but I agree it should not be mixed with the fix.
Also, please squash the two commits.
This has been waiting for the author for more than half a year. Closing with "up for grabs".