LCOV - code coverage report
Current view: top level - src/script - script_error.cpp (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 29 31 93.5 %
Date: 2015-10-12 22:39:14 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.11