Skip to content

Commit 3fd30a2

Browse files
committed
fix: use relative path for address state
1 parent cacbaa9 commit 3fd30a2

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

modules/address_state/src/state.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
use std::{
2-
collections::HashSet,
3-
path::{Path, PathBuf},
4-
sync::Arc,
5-
};
1+
use std::{collections::HashSet, path::Path, sync::Arc};
62

73
use acropolis_common::{
84
Address, AddressDelta, AddressTotals, BlockInfo, ShelleyAddress, TxIdentifier, TxTotals,
@@ -55,13 +51,8 @@ pub struct State {
5551

5652
impl State {
5753
pub async fn new(config: &AddressStorageConfig) -> Result<Self> {
58-
let db_path = if Path::new(&config.db_path).is_relative() {
59-
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join(&config.db_path)
60-
} else {
61-
PathBuf::from(&config.db_path)
62-
};
63-
64-
let store = Arc::new(ImmutableAddressStore::new(&db_path, config.clear_on_start)?);
54+
let db_path = Path::new(&config.db_path);
55+
let store = Arc::new(ImmutableAddressStore::new(db_path, config.clear_on_start)?);
6556

6657
let mut config = config.clone();
6758
config.skip_until = store.get_last_epoch_stored().await?;

0 commit comments

Comments
 (0)