LCOV - code coverage report
Current view: top level - src/util - error.cpp (source / functions) Hit Total Coverage
Test: fuzz_coverage.info Lines: 0 30 0.0 %
Date: 2023-11-12 01:39:15 Functions: 0 5 0.0 %
Branches: 0 79 0.0 %

           Branch data     Line data    Source code
       1                 :            : // Copyright (c) 2010-2022 The Bitcoin Core developers
       2                 :            : // Distributed under the MIT software license, see the accompanying
       3                 :            : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4                 :            : 
       5                 :            : #include <util/error.h>
       6                 :            : 
       7                 :            : #include <tinyformat.h>
       8                 :            : #include <util/translation.h>
       9                 :            : 
      10                 :            : #include <cassert>
      11                 :            : #include <string>
      12                 :            : 
      13                 :          0 : bilingual_str TransactionErrorString(const TransactionError err)
      14                 :            : {
      15   [ #  #  #  #  :          0 :     switch (err) {
          #  #  #  #  #  
          #  #  #  #  #  
                      # ]
      16                 :            :         case TransactionError::OK:
      17 [ #  # ][ #  # ]:          0 :             return Untranslated("No error");
      18                 :            :         case TransactionError::MISSING_INPUTS:
      19 [ #  # ][ #  # ]:          0 :             return Untranslated("Inputs missing or spent");
      20                 :            :         case TransactionError::ALREADY_IN_CHAIN:
      21 [ #  # ][ #  # ]:          0 :             return Untranslated("Transaction already in block chain");
      22                 :            :         case TransactionError::P2P_DISABLED:
      23 [ #  # ][ #  # ]:          0 :             return Untranslated("Peer-to-peer functionality missing or disabled");
      24                 :            :         case TransactionError::MEMPOOL_REJECTED:
      25 [ #  # ][ #  # ]:          0 :             return Untranslated("Transaction rejected by mempool");
      26                 :            :         case TransactionError::MEMPOOL_ERROR:
      27 [ #  # ][ #  # ]:          0 :             return Untranslated("Mempool internal error");
      28                 :            :         case TransactionError::INVALID_PSBT:
      29 [ #  # ][ #  # ]:          0 :             return Untranslated("PSBT is not well-formed");
      30                 :            :         case TransactionError::PSBT_MISMATCH:
      31 [ #  # ][ #  # ]:          0 :             return Untranslated("PSBTs not compatible (different transactions)");
      32                 :            :         case TransactionError::SIGHASH_MISMATCH:
      33 [ #  # ][ #  # ]:          0 :             return Untranslated("Specified sighash value does not match value stored in PSBT");
      34                 :            :         case TransactionError::MAX_FEE_EXCEEDED:
      35 [ #  # ][ #  # ]:          0 :             return Untranslated("Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)");
      36                 :            :         case TransactionError::MAX_BURN_EXCEEDED:
      37 [ #  # ][ #  # ]:          0 :             return Untranslated("Unspendable output exceeds maximum configured by user (maxburnamount)");
      38                 :            :         case TransactionError::EXTERNAL_SIGNER_NOT_FOUND:
      39 [ #  # ][ #  # ]:          0 :             return Untranslated("External signer not found");
      40                 :            :         case TransactionError::EXTERNAL_SIGNER_FAILED:
      41 [ #  # ][ #  # ]:          0 :             return Untranslated("External signer failed to sign");
      42                 :            :         case TransactionError::INVALID_PACKAGE:
      43 [ #  # ][ #  # ]:          0 :             return Untranslated("Transaction rejected due to invalid package");
      44                 :            :         // no default case, so the compiler can warn about missing cases
      45                 :            :     }
      46                 :          0 :     assert(false);
      47                 :          0 : }
      48                 :            : 
      49                 :          0 : bilingual_str ResolveErrMsg(const std::string& optname, const std::string& strBind)
      50                 :            : {
      51         [ #  # ]:          0 :     return strprintf(_("Cannot resolve -%s address: '%s'"), optname, strBind);
      52                 :          0 : }
      53                 :            : 
      54                 :          0 : bilingual_str InvalidPortErrMsg(const std::string& optname, const std::string& invalid_value)
      55                 :            : {
      56         [ #  # ]:          0 :     return strprintf(_("Invalid port specified in %s: '%s'"), optname, invalid_value);
      57                 :          0 : }
      58                 :            : 
      59                 :          0 : bilingual_str AmountHighWarn(const std::string& optname)
      60                 :            : {
      61         [ #  # ]:          0 :     return strprintf(_("%s is set very high!"), optname);
      62                 :          0 : }
      63                 :            : 
      64                 :          0 : bilingual_str AmountErrMsg(const std::string& optname, const std::string& strValue)
      65                 :            : {
      66         [ #  # ]:          0 :     return strprintf(_("Invalid amount for -%s=<amount>: '%s'"), optname, strValue);
      67                 :          0 : }

Generated by: LCOV version 1.14