Merge #14855: test: Correct ineffectual WithOrVersion from transactions_tests

75778a0724 test: Correct ineffectual WithOrVersion from transactions_tests (Ben Woosley)

Pull request description:

  `WithOrVersion` uses `|` to combine the versions, and `|` with 0 is a no-op.

  NicolasDorier / sipa do you recall why the version is being overridden here?

  Introduced in ab48c5e721
  Last updated 81e3228fcb

Tree-SHA512: 2aea925497bab2da973f17752410a6759d67181a57c3b12a685d184fbfcca2984c45b702ab0bd641d75e086696a0424f1bf77c5578ca765d6882dc03b42d5f9a
pull/643/head
MarcoFalke 6 years ago
commit 5b6b371c77
No known key found for this signature in database
GPG Key ID: D2EA4850E7528B25

@ -64,12 +64,6 @@ public:
size_t size() const { return stream->size(); }
};
template<typename S>
OverrideStream<S> WithOrVersion(S* s, int nVersionFlag)
{
return OverrideStream<S>(s, s->GetType(), s->GetVersion() | nVersionFlag);
}
/* Minimal stream for overwriting and/or appending to an existing byte vector
*
* The referenced vector will grow as necessary

@ -414,7 +414,8 @@ static void ReplaceRedeemScript(CScript& script, const CScript& redeemScript)
script = PushAll(stack);
}
BOOST_AUTO_TEST_CASE(test_big_witness_transaction) {
BOOST_AUTO_TEST_CASE(test_big_witness_transaction)
{
CMutableTransaction mtx;
mtx.nVersion = 1;
@ -456,9 +457,8 @@ BOOST_AUTO_TEST_CASE(test_big_witness_transaction) {
}
CDataStream ssout(SER_NETWORK, PROTOCOL_VERSION);
auto vstream = WithOrVersion(&ssout, 0);
vstream << mtx;
CTransaction tx(deserialize, vstream);
ssout << mtx;
CTransaction tx(deserialize, ssout);
// check all inputs concurrently, with the cache
PrecomputedTransactionData txdata(tx);

Loading…
Cancel
Save