Skip to content

Commit 5b6b371

Browse files
author
MarcoFalke
committed
Merge #14855: test: Correct ineffectual WithOrVersion from transactions_tests
75778a0 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 ab48c5e Last updated 81e3228 Tree-SHA512: 2aea925497bab2da973f17752410a6759d67181a57c3b12a685d184fbfcca2984c45b702ab0bd641d75e086696a0424f1bf77c5578ca765d6882dc03b42d5f9a
2 parents 9c64278 + 75778a0 commit 5b6b371

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/streams.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,6 @@ class OverrideStream
6464
size_t size() const { return stream->size(); }
6565
};
6666

67-
template<typename S>
68-
OverrideStream<S> WithOrVersion(S* s, int nVersionFlag)
69-
{
70-
return OverrideStream<S>(s, s->GetType(), s->GetVersion() | nVersionFlag);
71-
}
72-
7367
/* Minimal stream for overwriting and/or appending to an existing byte vector
7468
*
7569
* The referenced vector will grow as necessary

src/test/transaction_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,8 @@ static void ReplaceRedeemScript(CScript& script, const CScript& redeemScript)
414414
script = PushAll(stack);
415415
}
416416

417-
BOOST_AUTO_TEST_CASE(test_big_witness_transaction) {
417+
BOOST_AUTO_TEST_CASE(test_big_witness_transaction)
418+
{
418419
CMutableTransaction mtx;
419420
mtx.nVersion = 1;
420421

@@ -456,9 +457,8 @@ BOOST_AUTO_TEST_CASE(test_big_witness_transaction) {
456457
}
457458

458459
CDataStream ssout(SER_NETWORK, PROTOCOL_VERSION);
459-
auto vstream = WithOrVersion(&ssout, 0);
460-
vstream << mtx;
461-
CTransaction tx(deserialize, vstream);
460+
ssout << mtx;
461+
CTransaction tx(deserialize, ssout);
462462

463463
// check all inputs concurrently, with the cache
464464
PrecomputedTransactionData txdata(tx);

0 commit comments

Comments
 (0)