Skip to content

Commit

Permalink
Actually use real paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Duddino committed Jan 27, 2025
1 parent 6d441df commit 07d07d1
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src-tauri/src/explorer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ async fn get_explorer() -> &'static DefaultExplorer {
EXPLORER
.get_or_init(|| async {
let pivx_rpc = get_pivx_rpc().await;
// FIXME: refactor this to accept HOME
let dir = dirs::data_dir()
.ok_or(PIVXErrors::NoDataDir)
.unwrap()
.join("pivx-rust");
let address_index = AddressIndex::new(
SqlLite::new(PathBuf::from("/home/duddino/test.sqlite"))
.await
.unwrap(),
SqlLite::new(dir.join("test.sqlite")).await.unwrap(),
pivx_rpc.clone(),
);

Expand Down Expand Up @@ -233,9 +234,12 @@ where
}

pub async fn switch_to_blockfile_source(&self) -> crate::error::Result<()> {
// FIXME: Actually use a real path
let block_file_source =
BlockFileSource::new("/home/duddino/.local/share/pivx-rust/.pivx/blocks");
let dir = dirs::data_dir()
.ok_or(PIVXErrors::NoDataDir)?
.join("pivx-rust")
.join(".pivx")
.join("blocks");
let block_file_source = BlockFileSource::new(dir);
self.address_index
.write()
.await
Expand Down

0 comments on commit 07d07d1

Please sign in to comment.