• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tari-project / tari / 16990089413

15 Aug 2025 12:36PM UTC coverage: 54.497% (+0.06%) from 54.441%
16990089413

push

github

web-flow
chore: cleanup indexes (#7411)

Description
---
Forces clean indexs

970 of 2919 new or added lines in 369 files covered. (33.23%)

60 existing lines in 33 files now uncovered.

76698 of 140739 relevant lines covered (54.5%)

193749.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/base_layer/core/src/mempool/unconfirmed_pool/error.rs
1
//  Copyright 2019 The Tari Project
2
//
3
//  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
4
//  following conditions are met:
5
//
6
//  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
7
//  disclaimer.
8
//
9
//  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
10
//  following disclaimer in the documentation and/or other materials provided with the distribution.
11
//
12
//  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
13
//  products derived from this software without specific prior written permission.
14
//
15
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
16
//  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
//  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18
//  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
//  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20
//  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21
//  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22

23
use thiserror::Error;
24

25
use crate::{
26
    common::{BanPeriod, BanReason},
27
    transactions::transaction_components::TransactionError,
28
};
29

30
#[derive(Debug, Error)]
31
pub enum UnconfirmedPoolError {
32
    #[error("The HashMap and BTreeMap are out of sync")]
33
    StorageOutofSync,
34
    #[error("Mempool encountered an internal error: {0}")]
35
    InternalError(String),
36
    #[error("Transaction has no kernels")]
37
    TransactionNoKernels,
38
    #[error("Transaction error: `{0}`")]
39
    TransactionError(#[from] TransactionError),
40
}
41
impl UnconfirmedPoolError {
42
    pub fn get_ban_reason(&self) -> Option<BanReason> {
×
43
        match self {
×
44
            UnconfirmedPoolError::StorageOutofSync | UnconfirmedPoolError::InternalError(_) => None,
×
45
            err @ UnconfirmedPoolError::TransactionNoKernels => Some(BanReason {
×
46
                reason: err.to_string(),
×
47
                ban_duration: BanPeriod::Long,
×
48
            }),
×
49
            err @ UnconfirmedPoolError::TransactionError(_) => Some(BanReason {
×
NEW
50
                reason: format!("Invalid transaction: {err}"),
×
51
                ban_duration: BanPeriod::Long,
×
52
            }),
×
53
        }
54
    }
×
55
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc