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

tari-project / tari / 16200110666

10 Jul 2025 04:01PM UTC coverage: 58.097% (-6.2%) from 64.296%
16200110666

push

github

web-flow
chore: fix tests (#7300)

Description
---
removes uncalled tests,
fixes some tests

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added the ability to save the last scanned blockchain height in the
output manager's storage backend.

* **Refactor**
* Generalized wallet service initializers to support custom HTTP client
factories, improving flexibility for connectivity and transaction
services.
* Updated wallet startup and service initialization to use new generic
parameters for HTTP client factories.

* **Bug Fixes**
* Corrected balance assertions in tests to reflect updated time-locked
balance handling.
* Fixed the `submit_transaction` method in the HTTP base node mock to
return a valid response.

* **Tests**
* Removed comprehensive test suites for transaction protocols and UTXO
scanner services.
* Updated and streamlined test setups to match new service initializer
signatures and database usage.
  * Marked a broken transaction service test as ignored.
* Removed unused module declarations and imports in integration and
wallet tests.

* **Chores**
* Removed deprecated FFI function and related wallet methods for adding
base node peers.
* Removed step definitions related to ffi wallet lifecycle and
connectivity management in integration tests.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

0 of 33 new or added lines in 6 files covered. (0.0%)

7429 existing lines in 95 files now uncovered.

69707 of 119984 relevant lines covered (58.1%)

226952.75 hits per line

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

0.0
/base_layer/core/src/base_node/rpc/models/get_header_by_height.rs
1
// Copyright 2025 The Tari Project
2
// SPDX-License-Identifier: BSD-3-Clause
3
use serde::{Deserialize, Serialize};
4
use tari_common_types::types::{BlockHash, FixedHash, PrivateKey};
5
use tari_utilities::epoch_time::EpochTime;
6
use utoipa::{
7
    openapi::{schema::SchemaType, Object, Schema, Type},
8
    ToSchema,
9
};
10

11
use crate::{blocks, proof_of_work::ProofOfWork};
12

13
#[derive(Serialize, Deserialize, ToSchema)]
×
14
pub struct BlockHeader {
15
    /// Hash of the block header
16
    pub hash: BlockHash,
17
    /// Version of the block
18
    pub version: u16,
19
    /// Height of this block since the genesis block (height 0)
20
    pub height: u64,
21
    /// Hash of the block previous to this in the chain.
22
    pub prev_hash: BlockHash,
23
    /// Timestamp at which the block was built.
24
    #[schema(schema_with = epoch_time_schema)]
25
    pub timestamp: EpochTime,
26
    /// This is the Merkle root of the inputs in this block
27
    pub input_mr: FixedHash,
28
    /// This is the UTXO merkle root of the outputs on the blockchain
29
    pub output_mr: FixedHash,
30
    /// This is the block_output_mr
31
    pub block_output_mr: FixedHash,
32
    /// The size (number  of leaves) of the output and range proof MMRs at the time of this header
33
    pub output_smt_size: u64,
34
    /// This is the MMR root of the kernels
35
    pub kernel_mr: FixedHash,
36
    /// The number of MMR leaves in the kernel MMR
37
    pub kernel_mmr_size: u64,
38
    /// Sum of kernel offsets for all kernels in this block.
39
    #[schema(schema_with = private_key_schema)]
40
    pub total_kernel_offset: PrivateKey,
41
    /// Sum of script offsets for all kernels in this block.
42
    #[schema(schema_with = private_key_schema)]
43
    pub total_script_offset: PrivateKey,
44
    /// Merkle root of all active validator node.
45
    pub validator_node_mr: FixedHash,
46
    /// The number of validator node hashes
47
    pub validator_node_size: u64,
48
    /// Proof of work summary
49
    #[schema(schema_with = proof_of_work_schema)]
50
    pub pow: ProofOfWork,
51
    /// Nonce increment used to mine this block.
52
    pub nonce: u64,
53
}
54

55
pub fn epoch_time_schema() -> Schema {
×
56
    Schema::Object(Object::with_type(SchemaType::Type(Type::Integer)))
×
57
}
×
58

59
pub fn private_key_schema() -> Schema {
×
60
    Schema::Object(Object::with_type(SchemaType::Type(Type::Array)))
×
61
}
×
62

63
pub fn proof_of_work_schema() -> Schema {
×
64
    Schema::Object(
×
65
        Object::builder()
×
66
            .property("pow_algo", Schema::Object(Object::with_type(Type::String)))
×
67
            .property("pow_data", Schema::Object(Object::with_type(Type::String)))
×
68
            .build(),
×
69
    )
×
70
}
×
71

72
impl From<BlockHeader> for blocks::BlockHeader {
73
    fn from(header: BlockHeader) -> Self {
×
74
        Self {
×
75
            version: header.version,
×
76
            height: header.height,
×
77
            prev_hash: header.prev_hash,
×
78
            timestamp: header.timestamp,
×
79
            input_mr: header.input_mr,
×
80
            output_mr: header.output_mr,
×
81
            block_output_mr: header.block_output_mr,
×
82
            output_smt_size: header.output_smt_size,
×
83
            kernel_mr: header.kernel_mr,
×
84
            kernel_mmr_size: header.kernel_mmr_size,
×
85
            total_kernel_offset: header.total_kernel_offset,
×
86
            total_script_offset: header.total_script_offset,
×
87
            validator_node_mr: header.validator_node_mr,
×
88
            validator_node_size: header.validator_node_size,
×
89
            pow: header.pow,
×
90
            nonce: header.nonce,
×
91
        }
×
92
    }
×
93
}
94

95
impl From<blocks::BlockHeader> for BlockHeader {
UNCOV
96
    fn from(header: blocks::BlockHeader) -> Self {
×
UNCOV
97
        Self {
×
UNCOV
98
            hash: header.hash(),
×
UNCOV
99
            version: header.version,
×
UNCOV
100
            height: header.height,
×
UNCOV
101
            prev_hash: header.prev_hash,
×
UNCOV
102
            timestamp: header.timestamp,
×
UNCOV
103
            input_mr: header.input_mr,
×
UNCOV
104
            output_mr: header.output_mr,
×
UNCOV
105
            block_output_mr: header.block_output_mr,
×
UNCOV
106
            output_smt_size: header.output_smt_size,
×
UNCOV
107
            kernel_mr: header.kernel_mr,
×
UNCOV
108
            kernel_mmr_size: header.kernel_mmr_size,
×
UNCOV
109
            total_kernel_offset: header.total_kernel_offset,
×
UNCOV
110
            total_script_offset: header.total_script_offset,
×
UNCOV
111
            validator_node_mr: header.validator_node_mr,
×
UNCOV
112
            validator_node_size: header.validator_node_size,
×
UNCOV
113
            pow: header.pow,
×
UNCOV
114
            nonce: header.nonce,
×
UNCOV
115
        }
×
UNCOV
116
    }
×
117
}
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