Browse Source

Fix tests after 38067c18

0.8
Pieter Wuille 13 years ago
parent
commit
0d56f11ada
  1. 8
      src/test/multisig_tests.cpp
  2. 6
      src/test/script_P2SH_tests.cpp
  3. 14
      src/test/script_tests.cpp
  4. 2
      src/test/sigopcount_tests.cpp
  5. 2
      src/test/transaction_tests.cpp

8
src/test/multisig_tests.cpp

@ -46,7 +46,7 @@ BOOST_AUTO_TEST_CASE(multisig_verify)
{ {
CKey key[4]; CKey key[4];
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
key[i].MakeNewKey(); key[i].MakeNewKey(true);
CScript a_and_b; CScript a_and_b;
a_and_b << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << OP_2 << OP_CHECKMULTISIG; a_and_b << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << OP_2 << OP_CHECKMULTISIG;
@ -131,7 +131,7 @@ BOOST_AUTO_TEST_CASE(multisig_IsStandard)
{ {
CKey key[4]; CKey key[4];
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
key[i].MakeNewKey(); key[i].MakeNewKey(true);
CScript a_and_b; CScript a_and_b;
a_and_b << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << OP_2 << OP_CHECKMULTISIG; a_and_b << OP_2 << key[0].GetPubKey() << key[1].GetPubKey() << OP_2 << OP_CHECKMULTISIG;
@ -178,7 +178,7 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1)
CBitcoinAddress keyaddr[3]; CBitcoinAddress keyaddr[3];
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
key[i].MakeNewKey(); key[i].MakeNewKey(true);
keystore.AddKey(key[i]); keystore.AddKey(key[i]);
keyaddr[i].SetPubKey(key[i].GetPubKey()); keyaddr[i].SetPubKey(key[i].GetPubKey());
} }
@ -257,7 +257,7 @@ BOOST_AUTO_TEST_CASE(multisig_Sign)
CKey key[4]; CKey key[4];
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
key[i].MakeNewKey(); key[i].MakeNewKey(true);
keystore.AddKey(key[i]); keystore.AddKey(key[i]);
} }

6
src/test/script_P2SH_tests.cpp

@ -57,7 +57,7 @@ BOOST_AUTO_TEST_CASE(sign)
CKey key[4]; CKey key[4];
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
key[i].MakeNewKey(); key[i].MakeNewKey(true);
keystore.AddKey(key[i]); keystore.AddKey(key[i]);
} }
@ -148,7 +148,7 @@ BOOST_AUTO_TEST_CASE(set)
std::vector<CKey> keys; std::vector<CKey> keys;
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
key[i].MakeNewKey(); key[i].MakeNewKey(true);
keystore.AddKey(key[i]); keystore.AddKey(key[i]);
keys.push_back(key[i]); keys.push_back(key[i]);
} }
@ -249,7 +249,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard)
vector<CKey> keys; vector<CKey> keys;
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
key[i].MakeNewKey(); key[i].MakeNewKey(true);
keystore.AddKey(key[i]); keystore.AddKey(key[i]);
keys.push_back(key[i]); keys.push_back(key[i]);
} }

14
src/test/script_tests.cpp

@ -72,9 +72,9 @@ sign_multisig(CScript scriptPubKey, CKey key, CTransaction transaction)
BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG12) BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG12)
{ {
CKey key1, key2, key3; CKey key1, key2, key3;
key1.MakeNewKey(); key1.MakeNewKey(true);
key2.MakeNewKey(); key2.MakeNewKey(false);
key3.MakeNewKey(); key3.MakeNewKey(true);
CScript scriptPubKey12; CScript scriptPubKey12;
scriptPubKey12 << OP_1 << key1.GetPubKey() << key2.GetPubKey() << OP_2 << OP_CHECKMULTISIG; scriptPubKey12 << OP_1 << key1.GetPubKey() << key2.GetPubKey() << OP_2 << OP_CHECKMULTISIG;
@ -105,10 +105,10 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG12)
BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23) BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23)
{ {
CKey key1, key2, key3, key4; CKey key1, key2, key3, key4;
key1.MakeNewKey(); key1.MakeNewKey(true);
key2.MakeNewKey(); key2.MakeNewKey(false);
key3.MakeNewKey(); key3.MakeNewKey(true);
key4.MakeNewKey(); key4.MakeNewKey(false);
CScript scriptPubKey23; CScript scriptPubKey23;
scriptPubKey23 << OP_2 << key1.GetPubKey() << key2.GetPubKey() << key3.GetPubKey() << OP_3 << OP_CHECKMULTISIG; scriptPubKey23 << OP_2 << key1.GetPubKey() << key2.GetPubKey() << key3.GetPubKey() << OP_3 << OP_CHECKMULTISIG;

2
src/test/sigopcount_tests.cpp

@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE(GetSigOpCount)
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
CKey k; CKey k;
k.MakeNewKey(); k.MakeNewKey(true);
keys.push_back(k); keys.push_back(k);
} }
CScript s2; CScript s2;

2
src/test/transaction_tests.cpp

@ -38,7 +38,7 @@ SetupDummyInputs(CBasicKeyStore& keystoreRet, MapPrevTx& inputsRet)
CKey key[4]; CKey key[4];
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
key[i].MakeNewKey(); key[i].MakeNewKey(i % 2);
keystoreRet.AddKey(key[i]); keystoreRet.AddKey(key[i]);
} }

Loading…
Cancel
Save