32 #ifndef LEDGER_CORE_KEYCHAIN_TEST_HELPER_H 33 #define LEDGER_CORE_KEYCHAIN_TEST_HELPER_H 35 #include <src/wallet/currencies.hpp> 36 #include <api/EthereumLikeNetworkParameters.hpp> 37 #include <api/Currency.hpp> 38 #include "../BaseFixture.h" 47 std::string derivationPath;
54 std::string derivationPath_):
55 btc_parameters(std::move(parameters_)),
56 currency(std::move(currency_)),
57 xpub(std::move(xpub_)),
58 derivationPath(std::move(derivationPath_))
66 std::string derivationPath_):
67 eth_parameters(std::move(parameters_)),
68 currency(std::move(currency_)),
69 xpub(std::move(xpub_)),
70 derivationPath(std::move(derivationPath_))
76 this->btc_parameters = data.btc_parameters;
77 this->eth_parameters = data.eth_parameters;
78 this->currency = data.currency;
79 this->xpub = data.xpub;
80 this->derivationPath = data.derivationPath;
84 this->btc_parameters = data.btc_parameters;
85 this->eth_parameters = data.eth_parameters;
86 this->currency = data.currency;
87 this->xpub = data.xpub;
88 this->derivationPath = data.derivationPath;
120 template <
class Keychain>
123 void testKeychain(
const KeychainTestData &data, std::function<
void (Keychain&)> f) {
124 auto backend = std::make_shared<ledger::core::PreferencesBackend>(
125 "/preferences/tests.db",
126 dispatcher->getMainExecutionContext(),
129 auto configuration = std::make_shared<DynamicObject>();
130 dispatcher->getMainExecutionContext()->execute(ledger::qt::make_runnable([=]() {
135 ledger::core::BitcoinLikeExtendedPublicKey::fromBase58(data.currency,
139 backend->getPreferences(
"keychain")
144 dispatcher->waitUntilStopped();
148 #endif //LEDGER_CORE_KEYCHAIN_TEST_HELPER_H Definition: keychain_test_helper.h:41
Definition: Currency.hpp:23
Definition: BaseFixture.h:76
Definition: keychain_test_helper.h:121
Definition: EthereumLikeNetworkParameters.hpp:15
std::experimental::optional< BitcoinLikeNetworkParameters > bitcoinLikeNetworkParameters
Definition: Currency.hpp:41
Definition: optional.hpp:177
Definition: BitcoinLikeNetworkParameters.hpp:17
std::experimental::optional< EthereumLikeNetworkParameters > ethereumLikeNetworkParameters
Definition: Currency.hpp:43