mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
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 inab48c5e721
Last updated81e3228fcb
Tree-SHA512: 2aea925497bab2da973f17752410a6759d67181a57c3b12a685d184fbfcca2984c45b702ab0bd641d75e086696a0424f1bf77c5578ca765d6882dc03b42d5f9a
This commit is contained in:
commit
5b6b371c77
2 changed files with 4 additions and 10 deletions
|
@ -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…
Add table
Reference in a new issue