mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-04 09:41:52 +01:00
script: move CScriptID to standard.h and add a ctor for creating them from CScripts
This allows for a reversal of the current behavior. This: CScript foo; CScriptID bar(foo.GetID()); Becomes: CScript foo; CScriptID bar(foo); This way, CScript is no longer dependent on CScriptID or Hash();
This commit is contained in:
@@ -38,7 +38,7 @@ BOOST_AUTO_TEST_CASE(GetSigOpCount)
|
||||
BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 3U);
|
||||
BOOST_CHECK_EQUAL(s1.GetSigOpCount(false), 21U);
|
||||
|
||||
CScript p2sh = GetScriptForDestination(s1.GetID());
|
||||
CScript p2sh = GetScriptForDestination(CScriptID(s1));
|
||||
CScript scriptSig;
|
||||
scriptSig << OP_0 << Serialize(s1);
|
||||
BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(scriptSig), 3U);
|
||||
@@ -54,7 +54,7 @@ BOOST_AUTO_TEST_CASE(GetSigOpCount)
|
||||
BOOST_CHECK_EQUAL(s2.GetSigOpCount(true), 3U);
|
||||
BOOST_CHECK_EQUAL(s2.GetSigOpCount(false), 20U);
|
||||
|
||||
p2sh = GetScriptForDestination(s2.GetID());
|
||||
p2sh = GetScriptForDestination(CScriptID(s2));
|
||||
BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(true), 0U);
|
||||
BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(false), 0U);
|
||||
CScript scriptSig2;
|
||||
|
||||
Reference in New Issue
Block a user