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

Fixed upgrading keys on the first run #3904

Merged
merged 1 commit into from
Dec 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ethcore/res/ethereum/tests
Submodule tests updated 31 files
+30 −30 StateTests/EIP158/EIP150/stChangedTests.json
+13 −13 StateTests/EIP158/EIP150/stEIPSpecificTest.json
+29 −29 StateTests/EIP158/EIP150/stEIPsingleCodeGasPrices.json
+8 −8 StateTests/EIP158/EIP150/stMemExpandingEIPCalls.json
+43 −43 StateTests/EIP158/Homestead/stBoundsTest.json
+72 −72 StateTests/EIP158/Homestead/stCallCodes.json
+38 −38 StateTests/EIP158/Homestead/stCallCreateCallCodeTest.json
+58 −58 StateTests/EIP158/Homestead/stCallDelegateCodes.json
+58 −58 StateTests/EIP158/Homestead/stCallDelegateCodesCallCode.json
+34 −34 StateTests/EIP158/Homestead/stDelegatecallTest.json
+5 −5 StateTests/EIP158/Homestead/stHomeSteadSpecific.json
+17 −17 StateTests/EIP158/Homestead/stInitCodeTest.json
+46 −46 StateTests/EIP158/Homestead/stLogTests.json
+65 −65 StateTests/EIP158/Homestead/stMemoryTest.json
+89 −89 StateTests/EIP158/Homestead/stPreCompiledContracts.json
+2 −2 StateTests/EIP158/Homestead/stRecursiveCreate.json
+19 −19 StateTests/EIP158/Homestead/stRefundTest.json
+9 −9 StateTests/EIP158/Homestead/stSpecialTest.json
+69 −76 StateTests/EIP158/Homestead/stSystemOperationsTest.json
+43 −43 StateTests/EIP158/Homestead/stTransactionTest.json
+85 −85 StateTests/EIP158/Homestead/stWalletTest.json
+0 −105 StateTests/EIP158/stCodeSizeLimit.json
+17 −17 StateTests/EIP158/stCreateTest.json
+5 −95 StateTests/EIP158/stEIP158SpecificTest.json
+24 −24 StateTests/EIP158/stNonZeroCallsTest.json
+24 −24 StateTests/EIP158/stZeroCallsTest.json
+62 −62 TransactionTests/EIP155/ttTransactionTest.json
+22 −88 TransactionTests/EIP155/ttTransactionTestEip155VitaliksTests.json
+84 −84 TransactionTests/EIP155/ttTransactionTestVRule.json
+0 −66 TransactionTests/Homestead/ttTransactionTestEip155VitaliksTests.json
+0 −308 VMTests/vmPerformanceTest.json
6 changes: 2 additions & 4 deletions parity/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ fn file_exists(path: &Path) -> bool {
}

pub fn upgrade_key_location(from: &PathBuf, to: &PathBuf) {
let mut parent = to.clone();
parent.pop();
match fs::create_dir_all(&parent).and_then(|()| fs::read_dir(from)) {
match fs::create_dir_all(&to).and_then(|()| fs::read_dir(from)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the function moves individual files destination directory must be created here.

Ok(entries) => {
let files: Vec<_> = entries.filter_map(|f| f.ok().and_then(|f| if f.file_type().ok().map_or(false, |f| f.is_file()) { f.file_name().to_str().map(|s| s.to_owned()) } else { None })).collect();
let mut num: usize = 0;
Expand All @@ -165,7 +163,7 @@ pub fn upgrade_key_location(from: &PathBuf, to: &PathBuf) {
}
},
Err(e) => {
warn!("Error moving keys from {:?} to {:?}: {:?}", from, to, e);
debug!("Error moving keys from {:?} to {:?}: {:?}", from, to, e);
}
}
}
Expand Down