Bitcoin ABC  0.24.10
P2P Digital Currency
script_error.cpp
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #include <script/script_error.h>
7 
8 #include <string>
9 
10 std::string ScriptErrorString(const ScriptError serror) {
11  switch (serror) {
12  case ScriptError::OK:
13  return "No error";
15  return "Script evaluated without error but finished with a "
16  "false/empty top stack element";
18  return "Script failed an OP_VERIFY operation";
20  return "Script failed an OP_EQUALVERIFY operation";
22  return "Script failed an OP_CHECKMULTISIGVERIFY operation";
24  return "Script failed an OP_CHECKSIGVERIFY operation";
26  return "Script failed an OP_CHECKDATASIGVERIFY operation";
28  return "Script failed an OP_NUMEQUALVERIFY operation";
30  return "Script is too big";
32  return "Push value size limit exceeded";
34  return "Operation limit exceeded";
36  return "Stack size limit exceeded";
38  return "Signature count negative or greater than pubkey count";
40  return "Pubkey count negative or limit exceeded";
42  return "Input SigChecks limit exceeded";
44  return "Invalid operand size";
46  return "Given operand is not a number within the valid range "
47  "[-2^31...2^31]";
49  return "The requested encoding is impossible to satisfy";
51  return "Invalid OP_SPLIT range";
53  return "Invalid number of bit set in OP_CHECKMULTISIG";
55  return "Opcode missing or not understood";
57  return "Attempted to use a disabled opcode";
59  return "Operation not valid with the current stack size";
61  return "Operation not valid with the current altstack size";
63  return "OP_RETURN was encountered";
65  return "Invalid OP_IF construction";
67  return "Division by zero error";
69  return "Modulo by zero error";
71  return "Bitfield of unexpected size error";
73  return "Bitfield's bit out of the expected range";
75  return "Negative locktime";
77  return "Locktime requirement not satisfied";
79  return "Signature hash type missing or not understood";
81  return "Non-canonical DER signature";
83  return "Data push larger than necessary";
85  return "Only push operators allowed in signatures";
87  return "Non-canonical signature: S value is unnecessarily high";
89  return "OP_IF/NOTIF argument must be minimal";
91  return "Signature must be zero for failed CHECK(MULTI)SIG "
92  "operation";
94  return "Signature cannot be 65 bytes in CHECKMULTISIG";
96  return "Only Schnorr signatures allowed in this operation";
98  return "NOPx reserved for soft-fork upgrades";
100  return "Public key is neither compressed or uncompressed";
102  return "Stack size must be exactly one after execution";
104  return "Illegal use of SIGHASH_FORKID";
106  return "Signature must use SIGHASH_FORKID";
108  return "Validation resources exceeded (SigChecks)";
111  default:
112  break;
113  }
114  return "unknown error";
115 }
ScriptErrorString
std::string ScriptErrorString(const ScriptError serror)
Definition: script_error.cpp:10
ScriptError::SIG_PUSHONLY
@ SIG_PUSHONLY
ScriptError
ScriptError
Definition: script_error.h:11
ScriptError::INVALID_OPERAND_SIZE
@ INVALID_OPERAND_SIZE
ScriptError::EVAL_FALSE
@ EVAL_FALSE
ScriptError::SIG_NULLFAIL
@ SIG_NULLFAIL
ScriptError::ILLEGAL_FORKID
@ ILLEGAL_FORKID
ScriptError::OK
@ OK
ScriptError::MINIMALDATA
@ MINIMALDATA
ScriptError::SIG_NONSCHNORR
@ SIG_NONSCHNORR
ScriptError::NEGATIVE_LOCKTIME
@ NEGATIVE_LOCKTIME
ScriptError::INPUT_SIGCHECKS
@ INPUT_SIGCHECKS
ScriptError::UNBALANCED_CONDITIONAL
@ UNBALANCED_CONDITIONAL
ScriptError::PUBKEY_COUNT
@ PUBKEY_COUNT
ScriptError::CHECKDATASIGVERIFY
@ CHECKDATASIGVERIFY
ScriptError::BAD_OPCODE
@ BAD_OPCODE
ScriptError::SCRIPT_SIZE
@ SCRIPT_SIZE
ScriptError::NUMEQUALVERIFY
@ NUMEQUALVERIFY
ScriptError::PUBKEYTYPE
@ PUBKEYTYPE
ScriptError::SIG_COUNT
@ SIG_COUNT
ScriptError::SIG_HASHTYPE
@ SIG_HASHTYPE
ScriptError::STACK_SIZE
@ STACK_SIZE
ScriptError::INVALID_BITFIELD_SIZE
@ INVALID_BITFIELD_SIZE
ScriptError::INVALID_BIT_RANGE
@ INVALID_BIT_RANGE
ScriptError::CHECKSIGVERIFY
@ CHECKSIGVERIFY
ScriptError::SIG_HIGH_S
@ SIG_HIGH_S
ScriptError::MOD_BY_ZERO
@ MOD_BY_ZERO
ScriptError::OP_COUNT
@ OP_COUNT
ScriptError::INVALID_BIT_COUNT
@ INVALID_BIT_COUNT
ScriptError::CLEANSTACK
@ CLEANSTACK
ScriptError::INVALID_ALTSTACK_OPERATION
@ INVALID_ALTSTACK_OPERATION
ScriptError::DISABLED_OPCODE
@ DISABLED_OPCODE
ScriptError::UNSATISFIED_LOCKTIME
@ UNSATISFIED_LOCKTIME
ScriptError::INVALID_NUMBER_RANGE
@ INVALID_NUMBER_RANGE
ScriptError::OP_RETURN
@ OP_RETURN
ScriptError::IMPOSSIBLE_ENCODING
@ IMPOSSIBLE_ENCODING
ScriptError::INVALID_SPLIT_RANGE
@ INVALID_SPLIT_RANGE
ScriptError::INVALID_STACK_OPERATION
@ INVALID_STACK_OPERATION
ScriptError::EQUALVERIFY
@ EQUALVERIFY
ScriptError::SIG_DER
@ SIG_DER
script_error.h
ScriptError::ERROR_COUNT
@ ERROR_COUNT
ScriptError::SIG_BADLENGTH
@ SIG_BADLENGTH
ScriptError::DIV_BY_ZERO
@ DIV_BY_ZERO
ScriptError::PUSH_SIZE
@ PUSH_SIZE
ScriptError::VERIFY
@ VERIFY
ScriptError::UNKNOWN
@ UNKNOWN
ScriptError::DISCOURAGE_UPGRADABLE_NOPS
@ DISCOURAGE_UPGRADABLE_NOPS
ScriptError::SIGCHECKS_LIMIT_EXCEEDED
@ SIGCHECKS_LIMIT_EXCEEDED
ScriptError::CHECKMULTISIGVERIFY
@ CHECKMULTISIGVERIFY
ScriptError::MUST_USE_FORKID
@ MUST_USE_FORKID
ScriptError::MINIMALIF
@ MINIMALIF