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

tari-project / tari / 17212794510

25 Aug 2025 03:08PM UTC coverage: 60.274% (+0.03%) from 60.24%
17212794510

push

github

web-flow
chore: new release v5.0.0-pre.7 (#7442)

Description
---
new release

71314 of 118316 relevant lines covered (60.27%)

230312.47 hits per line

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

0.0
/base_layer/transaction_components/src/validation/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
use tari_utilities::ByteArrayError;
23
use thiserror::Error;
24

25
use crate::{
26
    tari_amount::MicroMinotari,
27
    transaction_components::{covenants::CovenantError, OutputType, RangeProofType, TransactionError},
28
};
29

30
#[derive(Debug, Error)]
31
pub enum AggregatedBodyValidationError {
32
    #[error("Serialization failed: {0}")]
33
    SerializationError(String),
34
    #[error("Contains kernels or inputs that are not yet spendable")]
35
    MaturityError,
36
    #[error("The block weight ({actual_weight}) is above the maximum ({max_weight})")]
37
    BlockTooLarge { actual_weight: u64, max_weight: u64 },
38
    #[error("The transaction is invalid: {0}")]
39
    TransactionError(#[from] TransactionError),
40
    #[error(
41
        "The total expected supply plus the total accumulated (offset) excess does not equal the sum of all UTXO \
42
         commitments."
43
    )]
44
    InvalidAccountingBalance,
45
    #[error("Duplicate or unsorted input found in block body")]
46
    UnsortedOrDuplicateInput,
47
    #[error("Duplicate or unsorted output found in block body")]
48
    UnsortedOrDuplicateOutput,
49
    #[error("Duplicate or unsorted kernel found in block body")]
50
    UnsortedOrDuplicateKernel,
51
    #[error(
52
        "Script exceeded maximum script size, expected less than {max_script_size} but was
53
    {actual_script_size}"
54
    )]
55
    TariScriptExceedsMaxSize {
56
        max_script_size: usize,
57
        actual_script_size: usize,
58
    },
59
    #[error(
60
        "Encrypted data exceeded maximum encrytped data size, expected less than {max_encrypted_data_size} but was \
61
         {actual_encrypted_data_size}"
62
    )]
63
    EncryptedDataExceedsMaxSize {
64
        max_encrypted_data_size: usize,
65
        actual_encrypted_data_size: usize,
66
    },
67
    #[error("Consensus Error: {0}")]
68
    ConsensusError(String),
69
    #[error("Covenant failed to validate: {0}")]
70
    CovenantError(#[from] CovenantError),
71
    #[error("Contains Invalid Burn: {0}")]
72
    InvalidBurnError(String),
73
    #[error("Output type '{output_type}' is not permitted")]
74
    OutputTypeNotPermitted { output_type: OutputType },
75
    #[error("Range proof type '{range_proof_type}' is not permitted")]
76
    RangeProofTypeNotPermitted { range_proof_type: RangeProofType },
77
    #[error("Output type '{output_type}' is not matched to any range proof type")]
78
    OutputTypeNotMatchedToRangeProofType { output_type: OutputType },
79
    #[error("Validator registration has invalid minimum amount {actual}, must be at least {min}")]
80
    ValidatorNodeRegistrationMinDepositAmount { min: MicroMinotari, actual: MicroMinotari },
81
    #[error("Validator registration has invalid maturity {actual}, must be at least {min}")]
82
    ValidatorNodeRegistrationMinLockHeight { min: u64, actual: u64 },
83
    #[error("Author signature not valid for template registration")]
84
    TemplateAuthorSignatureNotValid,
85
    #[error("Validator node registration signature failed verification")]
86
    InvalidValidatorNodeSignature,
87
    #[error("Sidechain ID knowledge proof not valid for validator node registration")]
88
    ValidatorNodeInvalidSidechainIdKnowledgeProof,
89
    #[error("Covenant too large. Max size: {max_size}, Actual size: {actual_size}")]
90
    CovenantTooLarge { max_size: usize, actual_size: usize },
91
    #[error("Invalid Serialized Public key: {0}")]
92
    InvalidSerializedPublicKey(String),
93
}
94

95
impl From<ByteArrayError> for AggregatedBodyValidationError {
96
    fn from(err: ByteArrayError) -> Self {
×
97
        Self::InvalidSerializedPublicKey(err.to_string())
×
98
    }
×
99
}
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