Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

result of get_db_path should be a part of ClientConfig #1137

Closed
debris opened this issue May 25, 2016 · 3 comments
Closed

result of get_db_path should be a part of ClientConfig #1137

debris opened this issue May 25, 2016 · 3 comments
Labels
F6-refactor 📚 Code needs refactoring. P9-somedaymaybe 🌞 Issue might be worth doing eventually.
Milestone

Comments

@debris
Copy link
Collaborator

debris commented May 25, 2016

I'm opening it up for discussion. Currently get_db_path is used in config, client

ethcore/src/client/client.rs:111:pub fn get_db_path(path: &Path, pruning: journaldb::Algorithm, genesis_hash: H256) -> PathBuf {
ethcore/src/client/client.rs:130:       let path = get_db_path(path, config.pruning, spec.genesis_header().hash());
parity/configuration.rs:29:use ethcore::client::{append_path, get_db_path, ClientConfig, Switch, VMType};
parity/configuration.rs:188:            let db = journaldb::new(&append_path(&get_db_path(Path::new(&self.path()), *i, spec.genesis_header().hash()), "state"), *i);

and another one time in migration code in this pr https://github.com/ethcore/parity/pull/1014

We could simplify it by making db_path part of the config.

@gavofyork gavofyork added F6-refactor 📚 Code needs refactoring. P9-somedaymaybe 🌞 Issue might be worth doing eventually. labels May 26, 2016
@gavofyork
Copy link
Contributor

seems reasonable.

@gavofyork gavofyork added this to the 1.3 Acuity milestone Jul 7, 2016
@debris
Copy link
Collaborator Author

debris commented Jul 25, 2016

fixed in cli_overhaul #1600 (not merged yet)

@rphmeier
Copy link
Contributor

in the #1679, i alter get_db_path to accept the path with the genesis hash already appended, so it really just figures out what the path should be based on pruning

@arkpar arkpar closed this as completed Jul 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F6-refactor 📚 Code needs refactoring. P9-somedaymaybe 🌞 Issue might be worth doing eventually.
Projects
None yet
Development

No branches or pull requests

4 participants