From f4243128eeaad039cf0e70347935acf6c61789c7 Mon Sep 17 00:00:00 2001 From: Christian Lewe Date: Fri, 10 Nov 2023 15:50:24 +0100 Subject: [PATCH] Script: Move SCRIPT_ERR_COUNT SCRIPT_ERR_COUNT is a pseudo error that returns the number of errors. It must always be last in the enum. --- src/script/script_error.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/script/script_error.h b/src/script/script_error.h index 1e9862454e..712ed07e35 100644 --- a/src/script/script_error.h +++ b/src/script/script_error.h @@ -82,8 +82,6 @@ typedef enum ScriptError_t SCRIPT_ERR_OP_CODESEPARATOR, SCRIPT_ERR_SIG_FINDANDDELETE, - SCRIPT_ERR_ERROR_COUNT, - // ELEMENTS: SCRIPT_ERR_RANGEPROOF, SCRIPT_ERR_PEDERSEN_TALLY, @@ -96,10 +94,13 @@ typedef enum ScriptError_t SCRIPT_ERR_INTROSPECT_INDEX_OUT_OF_BOUNDS, SCRIPT_ERR_EXPECTED_8BYTES, SCRIPT_ERR_ARITHMETIC64, - SCRIPT_ERR_ECMULTVERIFYFAIL + SCRIPT_ERR_ECMULTVERIFYFAIL, + + /* Must go last */ + SCRIPT_ERR_ERROR_COUNT } ScriptError; -#define SCRIPT_ERR_LAST SCRIPT_ERR_ECMULTVERIFYFAIL +#define SCRIPT_ERR_LAST SCRIPT_ERR_ERROR_COUNT std::string ScriptErrorString(const ScriptError error);