New default paths#11641
Conversation
dvdplm
left a comment
There was a problem hiding this comment.
I don't think this goes the whole way but having a few illustrative unit tests showing what the intent is might clear it up.
| pub fn default_data_path() -> String { | ||
| let app_info = AppInfo { name: PRODUCT, author: AUTHOR }; | ||
| get_app_root(AppDataType::UserData, &app_info).map(|p| p.to_string_lossy().into_owned()).unwrap_or_else(|_| "$HOME/.parity".to_owned()) | ||
| default_path(AppDataType::UserData, PRODUCT).map(|p| p.to_string_lossy().into_owned()).unwrap_or_else(|| "$HOME/.openethereum".to_owned()) |
There was a problem hiding this comment.
Maybe I'm reading this wrong but it seems like you're going to end up with a path containing io.parity.ethereum/Parity on *nix/windows, and then OpenEthereum added to that. That isn't what we want I think?
When I run the test here it passes but printing it I see: Directories { base: "/home/dvdplm/.local/share/io.parity.ethereum", db: "/home/dvdplm/.local/share/io.parity.ethereum/chains", cache: "/home/dvdplm/.local/share/io.parity.ethereum/cache", keys: "/home/dvdplm/.local/share/io.parity.ethereum/keys", signer: "/home/dvdplm/.local/share/io.parity.ethereum/signer", secretstore: "/home/dvdplm/.local/share/io.parity.ethereum/secretstore" }
There was a problem hiding this comment.
I retained that code as the old path build mechanism. If the old constructed path does not exist it is discarded. It probably prints the old path because you have it on your disk already?
There was a problem hiding this comment.
macOS
Directories { base: "/Users/vorot93/Library/Application Support/OpenEthereum", db: "/Users/vorot93/Library/Application Support/OpenEthereum/chains", cache: "/Users/vorot93/Library/Application Support/OpenEthereum/cache", keys: "/Users/vorot93/Library/Application Support/OpenEthereum/keys", signer: "/Users/vorot93/Library/Application Support/OpenEthereum/signer", secretstore: "/Users/vorot93/Library/Application Support/OpenEthereum/secretstore" }
if I create the legacy folder manually
Directories { base: "/Users/vorot93/Library/Application Support/io.parity.ethereum", db: "/Users/vorot93/Library/Application Support/io.parity.ethereum/chains", cache: "/Users/vorot93/Library/Application Support/io.parity.ethereum/cache", keys: "/Users/vorot93/Library/Application Support/io.parity.ethereum/keys", signer: "/Users/vorot93/Library/Application Support/io.parity.ethereum/signer", secretstore: "/Users/vorot93/Library/Application Support/io.parity.ethereum/secretstore" }
There was a problem hiding this comment.
It probably prints the old path because you have it on your disk already?
Ah, didn't realize the test was not sandboxed.
k, so maybe we can extend the unit tests to make sure we're doing the right thing on different platforms?
62110ca to
1ef9ab7
Compare
| } | ||
|
|
||
| let mut root = data_root(t).ok()?; | ||
| root.push(if LOWERCASE { "openethereum" } else { "OpenEthereum" }); |
There was a problem hiding this comment.
why not use lowercase everywhere?
There was a problem hiding this comment.
I think the convention for AppData and Application Support is to use the original case.
1ef9ab7 to
e1f631e
Compare
e1f631e to
512e7cf
Compare
…rade-to-rocksdb-0.14 * dp/fix/memory-leak-when-warp-syncing: Drain the transaction overlay New default paths (#11641) Update EWF's chains with Istanbul transition block numbers (#11482) add openethereum supplementary bootnodes, those are not active right now, but will be in case the network needs more power (#11650) Remove Parity bootnodes (#11644)
This PR changes the default paths to reflect the new project name while retaining support for the old paths if they are still in use.