| 6 | #include <script/script_error.h> |
| 7 | |
| 8 | const char *ScriptErrorString(const ScriptError serror) { |
| 9 | switch (serror) { |
| 10 | case SCRIPT_ERR_OK: |
| 11 | return "No error"; |
| 12 | case SCRIPT_ERR_EVAL_FALSE: |
| 13 | return "Script evaluated without error but finished with a false/empty top stack element"; |
| 14 | case SCRIPT_ERR_VERIFY: |
| 15 | return "Script failed an OP_VERIFY operation"; |
| 16 | case SCRIPT_ERR_EQUALVERIFY: |
| 17 | return "Script failed an OP_EQUALVERIFY operation"; |
| 18 | case SCRIPT_ERR_CHECKMULTISIGVERIFY: |
| 19 | return "Script failed an OP_CHECKMULTISIGVERIFY operation"; |
| 20 | case SCRIPT_ERR_CHECKSIGVERIFY: |
| 21 | return "Script failed an OP_CHECKSIGVERIFY operation"; |
| 22 | case SCRIPT_ERR_CHECKDATASIGVERIFY: |
| 23 | return "Script failed an OP_CHECKDATASIGVERIFY operation"; |
| 24 | case SCRIPT_ERR_NUMEQUALVERIFY: |
| 25 | return "Script failed an OP_NUMEQUALVERIFY operation"; |
| 26 | case SCRIPT_ERR_SCRIPT_SIZE: |
| 27 | return "Script is too big"; |
| 28 | case SCRIPT_ERR_PUSH_SIZE: |
| 29 | return "Push value size limit exceeded"; |
| 30 | case SCRIPT_ERR_OP_COUNT: |
| 31 | return "Operation limit exceeded"; |
| 32 | case SCRIPT_ERR_STACK_SIZE: |
| 33 | return "Stack size limit exceeded"; |
| 34 | case SCRIPT_ERR_SIG_COUNT: |
| 35 | return "Signature count negative or greater than pubkey count"; |
| 36 | case SCRIPT_ERR_PUBKEY_COUNT: |
| 37 | return "Pubkey count negative or limit exceeded"; |
| 38 | case SCRIPT_ERR_BAD_OPCODE: |
| 39 | return "Opcode missing or not understood"; |
| 40 | case SCRIPT_ERR_DISABLED_OPCODE: |
| 41 | return "Attempted to use a disabled opcode"; |
| 42 | case SCRIPT_ERR_INVALID_STACK_OPERATION: |
| 43 | return "Operation not valid with the current stack size"; |
| 44 | case SCRIPT_ERR_INVALID_ALTSTACK_OPERATION: |
| 45 | return "Operation not valid with the current altstack size"; |
| 46 | case SCRIPT_ERR_OP_RETURN: |
| 47 | return "OP_RETURN was encountered"; |
| 48 | case SCRIPT_ERR_UNBALANCED_CONDITIONAL: |
| 49 | return "Invalid OP_IF construction"; |
| 50 | case SCRIPT_ERR_INVALID_SPLIT_RANGE: |
| 51 | return "Invalid OP_SPLIT range"; |
| 52 | case SCRIPT_ERR_INVALID_OPERAND_SIZE: |
| 53 | return "Invalid operand size"; |
| 54 | case SCRIPT_ERR_INVALID_NUMBER_RANGE: |
| 55 | return "Given operand is not a number within the valid range " |
| 56 | "[-2^31...2^31]"; |
| 57 | case SCRIPT_ERR_IMPOSSIBLE_ENCODING: |
| 58 | return "The requested encoding is impossible to satisfy"; |
| 59 | case SCRIPT_ERR_DIV_BY_ZERO: |
| 60 | return "Division by zero error"; |
| 61 | case SCRIPT_ERR_MOD_BY_ZERO: |
| 62 | return "Modulo by zero error"; |
| 63 | case SCRIPT_ERR_NEGATIVE_LOCKTIME: |
| 64 | return "Negative locktime"; |
| 65 | case SCRIPT_ERR_UNSATISFIED_LOCKTIME: |
no outgoing calls