aboutsummaryrefslogtreecommitdiff
path: root/src/test/script_P2SH_tests.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2014-06-07 13:53:27 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2014-06-21 22:59:03 +0200
commit4949004d68dc08382df2c34ae519c1b1cfd60f1a (patch)
treee3c4b2d6fa162af1cfbe44f6deb39278c12c5672 /src/test/script_P2SH_tests.cpp
parent8f59251b83cd9c862aee53dd50ce32bcab12ed6d (diff)
downloadbitcoin-4949004d68dc08382df2c34ae519c1b1cfd60f1a.tar.xz
Add CMutableTransaction and make CTransaction immutable.
In addition, introduce a cached hash inside CTransaction, to prevent recalculating it over and over again.
Diffstat (limited to 'src/test/script_P2SH_tests.cpp')
-rw-r--r--src/test/script_P2SH_tests.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp
index 9b1290e0ea..a75593a8b2 100644
--- a/src/test/script_P2SH_tests.cpp
+++ b/src/test/script_P2SH_tests.cpp
@@ -30,11 +30,11 @@ static bool
Verify(const CScript& scriptSig, const CScript& scriptPubKey, bool fStrict)
{
// Create dummy to/from transactions:
- CTransaction txFrom;
+ CMutableTransaction txFrom;
txFrom.vout.resize(1);
txFrom.vout[0].scriptPubKey = scriptPubKey;
- CTransaction txTo;
+ CMutableTransaction txTo;
txTo.vin.resize(1);
txTo.vout.resize(1);
txTo.vin[0].prevout.n = 0;
@@ -78,7 +78,7 @@ BOOST_AUTO_TEST_CASE(sign)
evalScripts[i].SetDestination(standardScripts[i].GetID());
}
- CTransaction txFrom; // Funding transaction:
+ CMutableTransaction txFrom; // Funding transaction:
string reason;
txFrom.vout.resize(8);
for (int i = 0; i < 4; i++)
@@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE(sign)
}
BOOST_CHECK(IsStandardTx(txFrom, reason));
- CTransaction txTo[8]; // Spending transactions
+ CMutableTransaction txTo[8]; // Spending transactions
for (int i = 0; i < 8; i++)
{
txTo[i].vin.resize(1);
@@ -173,7 +173,7 @@ BOOST_AUTO_TEST_CASE(set)
keystore.AddCScript(inner[i]);
}
- CTransaction txFrom; // Funding transaction:
+ CMutableTransaction txFrom; // Funding transaction:
string reason;
txFrom.vout.resize(4);
for (int i = 0; i < 4; i++)
@@ -183,7 +183,7 @@ BOOST_AUTO_TEST_CASE(set)
}
BOOST_CHECK(IsStandardTx(txFrom, reason));
- CTransaction txTo[4]; // Spending transactions
+ CMutableTransaction txTo[4]; // Spending transactions
for (int i = 0; i < 4; i++)
{
txTo[i].vin.resize(1);
@@ -265,7 +265,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard)
keys.push_back(key[i].GetPubKey());
}
- CTransaction txFrom;
+ CMutableTransaction txFrom;
txFrom.vout.resize(6);
// First three are standard:
@@ -299,7 +299,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard)
coins.SetCoins(txFrom.GetHash(), CCoins(txFrom, 0));
- CTransaction txTo;
+ CMutableTransaction txTo;
txTo.vout.resize(1);
txTo.vout[0].scriptPubKey.SetDestination(key[1].GetPubKey().GetID());
@@ -326,7 +326,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard)
txTo.vin[i].scriptSig = t;
}
- CTransaction txToNonStd;
+ CMutableTransaction txToNonStd;
txToNonStd.vout.resize(1);
txToNonStd.vout[0].scriptPubKey.SetDestination(key[1].GetPubKey().GetID());
txToNonStd.vout[0].nValue = 1000;