Bitcoin ABC
0.22.12
P2P Digital Currency
src
script
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
const
char
*
ScriptErrorString
(
const
ScriptError
serror) {
9
switch
(serror) {
10
case
ScriptError::OK
:
11
return
"No error"
;
12
case
ScriptError::EVAL_FALSE
:
13
return
"Script evaluated without error but finished with a "
14
"false/empty top stack element"
;
15
case
ScriptError::VERIFY
:
16
return
"Script failed an OP_VERIFY operation"
;
17
case
ScriptError::EQUALVERIFY
:
18
return
"Script failed an OP_EQUALVERIFY operation"
;
19
case
ScriptError::CHECKMULTISIGVERIFY
:
20
return
"Script failed an OP_CHECKMULTISIGVERIFY operation"
;
21
case
ScriptError::CHECKSIGVERIFY
:
22
return
"Script failed an OP_CHECKSIGVERIFY operation"
;
23
case
ScriptError::CHECKDATASIGVERIFY
:
24
return
"Script failed an OP_CHECKDATASIGVERIFY operation"
;
25
case
ScriptError::NUMEQUALVERIFY
:
26
return
"Script failed an OP_NUMEQUALVERIFY operation"
;
27
case
ScriptError::SCRIPT_SIZE
:
28
return
"Script is too big"
;
29
case
ScriptError::PUSH_SIZE
:
30
return
"Push value size limit exceeded"
;
31
case
ScriptError::OP_COUNT
:
32
return
"Operation limit exceeded"
;
33
case
ScriptError::STACK_SIZE
:
34
return
"Stack size limit exceeded"
;
35
case
ScriptError::SIG_COUNT
:
36
return
"Signature count negative or greater than pubkey count"
;
37
case
ScriptError::PUBKEY_COUNT
:
38
return
"Pubkey count negative or limit exceeded"
;
39
case
ScriptError::INPUT_SIGCHECKS
:
40
return
"Input SigChecks limit exceeded"
;
41
case
ScriptError::INVALID_OPERAND_SIZE
:
42
return
"Invalid operand size"
;
43
case
ScriptError::INVALID_NUMBER_RANGE
:
44
return
"Given operand is not a number within the valid range "
45
"[-2^31...2^31]"
;
46
case
ScriptError::IMPOSSIBLE_ENCODING
:
47
return
"The requested encoding is impossible to satisfy"
;
48
case
ScriptError::INVALID_SPLIT_RANGE
:
49
return
"Invalid OP_SPLIT range"
;
50
case
ScriptError::INVALID_BIT_COUNT
:
51
return
"Invalid number of bit set in OP_CHECKMULTISIG"
;
52
case
ScriptError::BAD_OPCODE
:
53
return
"Opcode missing or not understood"
;
54
case
ScriptError::DISABLED_OPCODE
:
55
return
"Attempted to use a disabled opcode"
;
56
case
ScriptError::INVALID_STACK_OPERATION
:
57
return
"Operation not valid with the current stack size"
;
58
case
ScriptError::INVALID_ALTSTACK_OPERATION
:
59
return
"Operation not valid with the current altstack size"
;
60
case
ScriptError::OP_RETURN
:
61
return
"OP_RETURN was encountered"
;
62
case
ScriptError::UNBALANCED_CONDITIONAL
:
63
return
"Invalid OP_IF construction"
;
64
case
ScriptError::DIV_BY_ZERO
:
65
return
"Division by zero error"
;
66
case
ScriptError::MOD_BY_ZERO
:
67
return
"Modulo by zero error"
;
68
case
ScriptError::INVALID_BITFIELD_SIZE
:
69
return
"Bitfield of unexpected size error"
;
70
case
ScriptError::INVALID_BIT_RANGE
:
71
return
"Bitfield's bit out of the expected range"
;
72
case
ScriptError::NEGATIVE_LOCKTIME
:
73
return
"Negative locktime"
;
74
case
ScriptError::UNSATISFIED_LOCKTIME
:
75
return
"Locktime requirement not satisfied"
;
76
case
ScriptError::SIG_HASHTYPE
:
77
return
"Signature hash type missing or not understood"
;
78
case
ScriptError::SIG_DER
:
79
return
"Non-canonical DER signature"
;
80
case
ScriptError::MINIMALDATA
:
81
return
"Data push larger than necessary"
;
82
case
ScriptError::SIG_PUSHONLY
:
83
return
"Only push operators allowed in signatures"
;
84
case
ScriptError::SIG_HIGH_S
:
85
return
"Non-canonical signature: S value is unnecessarily high"
;
86
case
ScriptError::MINIMALIF
:
87
return
"OP_IF/NOTIF argument must be minimal"
;
88
case
ScriptError::SIG_NULLFAIL
:
89
return
"Signature must be zero for failed CHECK(MULTI)SIG "
90
"operation"
;
91
case
ScriptError::SIG_BADLENGTH
:
92
return
"Signature cannot be 65 bytes in CHECKMULTISIG"
;
93
case
ScriptError::SIG_NONSCHNORR
:
94
return
"Only Schnorr signatures allowed in this operation"
;
95
case
ScriptError::DISCOURAGE_UPGRADABLE_NOPS
:
96
return
"NOPx reserved for soft-fork upgrades"
;
97
case
ScriptError::PUBKEYTYPE
:
98
return
"Public key is neither compressed or uncompressed"
;
99
case
ScriptError::CLEANSTACK
:
100
return
"Extra items left on stack after execution"
;
101
case
ScriptError::ILLEGAL_FORKID
:
102
return
"Illegal use of SIGHASH_FORKID"
;
103
case
ScriptError::MUST_USE_FORKID
:
104
return
"Signature must use SIGHASH_FORKID"
;
105
case
ScriptError::SIGCHECKS_LIMIT_EXCEEDED
:
106
return
"Validation resources exceeded (SigChecks)"
;
107
case
ScriptError::UNKNOWN
:
108
case
ScriptError::ERROR_COUNT
:
109
default
:
110
break
;
111
}
112
return
"unknown error"
;
113
}
ScriptError::UNKNOWN
ScriptError::DISABLED_OPCODE
ScriptError::UNBALANCED_CONDITIONAL
ScriptError::INVALID_OPERAND_SIZE
ScriptError::EQUALVERIFY
ScriptError::INPUT_SIGCHECKS
ScriptError::IMPOSSIBLE_ENCODING
ScriptError::DIV_BY_ZERO
ScriptError::NUMEQUALVERIFY
ScriptError::SCRIPT_SIZE
ScriptError::EVAL_FALSE
ScriptError
ScriptError
Definition:
script_error.h:9
ScriptError::SIG_DER
ScriptError::INVALID_BIT_COUNT
ScriptError::MINIMALIF
ScriptErrorString
const char * ScriptErrorString(const ScriptError serror)
Definition:
script_error.cpp:8
ScriptError::MOD_BY_ZERO
ScriptError::OP_COUNT
ScriptError::INVALID_ALTSTACK_OPERATION
ScriptError::INVALID_BIT_RANGE
ScriptError::INVALID_BITFIELD_SIZE
ScriptError::INVALID_NUMBER_RANGE
ScriptError::CHECKDATASIGVERIFY
ScriptError::CHECKMULTISIGVERIFY
ScriptError::INVALID_STACK_OPERATION
ScriptError::ERROR_COUNT
ScriptError::INVALID_SPLIT_RANGE
ScriptError::PUBKEY_COUNT
ScriptError::MUST_USE_FORKID
ScriptError::UNSATISFIED_LOCKTIME
script_error.h
ScriptError::SIG_HASHTYPE
ScriptError::NEGATIVE_LOCKTIME
ScriptError::CLEANSTACK
ScriptError::OP_RETURN
ScriptError::STACK_SIZE
ScriptError::SIG_PUSHONLY
ScriptError::DISCOURAGE_UPGRADABLE_NOPS
ScriptError::SIG_NULLFAIL
ScriptError::CHECKSIGVERIFY
ScriptError::SIG_NONSCHNORR
ScriptError::SIG_BADLENGTH
ScriptError::BAD_OPCODE
ScriptError::OK
ScriptError::MINIMALDATA
ScriptError::VERIFY
ScriptError::PUBKEYTYPE
ScriptError::PUSH_SIZE
ScriptError::SIG_HIGH_S
ScriptError::SIG_COUNT
ScriptError::SIGCHECKS_LIMIT_EXCEEDED
ScriptError::ILLEGAL_FORKID
Generated on Fri Jan 15 2021 17:44:47 for Bitcoin ABC by
1.8.13