Move CScriptID to script.{h/cpp}

CScriptID should be next to CScript just as CKeyID is next to CPubKey
This commit is contained in:
Andrew Chow
2023-08-08 10:39:01 -04:00
parent b81ebff0d9
commit 86ea8bed54
16 changed files with 26 additions and 11 deletions

View File

@@ -10,6 +10,8 @@
#include <crypto/common.h>
#include <prevector.h>
#include <serialize.h>
#include <uint256.h>
#include <util/hash_type.h>
#include <assert.h>
#include <climits>
@@ -575,6 +577,15 @@ struct CScriptWitness
std::string ToString() const;
};
/** A reference to a CScript: the Hash160 of its serialization */
class CScriptID : public BaseHash<uint160>
{
public:
CScriptID() : BaseHash() {}
explicit CScriptID(const CScript& in);
explicit CScriptID(const uint160& in) : BaseHash(in) {}
};
/** Test for OP_SUCCESSx opcodes as defined by BIP342. */
bool IsOpSuccess(const opcodetype& opcode);