Bitcoin ABC
0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
src
script
script_error.h
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
#ifndef BITCOIN_SCRIPT_SCRIPT_ERROR_H
7
#define BITCOIN_SCRIPT_SCRIPT_ERROR_H
8
9
#include <string>
10
11
enum class
ScriptError
{
12
OK
= 0,
13
UNKNOWN
,
14
EVAL_FALSE
,
15
OP_RETURN
,
16
17
/* Max sizes */
18
SCRIPT_SIZE
,
19
PUSH_SIZE
,
20
OP_COUNT
,
21
STACK_SIZE
,
22
SIG_COUNT
,
23
PUBKEY_COUNT
,
24
INPUT_SIGCHECKS
,
25
26
/* Operands checks */
27
INVALID_OPERAND_SIZE
,
28
INVALID_NUMBER_RANGE
,
29
IMPOSSIBLE_ENCODING
,
30
INVALID_SPLIT_RANGE
,
31
INVALID_BIT_COUNT
,
32
33
/* Failed verify operations */
34
VERIFY
,
35
EQUALVERIFY
,
36
CHECKMULTISIGVERIFY
,
37
CHECKSIGVERIFY
,
38
CHECKDATASIGVERIFY
,
39
NUMEQUALVERIFY
,
40
41
/* Logical/Format/Canonical errors */
42
BAD_OPCODE
,
43
DISABLED_OPCODE
,
44
INVALID_STACK_OPERATION
,
45
INVALID_ALTSTACK_OPERATION
,
46
UNBALANCED_CONDITIONAL
,
47
48
/* Divisor errors */
49
DIV_BY_ZERO
,
50
MOD_BY_ZERO
,
51
52
/* Bitfield errors */
53
INVALID_BITFIELD_SIZE
,
54
INVALID_BIT_RANGE
,
55
56
/* CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY */
57
NEGATIVE_LOCKTIME
,
58
UNSATISFIED_LOCKTIME
,
59
60
/* Malleability */
61
SIG_HASHTYPE
,
62
SIG_DER
,
63
MINIMALDATA
,
64
SIG_PUSHONLY
,
65
SIG_HIGH_S
,
66
PUBKEYTYPE
,
67
CLEANSTACK
,
68
MINIMALIF
,
69
SIG_NULLFAIL
,
70
71
/* Schnorr */
72
SIG_BADLENGTH
,
73
SIG_NONSCHNORR
,
74
75
/* softfork safeness */
76
DISCOURAGE_UPGRADABLE_NOPS
,
77
78
/* anti replay */
79
ILLEGAL_FORKID
,
80
MUST_USE_FORKID
,
81
82
/* Auxiliary errors (unused by interpreter) */
83
SIGCHECKS_LIMIT_EXCEEDED
,
84
85
ERROR_COUNT
,
86
};
87
88
#define SCRIPT_ERR_LAST ScriptError::ERROR_COUNT
89
90
std::string
ScriptErrorString
(
const
ScriptError
error
);
91
92
namespace
{
93
94
inline
bool
set_success
(
ScriptError
*
ret
) {
95
if
(
ret
) {
96
*
ret
=
ScriptError::OK
;
97
}
98
return
true
;
99
}
100
101
inline
bool
set_error
(
ScriptError
*
ret
,
const
ScriptError
serror
) {
102
if
(
ret
) {
103
*
ret
=
serror
;
104
}
105
return
false
;
106
}
107
108
}
// namespace
109
110
#endif
// BITCOIN_SCRIPT_SCRIPT_ERROR_H
error
bool error(const char *fmt, const Args &...args)
Definition
logging.h:226
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
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
ScriptErrorString
std::string ScriptErrorString(const ScriptError error)
Definition
script_error.cpp:10
Generated on Sat Nov 23 2024 02:38:00 for Bitcoin ABC by
1.9.8