Replace use of ArgsManager with DatabaseOptions

Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
This commit is contained in:
Kiminuo
2021-12-02 21:21:05 +01:00
parent a7e80449c0
commit 39b1763730
21 changed files with 93 additions and 60 deletions

View File

@@ -15,12 +15,12 @@
namespace wallet {
InitWalletDirTestingSetup::InitWalletDirTestingSetup(const std::string& chainName) : BasicTestingSetup(chainName)
{
m_wallet_loader = MakeWalletLoader(*m_node.chain, *Assert(m_node.args));
m_wallet_loader = MakeWalletLoader(*m_node.chain, m_args);
std::string sep;
sep += fs::path::preferred_separator;
m_datadir = gArgs.GetDataDirNet();
m_datadir = m_args.GetDataDirNet();
m_cwd = fs::current_path();
m_walletdir_path_cases["default"] = m_datadir / "wallets";
@@ -42,14 +42,11 @@ InitWalletDirTestingSetup::InitWalletDirTestingSetup(const std::string& chainNam
InitWalletDirTestingSetup::~InitWalletDirTestingSetup()
{
gArgs.LockSettings([&](util::Settings& settings) {
settings.forced_settings.erase("walletdir");
});
fs::current_path(m_cwd);
}
void InitWalletDirTestingSetup::SetWalletDir(const fs::path& walletdir_path)
{
gArgs.ForceSetArg("-walletdir", fs::PathToString(walletdir_path));
m_args.ForceSetArg("-walletdir", fs::PathToString(walletdir_path));
}
} // namespace wallet