| 14 | |
| 15 | namespace wallet { |
| 16 | InitWalletDirTestingSetup::InitWalletDirTestingSetup(const std::string& chainName) : BasicTestingSetup(chainName) |
| 17 | { |
| 18 | m_wallet_loader = MakeWalletLoader(*m_node.chain, *Assert(m_node.args)); |
| 19 | |
| 20 | std::string sep; |
| 21 | sep += fs::path::preferred_separator; |
| 22 | |
| 23 | m_datadir = gArgs.GetDataDirNet(); |
| 24 | m_cwd = fs::current_path(); |
| 25 | |
| 26 | m_walletdir_path_cases["default"] = m_datadir / "wallets"; |
| 27 | m_walletdir_path_cases["custom"] = m_datadir / "my_wallets"; |
| 28 | m_walletdir_path_cases["nonexistent"] = m_datadir / "path_does_not_exist"; |
| 29 | m_walletdir_path_cases["file"] = m_datadir / "not_a_directory.dat"; |
| 30 | m_walletdir_path_cases["trailing"] = m_datadir / ("wallets" + sep); |
| 31 | m_walletdir_path_cases["trailing2"] = m_datadir / ("wallets" + sep + sep); |
| 32 | |
| 33 | fs::current_path(m_datadir); |
| 34 | m_walletdir_path_cases["relative"] = "wallets"; |
| 35 | |
| 36 | fs::create_directories(m_walletdir_path_cases["default"]); |
| 37 | fs::create_directories(m_walletdir_path_cases["custom"]); |
| 38 | fs::create_directories(m_walletdir_path_cases["relative"]); |
| 39 | std::ofstream f{m_walletdir_path_cases["file"]}; |
| 40 | f.close(); |
| 41 | } |
| 42 | |
| 43 | InitWalletDirTestingSetup::~InitWalletDirTestingSetup() |
| 44 | { |
nothing calls this directly
no test coverage detected