LCOV - code coverage report
Current view: top level - src/util - error.cpp (source / functions) Hit Total Coverage
Test: coverage.lcov Lines: 15 38 39.5 %
Date: 2022-04-21 14:51:19 Functions: 3 4 75.0 %
Legend: Modified by patch:
Lines: hit not hit | Branches: + taken - not taken # not executed

Not modified by patch:
Lines: hit not hit | Branches: + taken - not taken # not executed
Branches: 16 26 61.5 %

           Branch data     Line data    Source code
#       1                 :            : // Copyright (c) 2010-2021 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/system.h>
#       9                 :            : #include <util/translation.h>
#      10                 :            : 
#      11                 :            : bilingual_str TransactionErrorString(const TransactionError err)
#      12                 :         52 : {
#      13         [ -  + ]:         52 :     switch (err) {
#      14         [ -  + ]:          0 :         case TransactionError::OK:
#      15                 :          0 :             return Untranslated("No error");
#      16         [ +  + ]:          2 :         case TransactionError::MISSING_INPUTS:
#      17                 :          2 :             return Untranslated("Inputs missing or spent");
#      18         [ +  + ]:          8 :         case TransactionError::ALREADY_IN_CHAIN:
#      19                 :          8 :             return Untranslated("Transaction already in block chain");
#      20         [ -  + ]:          0 :         case TransactionError::P2P_DISABLED:
#      21                 :          0 :             return Untranslated("Peer-to-peer functionality missing or disabled");
#      22         [ -  + ]:          0 :         case TransactionError::MEMPOOL_REJECTED:
#      23                 :          0 :             return Untranslated("Transaction rejected by mempool");
#      24         [ -  + ]:          0 :         case TransactionError::MEMPOOL_ERROR:
#      25                 :          0 :             return Untranslated("Mempool internal error");
#      26         [ -  + ]:          0 :         case TransactionError::INVALID_PSBT:
#      27                 :          0 :             return Untranslated("PSBT is not well-formed");
#      28         [ -  + ]:          0 :         case TransactionError::PSBT_MISMATCH:
#      29                 :          0 :             return Untranslated("PSBTs not compatible (different transactions)");
#      30         [ -  + ]:          0 :         case TransactionError::SIGHASH_MISMATCH:
#      31                 :          0 :             return Untranslated("Specified sighash value does not match value stored in PSBT");
#      32         [ +  + ]:         42 :         case TransactionError::MAX_FEE_EXCEEDED:
#      33                 :         42 :             return Untranslated("Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)");
#      34         [ -  + ]:          0 :         case TransactionError::EXTERNAL_SIGNER_NOT_FOUND:
#      35                 :          0 :             return Untranslated("External signer not found");
#      36         [ -  + ]:          0 :         case TransactionError::EXTERNAL_SIGNER_FAILED:
#      37                 :          0 :             return Untranslated("External signer failed to sign");
#      38                 :            :         // no default case, so the compiler can warn about missing cases
#      39                 :         52 :     }
#      40                 :          0 :     assert(false);
#      41                 :          0 : }
#      42                 :            : 
#      43                 :            : bilingual_str ResolveErrMsg(const std::string& optname, const std::string& strBind)
#      44                 :          5 : {
#      45                 :          5 :     return strprintf(_("Cannot resolve -%s address: '%s'"), optname, strBind);
#      46                 :          5 : }
#      47                 :            : 
#      48                 :            : bilingual_str AmountHighWarn(const std::string& optname)
#      49                 :          4 : {
#      50                 :          4 :     return strprintf(_("%s is set very high!"), optname);
#      51                 :          4 : }
#      52                 :            : 
#      53                 :            : bilingual_str AmountErrMsg(const std::string& optname, const std::string& strValue)
#      54                 :          0 : {
#      55                 :          0 :     return strprintf(_("Invalid amount for -%s=<amount>: '%s'"), optname, strValue);
#      56                 :          0 : }

Generated by: LCOV version 0-eol-96201-ge66f56f4af6a