• 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

86.36
/common_sqlite/src/connection_options.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
use core::time::Duration;
24

25
use diesel::{connection::SimpleConnection, SqliteConnection};
26

27
#[derive(Debug, Clone)]
28
pub struct ConnectionOptions {
29
    enable_wal: bool,
30
    enable_foreign_keys: bool,
31
    busy_timeout: Option<Duration>,
32
}
33

34
impl ConnectionOptions {
35
    pub fn new(enable_wal: bool, enable_foreign_keys: bool, busy_timeout: Duration) -> Self {
413✔
36
        Self {
413✔
37
            enable_wal,
413✔
38
            enable_foreign_keys,
413✔
39
            busy_timeout: Some(busy_timeout),
413✔
40
        }
413✔
41
    }
413✔
42
}
43

44
impl diesel::r2d2::CustomizeConnection<SqliteConnection, diesel::r2d2::Error> for ConnectionOptions {
45
    fn on_acquire(&self, conn: &mut SqliteConnection) -> Result<(), diesel::r2d2::Error> {
3,723✔
46
        (|| {
3,723✔
47
            if let Some(d) = self.busy_timeout {
3,723✔
48
                conn.batch_execute(&format!("PRAGMA busy_timeout = {};", d.as_millis()))?;
3,723✔
49
            }
×
50
            if self.enable_wal {
3,723✔
51
                conn.batch_execute("PRAGMA journal_mode = WAL; PRAGMA synchronous = NORMAL;")?;
3,723✔
UNCOV
52
            }
×
53
            if self.enable_foreign_keys {
3,624✔
54
                conn.batch_execute("PRAGMA foreign_keys = ON;")?;
3,624✔
55
            }
×
56
            Ok(())
3,624✔
57
        })()
3,723✔
58
        .map_err(diesel::r2d2::Error::QueryError)
3,723✔
59
    }
3,723✔
60
}
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