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

tari-project / tari / 19920181775

04 Dec 2025 06:43AM UTC coverage: 60.517% (-0.3%) from 60.819%
19920181775

push

github

web-flow
feat: improve scanning feedback (#7622)

Description
---
Improve the scanning feddback

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

## Summary by CodeRabbit

* **Chores**
* Enhanced state inspection and logging for UTXO processing in wallet
server operations, including mined and deletion status tracking.
* Added Display formatting for transaction types to support improved
debugging and logging output.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

0 of 26 new or added lines in 1 file covered. (0.0%)

532 existing lines in 21 files now uncovered.

70369 of 116280 relevant lines covered (60.52%)

299331.58 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/mod.rs
1
// Copyright 2025 The Tari Project
2
// SPDX-License-Identifier: BSD-3-Clause
3

4
mod service;
5

6
pub mod sync_utxos_by_block_task;
7

8
pub use service::BaseNodeWalletRpcService;
9

10
pub mod query_service;
11

12
use std::{error::Error, fmt::Debug};
13

14
use tari_comms::{
15
    protocol::rpc::{Request, Response, RpcStatus, Streaming},
16
    types::CompressedSignature,
17
};
18
use tari_comms_rpc_macros::tari_rpc;
19
use tari_transaction_components::{
20
    rpc::{models, models::GenerateKernelMerkleProofResponse},
21
    transaction_components::TransactionOutput,
22
};
23
use url::Url;
24

25
use crate::{
26
    base_node::StateMachineHandle,
27
    chain_storage::{async_db::AsyncBlockchainDb, BlockchainBackend},
28
    mempool::service::MempoolHandle,
29
    proto::{
30
        self,
31
        base_node::{
32
            FetchMatchingUtxos,
33
            FetchUtxosResponse,
34
            GetMempoolFeePerGramStatsRequest,
35
            GetMempoolFeePerGramStatsResponse,
36
            GetWalletQueryHttpServiceAddressResponse,
37
            QueryDeletedRequest,
38
            QueryDeletedResponse,
39
            Signatures,
40
            SyncUtxosByBlockRequest,
41
            SyncUtxosByBlockResponse,
42
            TipInfoResponse,
43
            TxQueryBatchResponses,
44
            TxQueryResponse,
45
            TxSubmissionResponse,
46
            UtxoQueryRequest,
47
            UtxoQueryResponses,
48
        },
49
        types::{Signature, Transaction},
50
    },
51
};
52

53
/// Trait that a base node wallet query service must implement.
54
/// Please note that this service is to fetch data, so read-only queries.
55
#[async_trait::async_trait]
56
pub trait BaseNodeWalletQueryService: Send + Sync + 'static {
57
    type Error: Error + 'static;
58

59
    async fn get_tip_info(&self) -> Result<models::TipInfoResponse, Self::Error>;
60

61
    async fn get_header_by_height(&self, height: u64) -> Result<models::BlockHeader, Self::Error>;
62

63
    async fn get_height_at_time(&self, epoch_time: u64) -> Result<u64, Self::Error>;
64

65
    async fn get_utxos_mined_info(
66
        &self,
67
        request: models::GetUtxosMinedInfoRequest,
68
    ) -> Result<models::GetUtxosMinedInfoResponse, Self::Error>;
69

70
    async fn get_utxos_by_block(
71
        &self,
72
        request: models::GetUtxosByBlockRequest,
73
    ) -> Result<models::GetUtxosByBlockResponse, Self::Error>;
74

75
    async fn transaction_query(&self, signature: models::Signature) -> Result<models::TxQueryResponse, Self::Error>;
76

77
    async fn sync_utxos_by_block_v0(
78
        &self,
79
        request: models::SyncUtxosByBlockRequest,
80
    ) -> Result<models::SyncUtxosByBlockResponseV0, Self::Error>;
81

82
    async fn sync_utxos_by_block_v1(
83
        &self,
84
        request: models::SyncUtxosByBlockRequest,
85
    ) -> Result<models::SyncUtxosByBlockResponseV1, Self::Error>;
86

87
    async fn get_utxos_deleted_info(
88
        &self,
89
        request: models::GetUtxosDeletedInfoRequest,
90
    ) -> Result<models::GetUtxosDeletedInfoResponse, Self::Error>;
91

92
    async fn generate_kernel_merkle_proof(
93
        &self,
94
        excess_sig: CompressedSignature,
95
    ) -> Result<GenerateKernelMerkleProofResponse, Self::Error>;
96

97
    async fn get_utxo(&self, request: models::GetUtxoRequest) -> Result<Option<TransactionOutput>, Self::Error>;
98
}
99

