• 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/wallet/src/base_node_service/mod.rs
1
// Copyright 2020. 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
pub mod config;
24
pub mod error;
25
pub mod handle;
26
pub mod service;
27

28
mod monitor;
29

30
use std::marker::PhantomData;
31

32
use log::*;
33
use tari_service_framework::{
34
    async_trait,
35
    reply_channel,
36
    ServiceInitializationError,
37
    ServiceInitializer,
38
    ServiceInitializerContext,
39
};
40
use tokio::sync::broadcast;
41

42
use crate::{
43
    base_node_service::{handle::BaseNodeServiceHandle, service::BaseNodeService},
44
    client::http_client_factory::HttpClientFactory,
45
    connectivity_service::WalletConnectivityHandle,
46
};
47

48
const BASENODE_SERVICE_HANDLE_CHANNEL_SIZE: usize = 1_000;
49
const LOG_TARGET: &str = "wallet::base_node_service";
50

51
pub struct BaseNodeServiceInitializer<T> {
52
    phantom: PhantomData<T>,
53
}
54

55
impl<T> BaseNodeServiceInitializer<T> {
56
    pub fn new() -> Self {
×
57
        Self { phantom: PhantomData }
×
58
    }
×
59
}
60

61
impl<T> Default for BaseNodeServiceInitializer<T> {
62
    fn default() -> Self {
×
63
        Self::new()
×
64
    }
×
65
}
66

67
#[async_trait]
68
impl<T> ServiceInitializer for BaseNodeServiceInitializer<T>
69
where T: HttpClientFactory + Send + Sync + 'static
70
{
71
    async fn initialize(&mut self, context: ServiceInitializerContext) -> Result<(), ServiceInitializationError> {
×
72
        info!(target: LOG_TARGET, "Wallet base node service initializing.");
×
73

74
        let (sender, request_stream) = reply_channel::unbounded();
×
75

×
76
        let (event_publisher, _) = broadcast::channel(BASENODE_SERVICE_HANDLE_CHANNEL_SIZE);
×
77

×
78
        let basenode_service_handle = BaseNodeServiceHandle::new(sender, event_publisher.clone());
×
79

×
80
        // Register handle before waiting for handles to be ready
×
81
        context.register_handle(basenode_service_handle);
×
82

×
83
        context.spawn_when_ready(move |handles| async move {
×
84
            let wallet_connectivity = handles.expect_handle::<WalletConnectivityHandle<T>>();
×
85

86
            let result = BaseNodeService::new(
×
87
                request_stream,
×
88
                wallet_connectivity,
×
89
                event_publisher,
×
90
                handles.get_shutdown_signal(),
×
91
            )
×
92
            .start()
×
93
            .await;
×
94

95
            info!(
×
96
                target: LOG_TARGET,
×
NEW
97
                "Wallet Base Node Service shutdown with result {result:?}"
×
98
            );
99
        });
×
100

×
101
        Ok(())
×
102
    }
×
103
}
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