aboutsummaryrefslogtreecommitdiff
path: root/src/test/sigopcount_tests.cpp
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-10-04 13:53:40 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-10-12 11:27:19 +0200
commitfa05a726c225dc65dee79367bb67f099ae4f99e6 (patch)
tree8bf1f8a82fcf024fe110ac76f9563acf2b1132cf /src/test/sigopcount_tests.cpp
parent4a5aae9330780c3740e27cc511f7cba1fab745b9 (diff)
tidy: modernize-use-emplace
Diffstat (limited to 'src/test/sigopcount_tests.cpp')
-rw-r--r--src/test/sigopcount_tests.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/sigopcount_tests.cpp b/src/test/sigopcount_tests.cpp
index ec9490d745..c0bed50e1d 100644
--- a/src/test/sigopcount_tests.cpp
+++ b/src/test/sigopcount_tests.cpp
@@ -160,8 +160,8 @@ BOOST_AUTO_TEST_CASE(GetTxSigOpCost)
CScript scriptPubKey = GetScriptForDestination(WitnessV0KeyHash(pubkey));
CScript scriptSig = CScript();
CScriptWitness scriptWitness;
- scriptWitness.stack.push_back(std::vector<unsigned char>(0));
- scriptWitness.stack.push_back(std::vector<unsigned char>(0));
+ scriptWitness.stack.emplace_back(0);
+ scriptWitness.stack.emplace_back(0);
BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, scriptWitness);
@@ -189,8 +189,8 @@ BOOST_AUTO_TEST_CASE(GetTxSigOpCost)
CScript scriptPubKey = GetScriptForDestination(ScriptHash(scriptSig));
scriptSig = CScript() << ToByteVector(scriptSig);
CScriptWitness scriptWitness;
- scriptWitness.stack.push_back(std::vector<unsigned char>(0));
- scriptWitness.stack.push_back(std::vector<unsigned char>(0));
+ scriptWitness.stack.emplace_back(0);
+ scriptWitness.stack.emplace_back(0);
BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, scriptWitness);
assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 1);
@@ -203,9 +203,9 @@ BOOST_AUTO_TEST_CASE(GetTxSigOpCost)
CScript scriptPubKey = GetScriptForDestination(WitnessV0ScriptHash(witnessScript));
CScript scriptSig = CScript();
CScriptWitness scriptWitness;
- scriptWitness.stack.push_back(std::vector<unsigned char>(0));
- scriptWitness.stack.push_back(std::vector<unsigned char>(0));
- scriptWitness.stack.push_back(std::vector<unsigned char>(witnessScript.begin(), witnessScript.end()));
+ scriptWitness.stack.emplace_back(0);
+ scriptWitness.stack.emplace_back(0);
+ scriptWitness.stack.emplace_back(witnessScript.begin(), witnessScript.end());
BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, scriptWitness);
assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 2);
@@ -220,9 +220,9 @@ BOOST_AUTO_TEST_CASE(GetTxSigOpCost)
CScript scriptPubKey = GetScriptForDestination(ScriptHash(redeemScript));
CScript scriptSig = CScript() << ToByteVector(redeemScript);
CScriptWitness scriptWitness;
- scriptWitness.stack.push_back(std::vector<unsigned char>(0));
- scriptWitness.stack.push_back(std::vector<unsigned char>(0));
- scriptWitness.stack.push_back(std::vector<unsigned char>(witnessScript.begin(), witnessScript.end()));
+ scriptWitness.stack.emplace_back(0);
+ scriptWitness.stack.emplace_back(0);
+ scriptWitness.stack.emplace_back(witnessScript.begin(), witnessScript.end());
BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, scriptWitness);
assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 2);