LCOV - code coverage report
Current view: top level - src/script - script_error.cpp (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 22 66 33.3 %
Date: 2025-02-23 09:33:43 Functions: 1 1 100.0 %

          Line data    Source code
       1             : // Copyright (c) 2009-2010 Satoshi Nakamoto
       2             : // Copyright (c) 2009-2014 The Bitcoin developers
       3             : // Copyright (c) 2018-2020 The PIVX Core developers
       4             : // Distributed under the MIT software license, see the accompanying
       5             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       6             : 
       7             : #include "script_error.h"
       8             : 
       9       67690 : const char* ScriptErrorString(const ScriptError serror)
      10             : {
      11       67690 :     switch (serror)
      12             :     {
      13             :         case SCRIPT_ERR_OK:
      14             :             return "No error";
      15          29 :         case SCRIPT_ERR_EVAL_FALSE:
      16          29 :             return "Script evaluated without error but finished with a false/empty top stack element";
      17           1 :         case SCRIPT_ERR_VERIFY:
      18           1 :             return "Script failed an OP_VERIFY operation";
      19           1 :         case SCRIPT_ERR_EQUALVERIFY:
      20           1 :             return "Script failed an OP_EQUALVERIFY operation";
      21           0 :         case SCRIPT_ERR_EXCHANGEADDRVERIFY:
      22           0 :             return "Script failed OP_EXCHANGEADDR operation";
      23          14 :         case SCRIPT_ERR_CHECKCOLDSTAKEVERIFY:
      24          14 :             return "Script failed an OP_CHECKCOLDSTAKEVERIFY operation";
      25           0 :         case SCRIPT_ERR_CHECKMULTISIGVERIFY:
      26           0 :             return "Script failed an OP_CHECKMULTISIGVERIFY operation";
      27          22 :         case SCRIPT_ERR_CHECKSIGVERIFY:
      28          22 :             return "Script failed an OP_CHECKSIGVERIFY operation";
      29           0 :         case SCRIPT_ERR_NUMEQUALVERIFY:
      30           0 :             return "Script failed an OP_NUMEQUALVERIFY operation";
      31           0 :         case SCRIPT_ERR_SCRIPT_SIZE:
      32           0 :             return "Script is too big";
      33           0 :         case SCRIPT_ERR_PUSH_SIZE:
      34           0 :             return "Push value size limit exceeded";
      35           0 :         case SCRIPT_ERR_OP_COUNT:
      36           0 :             return "Operation limit exceeded";
      37           0 :         case SCRIPT_ERR_STACK_SIZE:
      38           0 :             return "Stack size limit exceeded";
      39           0 :         case SCRIPT_ERR_SIG_COUNT:
      40           0 :             return "Signature count negative or greater than pubkey count";
      41           0 :         case SCRIPT_ERR_PUBKEY_COUNT:
      42           0 :             return "Pubkey count negative or limit exceeded";
      43           2 :         case SCRIPT_ERR_BAD_OPCODE:
      44           2 :             return "Opcode missing or not understood";
      45           0 :         case SCRIPT_ERR_DISABLED_OPCODE:
      46           0 :             return "Attempted to use a disabled opcode";
      47          13 :         case SCRIPT_ERR_INVALID_STACK_OPERATION:
      48          13 :             return "Operation not valid with the current stack size";
      49           0 :         case SCRIPT_ERR_INVALID_ALTSTACK_OPERATION:
      50           0 :             return "Operation not valid with the current altstack size";
      51           0 :         case SCRIPT_ERR_OP_RETURN:
      52           0 :             return "OP_RETURN was encountered";
      53           8 :         case SCRIPT_ERR_UNBALANCED_CONDITIONAL:
      54           8 :             return "Invalid OP_IF construction";
      55           0 :         case SCRIPT_ERR_NEGATIVE_LOCKTIME:
      56           0 :             return "Negative locktime";
      57           0 :         case SCRIPT_ERR_UNSATISFIED_LOCKTIME:
      58           0 :             return "Locktime requirement not satisfied";
      59           0 :         case SCRIPT_ERR_SIG_HASHTYPE:
      60           0 :             return "Signature hash type missing or not understood";
      61           1 :         case SCRIPT_ERR_SIG_DER:
      62           1 :             return "Non-canonical DER signature";
      63           0 :         case SCRIPT_ERR_MINIMALDATA:
      64           0 :             return "Data push larger than necessary";
      65           0 :         case SCRIPT_ERR_SIG_PUSHONLY:
      66           0 :             return "Only non-push operators allowed in signatures";
      67           0 :         case SCRIPT_ERR_SIG_HIGH_S:
      68           0 :             return "Non-canonical signature: S value is unnecessarily high";
      69           3 :         case SCRIPT_ERR_SIG_NULLDUMMY:
      70           3 :             return "Dummy CHECKMULTISIG argument must be zero";
      71           0 :         case SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS:
      72           0 :             return "NOPx reserved for soft-fork upgrades";
      73           0 :         case SCRIPT_ERR_PUBKEYTYPE:
      74           0 :             return "Public key is neither compressed or uncompressed";
      75           0 :         case SCRIPT_ERR_UNKNOWN_ERROR:
      76           0 :         case SCRIPT_ERR_ERROR_COUNT:
      77           0 :         default: break;
      78             :     }
      79           0 :     return "unknown error";
      80             : }

Generated by: LCOV version 1.14