UNCOV
100
#[tari_rpc(protocol_name = b"t/bnwallet/1", server_struct = BaseNodeWalletRpcServer, client_struct = BaseNodeWalletRpcClient)]
×
101
pub trait BaseNodeWalletService: Send + Sync + 'static {
102
    #[rpc(method = 1)]
103
    async fn submit_transaction(
104
        &self,
105
        request: Request<Transaction>,
106
    ) -> Result<Response<TxSubmissionResponse>, RpcStatus>;
107

108
    #[rpc(method = 2)]
109
    async fn transaction_query(&self, request: Request<Signature>) -> Result<Response<TxQueryResponse>, RpcStatus>;
110

111
    #[rpc(method = 3)]
112
    async fn transaction_batch_query(
113
        &self,
114
        request: Request<Signatures>,
115
    ) -> Result<Response<TxQueryBatchResponses>, RpcStatus>;
116

117
    #[rpc(method = 4)]
118
    async fn fetch_matching_utxos(
119
        &self,
120
        request: Request<FetchMatchingUtxos>,
121
    ) -> Result<Response<FetchUtxosResponse>, RpcStatus>;
122

123
    #[rpc(method = 5)]
124
    async fn get_tip_info(&self, request: Request<()>) -> Result<Response<TipInfoResponse>, RpcStatus>;
125

126
    #[rpc(method = 6)]
127
    async fn get_header(&self, request: Request<u64>) -> Result<Response<proto::core::BlockHeader>, RpcStatus>;
128

129
    #[rpc(method = 7)]
130
    async fn utxo_query(&self, request: Request<UtxoQueryRequest>) -> Result<Response<UtxoQueryResponses>, RpcStatus>;
131

132
    #[rpc(method = 8)]
133
    async fn query_deleted(
134
        &self,
135
        request: Request<QueryDeletedRequest>,
136
    ) -> Result<Response<QueryDeletedResponse>, RpcStatus>;
137

138
    #[rpc(method = 9)]
139
    async fn get_header_by_height(
140
        &self,
141
        request: Request<u64>,
142
    ) -> Result<Response<proto::core::BlockHeader>, RpcStatus>;
143

144
    #[rpc(method = 10)]
145
    async fn get_height_at_time(&self, request: Request<u64>) -> Result<Response<u64>, RpcStatus>;
146

147
    #[rpc(method = 11)]
148
    async fn sync_utxos_by_block(
149
        &self,
150
        request: Request<SyncUtxosByBlockRequest>,
151
    ) -> Result<Streaming<SyncUtxosByBlockResponse>, RpcStatus>;
152

153
    #[rpc(method = 12)]
154
    async fn get_mempool_fee_per_gram_stats(
155
        &self,
156
        request: Request<GetMempoolFeePerGramStatsRequest>,
157
    ) -> Result<Response<GetMempoolFeePerGramStatsResponse>, RpcStatus>;
158

159
    #[rpc(method = 13)]
160
    async fn get_wallet_query_http_service_address(
161
        &self,
162
        request: Request<()>,
163
    ) -> Result<Response<GetWalletQueryHttpServiceAddressResponse>, RpcStatus>;
164
}
165

166
pub fn create_base_node_wallet_rpc_service<B: BlockchainBackend + 'static>(
×
167
    db: AsyncBlockchainDb<B>,
×
168
    mempool: MempoolHandle,
×
169
    state_machine: StateMachineHandle,
×
170
    wallet_query_service_address: Option<Url>,
×
171
) -> BaseNodeWalletRpcServer<BaseNodeWalletRpcService<B>> {
×
UNCOV
172
    BaseNodeWalletRpcServer::new(BaseNodeWalletRpcService::new(
×
173
        db,
×
UNCOV
174
        mempool,
×
UNCOV
175
        state_machine,
×
UNCOV
176
        wallet_query_service_address,
×
177
    ))
UNCOV
178
}
×
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