diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-01-04 12:20:33 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-01-04 12:20:35 +0100 |
commit | 5b6b371c777a6d6a06d50e43ac9cabfea1f64dfa (patch) | |
tree | e8a3ad295c2b236ee64017c8535bb53b5e7f3cfe /src | |
parent | 9c64278e1a723bdc34598d0d83e56f1e74ea39bb (diff) | |
parent | 75778a0724b73a0cecd99bd2e1c49fbfdb90e194 (diff) |
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 ab48c5e72156b34300db4a6521cb3c9969be3937
Last updated 81e3228fcb33e8ed32d8b9fbe917444ba080073a
Tree-SHA512: 2aea925497bab2da973f17752410a6759d67181a57c3b12a685d184fbfcca2984c45b702ab0bd641d75e086696a0424f1bf77c5578ca765d6882dc03b42d5f9a
Diffstat (limited to 'src')
-rw-r--r-- | src/streams.h | 6 | ||||
-rw-r--r-- | src/test/transaction_tests.cpp | 8 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/streams.h b/src/streams.h index d5565fe61f..8010a061c7 100644 --- a/src/streams.h +++ b/src/streams.h @@ -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 diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index d952054483..39cff3f463 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -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); |