mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
Move CScriptID to script.{h/cpp}
CScriptID should be next to CScript just as CKeyID is next to CPubKey
This commit is contained in:
parent
b81ebff0d9
commit
86ea8bed54
16 changed files with 26 additions and 11 deletions
|
@ -6,6 +6,7 @@
|
||||||
#include <compressor.h>
|
#include <compressor.h>
|
||||||
|
|
||||||
#include <pubkey.h>
|
#include <pubkey.h>
|
||||||
|
#include <script/script.h>
|
||||||
#include <script/standard.h>
|
#include <script/standard.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <consensus/amount.h>
|
#include <consensus/amount.h>
|
||||||
#include <interfaces/chain.h> // For ChainClient
|
#include <interfaces/chain.h> // For ChainClient
|
||||||
#include <pubkey.h> // For CKeyID and CScriptID (definitions needed in CTxDestination instantiation)
|
#include <pubkey.h> // For CKeyID and CScriptID (definitions needed in CTxDestination instantiation)
|
||||||
|
#include <script/script.h>
|
||||||
#include <script/standard.h> // For CTxDestination
|
#include <script/standard.h> // For CTxDestination
|
||||||
#include <support/allocators/secure.h> // For SecureString
|
#include <support/allocators/secure.h> // For SecureString
|
||||||
#include <util/fs.h>
|
#include <util/fs.h>
|
||||||
|
|
|
@ -5,10 +5,13 @@
|
||||||
|
|
||||||
#include <script/script.h>
|
#include <script/script.h>
|
||||||
|
|
||||||
|
#include <hash.h>
|
||||||
#include <util/strencodings.h>
|
#include <util/strencodings.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
CScriptID::CScriptID(const CScript& in) : BaseHash(Hash160(in)) {}
|
||||||
|
|
||||||
std::string GetOpName(opcodetype opcode)
|
std::string GetOpName(opcodetype opcode)
|
||||||
{
|
{
|
||||||
switch (opcode)
|
switch (opcode)
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
#include <crypto/common.h>
|
#include <crypto/common.h>
|
||||||
#include <prevector.h>
|
#include <prevector.h>
|
||||||
#include <serialize.h>
|
#include <serialize.h>
|
||||||
|
#include <uint256.h>
|
||||||
|
#include <util/hash_type.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
@ -575,6 +577,15 @@ struct CScriptWitness
|
||||||
std::string ToString() const;
|
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. */
|
/** Test for OP_SUCCESSx opcodes as defined by BIP342. */
|
||||||
bool IsOpSuccess(const opcodetype& opcode);
|
bool IsOpSuccess(const opcodetype& opcode);
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <primitives/transaction.h>
|
#include <primitives/transaction.h>
|
||||||
#include <script/keyorigin.h>
|
#include <script/keyorigin.h>
|
||||||
#include <script/miniscript.h>
|
#include <script/miniscript.h>
|
||||||
|
#include <script/script.h>
|
||||||
#include <script/signingprovider.h>
|
#include <script/signingprovider.h>
|
||||||
#include <script/standard.h>
|
#include <script/standard.h>
|
||||||
#include <uint256.h>
|
#include <uint256.h>
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
|
|
||||||
typedef std::vector<unsigned char> valtype;
|
typedef std::vector<unsigned char> valtype;
|
||||||
|
|
||||||
CScriptID::CScriptID(const CScript& in) : BaseHash(Hash160(in)) {}
|
|
||||||
|
|
||||||
ScriptHash::ScriptHash(const CScript& in) : BaseHash(Hash160(in)) {}
|
ScriptHash::ScriptHash(const CScript& in) : BaseHash(Hash160(in)) {}
|
||||||
ScriptHash::ScriptHash(const CScriptID& in) : BaseHash(static_cast<uint160>(in)) {}
|
ScriptHash::ScriptHash(const CScriptID& in) : BaseHash(static_cast<uint160>(in)) {}
|
||||||
|
|
||||||
|
|
|
@ -21,15 +21,6 @@ static const bool DEFAULT_ACCEPT_DATACARRIER = true;
|
||||||
class CKeyID;
|
class CKeyID;
|
||||||
class CScript;
|
class CScript;
|
||||||
|
|
||||||
/** A reference to a CScript: the Hash160 of its serialization (see script.h) */
|
|
||||||
class CScriptID : public BaseHash<uint160>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CScriptID() : BaseHash() {}
|
|
||||||
explicit CScriptID(const CScript& in);
|
|
||||||
explicit CScriptID(const uint160& in) : BaseHash(in) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default setting for -datacarriersize. 80 bytes of data, +1 for OP_RETURN,
|
* Default setting for -datacarriersize. 80 bytes of data, +1 for OP_RETURN,
|
||||||
* +2 for the pushdata opcodes.
|
* +2 for the pushdata opcodes.
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
#include <compressor.h>
|
#include <compressor.h>
|
||||||
|
#include <script/script.h>
|
||||||
#include <script/standard.h>
|
#include <script/standard.h>
|
||||||
#include <test/util/setup_common.h>
|
#include <test/util/setup_common.h>
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <pow.h>
|
#include <pow.h>
|
||||||
#include <protocol.h>
|
#include <protocol.h>
|
||||||
#include <pubkey.h>
|
#include <pubkey.h>
|
||||||
|
#include <script/script.h>
|
||||||
#include <script/standard.h>
|
#include <script/standard.h>
|
||||||
#include <serialize.h>
|
#include <serialize.h>
|
||||||
#include <streams.h>
|
#include <streams.h>
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <core_io.h>
|
#include <core_io.h>
|
||||||
#include <key_io.h>
|
#include <key_io.h>
|
||||||
#include <rpc/util.h>
|
#include <rpc/util.h>
|
||||||
|
#include <script/script.h>
|
||||||
#include <util/bip32.h>
|
#include <util/bip32.h>
|
||||||
#include <util/translation.h>
|
#include <util/translation.h>
|
||||||
#include <wallet/receive.h>
|
#include <wallet/receive.h>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <hash.h>
|
#include <hash.h>
|
||||||
#include <key_io.h>
|
#include <key_io.h>
|
||||||
#include <rpc/util.h>
|
#include <rpc/util.h>
|
||||||
|
#include <script/script.h>
|
||||||
#include <util/moneystr.h>
|
#include <util/moneystr.h>
|
||||||
#include <wallet/coincontrol.h>
|
#include <wallet/coincontrol.h>
|
||||||
#include <wallet/receive.h>
|
#include <wallet/receive.h>
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <policy/policy.h>
|
#include <policy/policy.h>
|
||||||
#include <rpc/rawtransaction_util.h>
|
#include <rpc/rawtransaction_util.h>
|
||||||
#include <rpc/util.h>
|
#include <rpc/util.h>
|
||||||
|
#include <script/script.h>
|
||||||
#include <util/fees.h>
|
#include <util/fees.h>
|
||||||
#include <util/rbf.h>
|
#include <util/rbf.h>
|
||||||
#include <util/translation.h>
|
#include <util/translation.h>
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include <logging.h>
|
#include <logging.h>
|
||||||
#include <outputtype.h>
|
#include <outputtype.h>
|
||||||
#include <script/descriptor.h>
|
#include <script/descriptor.h>
|
||||||
|
#include <script/script.h>
|
||||||
#include <script/sign.h>
|
#include <script/sign.h>
|
||||||
#include <util/bip32.h>
|
#include <util/bip32.h>
|
||||||
#include <util/strencodings.h>
|
#include <util/strencodings.h>
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <logging.h>
|
#include <logging.h>
|
||||||
#include <psbt.h>
|
#include <psbt.h>
|
||||||
#include <script/descriptor.h>
|
#include <script/descriptor.h>
|
||||||
|
#include <script/script.h>
|
||||||
#include <script/signingprovider.h>
|
#include <script/signingprovider.h>
|
||||||
#include <script/standard.h>
|
#include <script/standard.h>
|
||||||
#include <util/error.h>
|
#include <util/error.h>
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <policy/policy.h>
|
#include <policy/policy.h>
|
||||||
#include <primitives/transaction.h>
|
#include <primitives/transaction.h>
|
||||||
|
#include <script/script.h>
|
||||||
#include <script/signingprovider.h>
|
#include <script/signingprovider.h>
|
||||||
#include <util/check.h>
|
#include <util/check.h>
|
||||||
#include <util/fees.h>
|
#include <util/fees.h>
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <common/system.h>
|
#include <common/system.h>
|
||||||
#include <key_io.h>
|
#include <key_io.h>
|
||||||
#include <protocol.h>
|
#include <protocol.h>
|
||||||
|
#include <script/script.h>
|
||||||
#include <serialize.h>
|
#include <serialize.h>
|
||||||
#include <sync.h>
|
#include <sync.h>
|
||||||
#include <util/bip32.h>
|
#include <util/bip32.h>
|
||||||
|
|
Loading…
Reference in a new issue