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