2 #include <boost/test/unit_test.hpp>
3 #include <boost/foreach.hpp>
11 static std::vector<unsigned char>
14 std::vector<unsigned char> sSerialized(s);
18 BOOST_AUTO_TEST_SUITE(sigopcount_tests)
38 BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(scriptSig), 3U);
40 std::vector<CPubKey> keys;
41 for (
int i = 0; i < 3; i++)
52 p2sh.SetDestination(s2.
GetID());
53 BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(
true), 0U);
54 BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(
false), 0U);
56 scriptSig2 <<
OP_1 << dummy << dummy << Serialize(s2);
57 BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(scriptSig2), 3U);
60 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(GetSigOpCount)
void Serialize(Stream &s, char a, int, int=0)
void SetDestination(const CTxDestination &address)
int std::string int dummy
unsigned int GetSigOpCount(bool fAccurate) const
CPubKey GetPubKey() const
void MakeNewKey(bool fCompressed)
Serialized script, used inside transaction inputs and outputs.
void SetMultisig(int nRequired, const std::vector< CPubKey > &keys)
An encapsulated private key.