mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02: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:
parent
e8f6d54f1f
commit
066e2a1403
17 changed files with 37 additions and 34 deletions
|
|
@ -162,7 +162,7 @@ public:
|
|||
TestBuilder(const CScript& redeemScript, const std::string& comment_, int flags_, bool P2SH = false) : scriptPubKey(redeemScript), havePush(false), comment(comment_), flags(flags_)
|
||||
{
|
||||
if (P2SH) {
|
||||
creditTx = BuildCreditingTransaction(CScript() << OP_HASH160 << redeemScript.GetID() << OP_EQUAL);
|
||||
creditTx = BuildCreditingTransaction(CScript() << OP_HASH160 << CScriptID(redeemScript) << OP_EQUAL);
|
||||
} else {
|
||||
creditTx = BuildCreditingTransaction(redeemScript);
|
||||
}
|
||||
|
|
@ -697,7 +697,7 @@ BOOST_AUTO_TEST_CASE(script_combineSigs)
|
|||
// P2SH, single-signature case:
|
||||
CScript pkSingle; pkSingle << keys[0].GetPubKey() << OP_CHECKSIG;
|
||||
keystore.AddCScript(pkSingle);
|
||||
scriptPubKey = GetScriptForDestination(pkSingle.GetID());
|
||||
scriptPubKey = GetScriptForDestination(CScriptID(pkSingle));
|
||||
SignSignature(keystore, txFrom, txTo, 0);
|
||||
combined = CombineSignatures(scriptPubKey, txTo, 0, scriptSig, empty);
|
||||
BOOST_CHECK(combined == scriptSig);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue