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

tari-project / tari / 16123384529

07 Jul 2025 05:11PM UTC coverage: 64.327% (-7.6%) from 71.89%
16123384529

push

github

web-flow
chore: new release v4.9.0-pre.0 (#7289)

Description
---
new release esmeralda

77151 of 119935 relevant lines covered (64.33%)

227108.34 hits per line

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

89.29
/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 log::*;
31
use tari_service_framework::{
32
    async_trait,
33
    reply_channel,
34
    ServiceInitializationError,
35
    ServiceInitializer,
36
    ServiceInitializerContext,
37
};
38
use tokio::sync::broadcast;
39

40
use crate::{
41
    base_node_service::{handle::BaseNodeServiceHandle, service::BaseNodeService},
42
    client::http_client_factory::DefaultHttpClientFactory,
43
    connectivity_service::WalletConnectivityHandle,
44
};
45
const BASENODE_SERVICE_HANDLE_CHANNEL_SIZE: usize = 1_000;
46
const LOG_TARGET: &str = "wallet::base_node_service";
47

48
#[derive(Default)]
49
pub struct BaseNodeServiceInitializer {}
50

51
#[async_trait]
52
impl ServiceInitializer for BaseNodeServiceInitializer {
53
    async fn initialize(&mut self, context: ServiceInitializerContext) -> Result<(), ServiceInitializationError> {
21✔
54
        info!(target: LOG_TARGET, "Wallet base node service initializing.");
21✔
55

56
        let (sender, request_stream) = reply_channel::unbounded();
21✔
57

21✔
58
        let (event_publisher, _) = broadcast::channel(BASENODE_SERVICE_HANDLE_CHANNEL_SIZE);
21✔
59

21✔
60
        let basenode_service_handle = BaseNodeServiceHandle::new(sender, event_publisher.clone());
21✔
61

21✔
62
        // Register handle before waiting for handles to be ready
21✔
63
        context.register_handle(basenode_service_handle);
21✔
64

21✔
65
        context.spawn_when_ready(move |handles| async move {
21✔
66
            let wallet_connectivity = handles.expect_handle::<WalletConnectivityHandle<DefaultHttpClientFactory>>();
20✔
67

68
            let result = BaseNodeService::new(
20✔
69
                request_stream,
20✔
70
                wallet_connectivity,
20✔
71
                event_publisher,
20✔
72
                handles.get_shutdown_signal(),
20✔
73
            )
20✔
74
            .start()
20✔
75
            .await;
20✔
76

77
            info!(
×
78
                target: LOG_TARGET,
×
79
                "Wallet Base Node Service shutdown with result {:?}", result
×
80
            );
81
        });
21✔
82

21✔
83
        Ok(())
21✔
84
    }
42✔
85
}
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