aboutsummaryrefslogtreecommitdiff
path: root/src/test/script_tests.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-05-01 06:52:05 +0200
committerPieter Wuille <sipa@ulyssis.org>2013-05-30 05:20:21 +0200
commitdfa23b94c24aae6466152fccbe896ba5dc0e97b4 (patch)
treea1f7f856577b2223bae9351c960b595b4032ce7a /src/test/script_tests.cpp
parent5d891489ab7828ad8db15e85bb63e2f13f021a6a (diff)
downloadbitcoin-dfa23b94c24aae6466152fccbe896ba5dc0e97b4.tar.xz
CSecret/CKey -> CKey/CPubKey split/refactor
Diffstat (limited to 'src/test/script_tests.cpp')
-rw-r--r--src/test/script_tests.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp
index 5d5a1525f7..e7ad52627c 100644
--- a/src/test/script_tests.cpp
+++ b/src/test/script_tests.cpp
@@ -211,7 +211,7 @@ sign_multisig(CScript scriptPubKey, std::vector<CKey> keys, CTransaction transac
// and vice-versa)
//
result << OP_0;
- BOOST_FOREACH(CKey key, keys)
+ BOOST_FOREACH(const CKey &key, keys)
{
vector<unsigned char> vchSig;
BOOST_CHECK(key.Sign(hash, vchSig));
@@ -221,7 +221,7 @@ sign_multisig(CScript scriptPubKey, std::vector<CKey> keys, CTransaction transac
return result;
}
CScript
-sign_multisig(CScript scriptPubKey, CKey key, CTransaction transaction)
+sign_multisig(CScript scriptPubKey, const CKey &key, CTransaction transaction)
{
std::vector<CKey> keys;
keys.push_back(key);
@@ -333,11 +333,13 @@ BOOST_AUTO_TEST_CASE(script_combineSigs)
// Test the CombineSignatures function
CBasicKeyStore keystore;
vector<CKey> keys;
+ vector<CPubKey> pubkeys;
for (int i = 0; i < 3; i++)
{
CKey key;
key.MakeNewKey(i%2 == 1);
keys.push_back(key);
+ pubkeys.push_back(key.GetPubKey());
keystore.AddKey(key);
}
@@ -390,7 +392,7 @@ BOOST_AUTO_TEST_CASE(script_combineSigs)
BOOST_CHECK(combined == scriptSig);
// Hardest case: Multisig 2-of-3
- scriptPubKey.SetMultisig(2, keys);
+ scriptPubKey.SetMultisig(2, pubkeys);
keystore.AddCScript(scriptPubKey);
SignSignature(keystore, txFrom, txTo, 0);
combined = CombineSignatures(scriptPubKey, txTo, 0, scriptSig, empty);