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

tari-project / tari / 23151768217
62%

Build:
DEFAULT BRANCH: development
Ran 16 Mar 2026 04:26PM UTC
Jobs 1
Files 701
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Mar 2026 03:31PM UTC coverage: 61.722% (+0.03%) from 61.696%
23151768217

push

github

web-flow
fix: import-paper-wallet when base-dir is absolute (#7720)

When wallet paths are already absolute (set during initialization via
`set_base_path`), creating a temp wallet for `import-paper-wallet`
silently reused the original wallet's database instead of an isolated
temp one.

## Root Cause

`WalletConfig::set_base_path` is a no-op for already-absolute paths:

```rust
pub fn set_base_path<P: AsRef<Path>>(&mut self, base_path: P) {
    if !self.data_dir.is_absolute() {  // skipped if already absolute
        self.data_dir = base_path.as_ref().join(self.data_dir.as_path());
    }
    // ...
}
```

So `new_config.set_base_path(temp_path.clone())` did nothing when
`base-dir` was absolute, causing the temp wallet to open the same DB as
the running wallet.

## Fix

Replace the `set_base_path` call with direct path assignments in the
`ImportPaperWallet` handler:

```rust
let mut new_config = config.clone();
// set_base_path is a no-op for already-absolute paths; assign directly
new_config.data_dir = temp_path.clone();
new_config.config_dir = temp_path.join("config");
new_config.db_file = temp_path.join("console_wallet.db");
```

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>import-wallet only works when base-dir is
relative.</issue_title>
> <issue_description>**Describe the bug**
> You can use the `import-paper-wallet` command to sweep funds from a
wallet into your current wallet.
> It does this by creating a temporary wallet using (almost) the same
Config as your original wallet.
> 
> I say _almost_, because the `data_dir` and `db_file` entries get
"absolutised" somewhere during wallet initialisation.
> 
> But the temp wallet creation process assumes that paths are relative,
based on
> 
> `new_config.set_base_path(temp_path.clone());`
> 
> and 
> 
> ```rust
>     pub fn set_base_path<P: AsRef<Path>>(&mut self, base_path... (continued)

70610 of 114400 relevant lines covered (61.72%)

227141.15 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
2
81.36
-3.39% comms/core/src/pipeline/outbound.rs
3
86.7
-0.38% comms/dht/src/actor.rs
3
62.89
-0.21% comms/dht/src/connectivity/mod.rs
6
0.0
0.0% base_layer/transaction_components/src/rpc/models/sync_utxos_by_block.rs
6
92.14
-1.27% comms/dht/src/outbound/broadcast.rs
11
0.0
0.0% base_layer/wallet/src/transaction_service/config.rs
50
89.85
0.04% base_layer/core/src/proof_of_work/monero_rx/helpers.rs
65
60.66
0.57% base_layer/core/src/base_node/rpc/query_service.rs
235
0.0
0.0% base_layer/wallet/src/transaction_service/handle.rs
717
0.0
0.0% base_layer/wallet/src/transaction_service/service.rs
Jobs
ID Job ID Ran Files Coverage
1 23151768217.1 16 Mar 2026 04:26PM UTC 701
61.72
GitHub Action Run
Source Files on build 23151768217
  • Tree
  • List 701
  • Changed 16
  • Source Changed 6
  • Coverage Changed 16
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23151768217
  • 394e22d2 on github
  • Prev Build on development (#23135652592)
  • Next Build on development (#23184374285)
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