diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core_tests/chaingen.cpp | 2 | ||||
-rw-r--r-- | tests/core_tests/tx_validation.cpp | 4 | ||||
-rw-r--r-- | tests/crypto/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/crypto/crypto.cpp | 12 | ||||
-rw-r--r-- | tests/fuzz/cold-outputs.cpp | 1 | ||||
-rw-r--r-- | tests/fuzz/cold-transaction.cpp | 1 | ||||
-rw-r--r-- | tests/fuzz/signature.cpp | 1 | ||||
-rw-r--r-- | tests/hash/main.cpp | 4 | ||||
-rw-r--r-- | tests/libwallet_api_tests/main.cpp | 102 | ||||
-rw-r--r-- | tests/performance_tests/generate_keypair.h | 2 |
10 files changed, 66 insertions, 66 deletions
diff --git a/tests/core_tests/chaingen.cpp b/tests/core_tests/chaingen.cpp index 5e1525e3e..41256a4f1 100644 --- a/tests/core_tests/chaingen.cpp +++ b/tests/core_tests/chaingen.cpp @@ -521,7 +521,7 @@ bool construct_miner_tx_manually(size_t height, uint64_t already_generated_coins keypair* p_txkey/* = 0*/) { keypair txkey; - txkey = keypair::generate(); + txkey = keypair::generate(hw::get_device("default")); add_tx_pub_key_to_extra(tx, txkey.pub); if (0 != p_txkey) diff --git a/tests/core_tests/tx_validation.cpp b/tests/core_tests/tx_validation.cpp index d6d5236aa..f0a385ee5 100644 --- a/tests/core_tests/tx_validation.cpp +++ b/tests/core_tests/tx_validation.cpp @@ -49,7 +49,7 @@ namespace m_tx.version = version; m_tx.unlock_time = unlock_time; - m_tx_key = keypair::generate(); + m_tx_key = keypair::generate(hw::get_device("default")); add_tx_pub_key_to_extra(m_tx, m_tx_key.pub); } @@ -518,7 +518,7 @@ bool gen_tx_key_image_not_derive_from_tx_key::generate(std::vector<test_event_en builder.step2_fill_inputs(miner_account.get_keys(), sources); txin_to_key& in_to_key = boost::get<txin_to_key>(builder.m_tx.vin.front()); - keypair kp = keypair::generate(); + keypair kp = keypair::generate(hw::get_device("default")); key_image another_ki; crypto::generate_key_image(kp.pub, kp.sec, another_ki); in_to_key.k_image = another_ki; diff --git a/tests/crypto/CMakeLists.txt b/tests/crypto/CMakeLists.txt index c89049d50..df96c57cc 100644 --- a/tests/crypto/CMakeLists.txt +++ b/tests/crypto/CMakeLists.txt @@ -42,10 +42,7 @@ add_executable(cncrypto-tests ${crypto_headers}) target_link_libraries(cncrypto-tests PRIVATE - wallet - cryptonote_core common - device ${Boost_SYSTEM_LIBRARY} ${EXTRA_LIBRARIES}) set_property(TARGET cncrypto-tests diff --git a/tests/crypto/crypto.cpp b/tests/crypto/crypto.cpp index 90212bd0b..6a1dd1b29 100644 --- a/tests/crypto/crypto.cpp +++ b/tests/crypto/crypto.cpp @@ -33,7 +33,7 @@ #include "crypto-tests.h" bool check_scalar(const crypto::ec_scalar &scalar) { - return sc_check(crypto::operator &(scalar)) == 0; + return crypto::sc_check(crypto::operator &(scalar)) == 0; } void random_scalar(crypto::ec_scalar &res) { @@ -45,13 +45,13 @@ void hash_to_scalar(const void *data, std::size_t length, crypto::ec_scalar &res } void hash_to_point(const crypto::hash &h, crypto::ec_point &res) { - ge_p2 point; - ge_fromfe_frombytes_vartime(&point, reinterpret_cast<const unsigned char *>(&h)); - ge_tobytes(crypto::operator &(res), &point); + crypto::ge_p2 point; + crypto::ge_fromfe_frombytes_vartime(&point, reinterpret_cast<const unsigned char *>(&h)); + crypto::ge_tobytes(crypto::operator &(res), &point); } void hash_to_ec(const crypto::public_key &key, crypto::ec_point &res) { - ge_p3 tmp; + crypto::ge_p3 tmp; crypto::hash_to_ec(key, tmp); - ge_p3_tobytes(crypto::operator &(res), &tmp); + crypto::ge_p3_tobytes(crypto::operator &(res), &tmp); } diff --git a/tests/fuzz/cold-outputs.cpp b/tests/fuzz/cold-outputs.cpp index 9aa9460d5..59b59810c 100644 --- a/tests/fuzz/cold-outputs.cpp +++ b/tests/fuzz/cold-outputs.cpp @@ -54,6 +54,7 @@ int ColdOutputsFuzzer::init() try { wallet.init(""); + wallet.set_subaddress_lookahead(1, 1); wallet.generate("", "", spendkey, true, false); } catch (const std::exception &e) diff --git a/tests/fuzz/cold-transaction.cpp b/tests/fuzz/cold-transaction.cpp index d81092c82..da33dc318 100644 --- a/tests/fuzz/cold-transaction.cpp +++ b/tests/fuzz/cold-transaction.cpp @@ -55,6 +55,7 @@ int ColdTransactionFuzzer::init() try { wallet.init(""); + wallet.set_subaddress_lookahead(1, 1); wallet.generate("", "", spendkey, true, false); } catch (const std::exception &e) diff --git a/tests/fuzz/signature.cpp b/tests/fuzz/signature.cpp index 2b8ffe465..7f22757b2 100644 --- a/tests/fuzz/signature.cpp +++ b/tests/fuzz/signature.cpp @@ -55,6 +55,7 @@ int SignatureFuzzer::init() try { wallet.init(""); + wallet.set_subaddress_lookahead(1, 1); wallet.generate("", "", spendkey, true, false); cryptonote::address_parse_info info; diff --git a/tests/hash/main.cpp b/tests/hash/main.cpp index 5a16284df..c7e1fe712 100644 --- a/tests/hash/main.cpp +++ b/tests/hash/main.cpp @@ -52,10 +52,10 @@ extern "C" { tree_hash((const char (*)[32]) data, length >> 5, hash); } static void cn_slow_hash_0(const void *data, size_t length, char *hash) { - return cn_slow_hash(data, length, hash, 0); + return cn_slow_hash(data, length, hash, 0/*variant*/, 0/*prehashed*/); } static void cn_slow_hash_1(const void *data, size_t length, char *hash) { - return cn_slow_hash(data, length, hash, 1); + return cn_slow_hash(data, length, hash, 1/*variant*/, 0/*prehashed*/); } } POP_WARNINGS diff --git a/tests/libwallet_api_tests/main.cpp b/tests/libwallet_api_tests/main.cpp index 1e63a12f3..fe31541df 100644 --- a/tests/libwallet_api_tests/main.cpp +++ b/tests/libwallet_api_tests/main.cpp @@ -130,7 +130,7 @@ struct Utils static std::string get_wallet_address(const std::string &filename, const std::string &password) { Monero::WalletManager *wmgr = Monero::WalletManagerFactory::getWalletManager(); - Monero::Wallet * w = wmgr->openWallet(filename, password, true); + Monero::Wallet * w = wmgr->openWallet(filename, password, Monero::NetworkType::TESTNET); std::string result = w->mainAddress(); wmgr->closeWallet(w); return result; @@ -208,7 +208,7 @@ struct WalletTest2 : public testing::Test TEST_F(WalletManagerTest, WalletManagerCreatesWallet) { - Monero::Wallet * wallet = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG); + Monero::Wallet * wallet = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG, Monero::NetworkType::MAINNET); ASSERT_TRUE(wallet->status() == Monero::Wallet::Status_Ok); ASSERT_TRUE(!wallet->seed().empty()); std::vector<std::string> words; @@ -225,10 +225,10 @@ TEST_F(WalletManagerTest, WalletManagerCreatesWallet) TEST_F(WalletManagerTest, WalletManagerOpensWallet) { - Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG); + Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG, Monero::NetworkType::MAINNET); std::string seed1 = wallet1->seed(); ASSERT_TRUE(wmgr->closeWallet(wallet1)); - Monero::Wallet * wallet2 = wmgr->openWallet(WALLET_NAME, WALLET_PASS); + Monero::Wallet * wallet2 = wmgr->openWallet(WALLET_NAME, WALLET_PASS, Monero::NetworkType::MAINNET); ASSERT_TRUE(wallet2->status() == Monero::Wallet::Status_Ok); ASSERT_TRUE(wallet2->seed() == seed1); std::cout << "** seed: " << wallet2->seed() << std::endl; @@ -261,7 +261,7 @@ void open_wallet_helper(Monero::WalletManager *wmgr, Monero::Wallet **wallet, co if (mutex) mutex->lock(); LOG_PRINT_L3("opening wallet in thread: " << boost::this_thread::get_id()); - *wallet = wmgr->openWallet(WALLET_NAME, pass, true); + *wallet = wmgr->openWallet(WALLET_NAME, pass, Monero::NetworkType::TESTNET); LOG_PRINT_L3("wallet address: " << (*wallet)->mainAddress()); LOG_PRINT_L3("wallet status: " << (*wallet)->status()); LOG_PRINT_L3("closing wallet in thread: " << boost::this_thread::get_id()); @@ -277,7 +277,7 @@ void open_wallet_helper(Monero::WalletManager *wmgr, Monero::Wallet **wallet, co // // create password protected wallet // std::string wallet_pass = "password"; // std::string wrong_wallet_pass = "1111"; -// Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, wallet_pass, WALLET_LANG, true); +// Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, wallet_pass, WALLET_LANG, Monero::NetworkType::TESTNET); // std::string seed1 = wallet1->seed(); // ASSERT_TRUE(wmgr->closeWallet(wallet1)); @@ -303,7 +303,7 @@ TEST_F(WalletManagerTest, WalletManagerOpensWalletWithPasswordAndReopen) // create password protected wallet std::string wallet_pass = "password"; std::string wrong_wallet_pass = "1111"; - Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, wallet_pass, WALLET_LANG, true); + Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, wallet_pass, WALLET_LANG, Monero::NetworkType::TESTNET); std::string seed1 = wallet1->seed(); ASSERT_TRUE(wmgr->closeWallet(wallet1)); @@ -326,11 +326,11 @@ TEST_F(WalletManagerTest, WalletManagerOpensWalletWithPasswordAndReopen) TEST_F(WalletManagerTest, WalletManagerStoresWallet) { - Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG); + Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG, Monero::NetworkType::MAINNET); std::string seed1 = wallet1->seed(); wallet1->store(""); ASSERT_TRUE(wmgr->closeWallet(wallet1)); - Monero::Wallet * wallet2 = wmgr->openWallet(WALLET_NAME, WALLET_PASS); + Monero::Wallet * wallet2 = wmgr->openWallet(WALLET_NAME, WALLET_PASS, Monero::NetworkType::MAINNET); ASSERT_TRUE(wallet2->status() == Monero::Wallet::Status_Ok); ASSERT_TRUE(wallet2->seed() == seed1); } @@ -339,12 +339,12 @@ TEST_F(WalletManagerTest, WalletManagerStoresWallet) TEST_F(WalletManagerTest, WalletManagerMovesWallet) { - Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG); + Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG, Monero::NetworkType::MAINNET); std::string WALLET_NAME_MOVED = std::string("/tmp/") + WALLET_NAME + ".moved"; std::string seed1 = wallet1->seed(); ASSERT_TRUE(wallet1->store(WALLET_NAME_MOVED)); - Monero::Wallet * wallet2 = wmgr->openWallet(WALLET_NAME_MOVED, WALLET_PASS); + Monero::Wallet * wallet2 = wmgr->openWallet(WALLET_NAME_MOVED, WALLET_PASS, Monero::NetworkType::MAINNET); ASSERT_TRUE(wallet2->filename() == WALLET_NAME_MOVED); ASSERT_TRUE(wallet2->keysFilename() == WALLET_NAME_MOVED + ".keys"); ASSERT_TRUE(wallet2->status() == Monero::Wallet::Status_Ok); @@ -354,15 +354,15 @@ TEST_F(WalletManagerTest, WalletManagerMovesWallet) TEST_F(WalletManagerTest, WalletManagerChangesPassword) { - Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG); + Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG, Monero::NetworkType::MAINNET); std::string seed1 = wallet1->seed(); ASSERT_TRUE(wallet1->setPassword(WALLET_PASS2)); ASSERT_TRUE(wmgr->closeWallet(wallet1)); - Monero::Wallet * wallet2 = wmgr->openWallet(WALLET_NAME, WALLET_PASS2); + Monero::Wallet * wallet2 = wmgr->openWallet(WALLET_NAME, WALLET_PASS2, Monero::NetworkType::MAINNET); ASSERT_TRUE(wallet2->status() == Monero::Wallet::Status_Ok); ASSERT_TRUE(wallet2->seed() == seed1); ASSERT_TRUE(wmgr->closeWallet(wallet2)); - Monero::Wallet * wallet3 = wmgr->openWallet(WALLET_NAME, WALLET_PASS); + Monero::Wallet * wallet3 = wmgr->openWallet(WALLET_NAME, WALLET_PASS, Monero::NetworkType::MAINNET); ASSERT_FALSE(wallet3->status() == Monero::Wallet::Status_Ok); } @@ -370,13 +370,13 @@ TEST_F(WalletManagerTest, WalletManagerChangesPassword) TEST_F(WalletManagerTest, WalletManagerRecoversWallet) { - Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG); + Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG, Monero::NetworkType::MAINNET); std::string seed1 = wallet1->seed(); std::string address1 = wallet1->mainAddress(); ASSERT_FALSE(address1.empty()); ASSERT_TRUE(wmgr->closeWallet(wallet1)); Utils::deleteWallet(WALLET_NAME); - Monero::Wallet * wallet2 = wmgr->recoveryWallet(WALLET_NAME, seed1); + Monero::Wallet * wallet2 = wmgr->recoveryWallet(WALLET_NAME, seed1, Monero::NetworkType::MAINNET); ASSERT_TRUE(wallet2->status() == Monero::Wallet::Status_Ok); ASSERT_TRUE(wallet2->seed() == seed1); ASSERT_TRUE(wallet2->mainAddress() == address1); @@ -386,14 +386,14 @@ TEST_F(WalletManagerTest, WalletManagerRecoversWallet) TEST_F(WalletManagerTest, WalletManagerStoresWallet1) { - Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG); + Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG, Monero::NetworkType::MAINNET); std::string seed1 = wallet1->seed(); std::string address1 = wallet1->mainAddress(); ASSERT_TRUE(wallet1->store("")); ASSERT_TRUE(wallet1->store(WALLET_NAME_COPY)); ASSERT_TRUE(wmgr->closeWallet(wallet1)); - Monero::Wallet * wallet2 = wmgr->openWallet(WALLET_NAME_COPY, WALLET_PASS); + Monero::Wallet * wallet2 = wmgr->openWallet(WALLET_NAME_COPY, WALLET_PASS, Monero::NetworkType::MAINNET); ASSERT_TRUE(wallet2->status() == Monero::Wallet::Status_Ok); ASSERT_TRUE(wallet2->seed() == seed1); ASSERT_TRUE(wallet2->mainAddress() == address1); @@ -403,14 +403,14 @@ TEST_F(WalletManagerTest, WalletManagerStoresWallet1) TEST_F(WalletManagerTest, WalletManagerStoresWallet2) { - Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG); + Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG, Monero::NetworkType::MAINNET); std::string seed1 = wallet1->seed(); std::string address1 = wallet1->mainAddress(); ASSERT_TRUE(wallet1->store(WALLET_NAME_WITH_DIR)); ASSERT_TRUE(wmgr->closeWallet(wallet1)); - wallet1 = wmgr->openWallet(WALLET_NAME_WITH_DIR, WALLET_PASS); + wallet1 = wmgr->openWallet(WALLET_NAME_WITH_DIR, WALLET_PASS, Monero::NetworkType::MAINNET); ASSERT_TRUE(wallet1->status() == Monero::Wallet::Status_Ok); ASSERT_TRUE(wallet1->seed() == seed1); ASSERT_TRUE(wallet1->mainAddress() == address1); @@ -420,20 +420,20 @@ TEST_F(WalletManagerTest, WalletManagerStoresWallet2) TEST_F(WalletManagerTest, WalletManagerStoresWallet3) { - Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG); + Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG, Monero::NetworkType::MAINNET); std::string seed1 = wallet1->seed(); std::string address1 = wallet1->mainAddress(); ASSERT_FALSE(wallet1->store(WALLET_NAME_WITH_DIR_NON_WRITABLE)); ASSERT_TRUE(wmgr->closeWallet(wallet1)); - wallet1 = wmgr->openWallet(WALLET_NAME_WITH_DIR_NON_WRITABLE, WALLET_PASS); + wallet1 = wmgr->openWallet(WALLET_NAME_WITH_DIR_NON_WRITABLE, WALLET_PASS, Monero::NetworkType::MAINNET); ASSERT_FALSE(wallet1->status() == Monero::Wallet::Status_Ok); // "close" always returns true; ASSERT_TRUE(wmgr->closeWallet(wallet1)); - wallet1 = wmgr->openWallet(WALLET_NAME, WALLET_PASS); + wallet1 = wmgr->openWallet(WALLET_NAME, WALLET_PASS, Monero::NetworkType::MAINNET); ASSERT_TRUE(wallet1->status() == Monero::Wallet::Status_Ok); ASSERT_TRUE(wallet1->seed() == seed1); ASSERT_TRUE(wallet1->mainAddress() == address1); @@ -444,7 +444,7 @@ TEST_F(WalletManagerTest, WalletManagerStoresWallet3) TEST_F(WalletManagerTest, WalletManagerStoresWallet4) { - Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG); + Monero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG, Monero::NetworkType::MAINNET); std::string seed1 = wallet1->seed(); std::string address1 = wallet1->mainAddress(); @@ -456,7 +456,7 @@ TEST_F(WalletManagerTest, WalletManagerStoresWallet4) ASSERT_TRUE(wmgr->closeWallet(wallet1)); - wallet1 = wmgr->openWallet(WALLET_NAME, WALLET_PASS); + wallet1 = wmgr->openWallet(WALLET_NAME, WALLET_PASS, Monero::NetworkType::MAINNET); ASSERT_TRUE(wallet1->status() == Monero::Wallet::Status_Ok); ASSERT_TRUE(wallet1->seed() == seed1); ASSERT_TRUE(wallet1->mainAddress() == address1); @@ -488,7 +488,7 @@ TEST_F(WalletTest1, WalletGeneratesIntegratedAddress) { std::string payment_id = Monero::Wallet::genPaymentId(); - Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); std::string integrated_address = wallet1->integratedAddress(payment_id); ASSERT_TRUE(integrated_address.length() == 106); } @@ -496,14 +496,14 @@ TEST_F(WalletTest1, WalletGeneratesIntegratedAddress) TEST_F(WalletTest1, WalletShowsBalance) { - Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); ASSERT_TRUE(wallet1->balance(0) > 0); ASSERT_TRUE(wallet1->unlockedBalance(0) > 0); uint64_t balance1 = wallet1->balance(0); uint64_t unlockedBalance1 = wallet1->unlockedBalance(0); ASSERT_TRUE(wmgr->closeWallet(wallet1)); - Monero::Wallet * wallet2 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet2 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); ASSERT_TRUE(balance1 == wallet2->balance(0)); std::cout << "wallet balance: " << wallet2->balance(0) << std::endl; @@ -514,7 +514,7 @@ TEST_F(WalletTest1, WalletShowsBalance) TEST_F(WalletTest1, WalletReturnsCurrentBlockHeight) { - Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); ASSERT_TRUE(wallet1->blockChainHeight() > 0); wmgr->closeWallet(wallet1); } @@ -522,14 +522,14 @@ TEST_F(WalletTest1, WalletReturnsCurrentBlockHeight) TEST_F(WalletTest1, WalletReturnsDaemonBlockHeight) { - Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); // wallet not connected to daemon ASSERT_TRUE(wallet1->daemonBlockChainHeight() == 0); ASSERT_TRUE(wallet1->status() != Monero::Wallet::Status_Ok); ASSERT_FALSE(wallet1->errorString().empty()); wmgr->closeWallet(wallet1); - wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); // wallet connected to daemon wallet1->init(TESTNET_DAEMON_ADDRESS, 0); ASSERT_TRUE(wallet1->daemonBlockChainHeight() > 0); @@ -542,7 +542,7 @@ TEST_F(WalletTest1, WalletRefresh) { std::cout << "Opening wallet: " << CURRENT_SRC_WALLET << std::endl; - Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); // make sure testnet daemon is running std::cout << "connecting to daemon: " << TESTNET_DAEMON_ADDRESS << std::endl; ASSERT_TRUE(wallet1->init(TESTNET_DAEMON_ADDRESS, 0)); @@ -566,7 +566,7 @@ TEST_F(WalletTest1, WalletConvertsToString) TEST_F(WalletTest1, WalletTransaction) { - Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); // make sure testnet daemon is running ASSERT_TRUE(wallet1->init(TESTNET_DAEMON_ADDRESS, 0)); ASSERT_TRUE(wallet1->refresh()); @@ -608,7 +608,7 @@ TEST_F(WalletTest1, WalletTransactionWithMixin) std::string payment_id = ""; - Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); // make sure testnet daemon is running @@ -642,7 +642,7 @@ TEST_F(WalletTest1, WalletTransactionWithPriority) std::string payment_id = ""; - Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); // make sure testnet daemon is running ASSERT_TRUE(wallet1->init(TESTNET_DAEMON_ADDRESS, 0)); @@ -682,7 +682,7 @@ TEST_F(WalletTest1, WalletTransactionWithPriority) TEST_F(WalletTest1, WalletHistory) { - Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet1 = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); // make sure testnet daemon is running ASSERT_TRUE(wallet1->init(TESTNET_DAEMON_ADDRESS, 0)); ASSERT_TRUE(wallet1->refresh()); @@ -700,7 +700,7 @@ TEST_F(WalletTest1, WalletHistory) TEST_F(WalletTest1, WalletTransactionAndHistory) { return; - Monero::Wallet * wallet_src = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet_src = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); // make sure testnet daemon is running ASSERT_TRUE(wallet_src->init(TESTNET_DAEMON_ADDRESS, 0)); ASSERT_TRUE(wallet_src->refresh()); @@ -739,7 +739,7 @@ TEST_F(WalletTest1, WalletTransactionAndHistory) TEST_F(WalletTest1, WalletTransactionWithPaymentId) { - Monero::Wallet * wallet_src = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet_src = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); // make sure testnet daemon is running ASSERT_TRUE(wallet_src->init(TESTNET_DAEMON_ADDRESS, 0)); ASSERT_TRUE(wallet_src->refresh()); @@ -881,7 +881,7 @@ struct MyWalletListener : public Monero::WalletListener TEST_F(WalletTest2, WalletCallBackRefreshedSync) { - Monero::Wallet * wallet_src = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet_src = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); MyWalletListener * wallet_src_listener = new MyWalletListener(wallet_src); ASSERT_TRUE(wallet_src->init(TESTNET_DAEMON_ADDRESS, 0)); ASSERT_TRUE(wallet_src_listener->refresh_triggered); @@ -898,7 +898,7 @@ TEST_F(WalletTest2, WalletCallBackRefreshedSync) TEST_F(WalletTest2, WalletCallBackRefreshedAsync) { - Monero::Wallet * wallet_src = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet_src = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); MyWalletListener * wallet_src_listener = new MyWalletListener(wallet_src); boost::chrono::seconds wait_for = boost::chrono::seconds(20); @@ -920,14 +920,14 @@ TEST_F(WalletTest2, WalletCallBackRefreshedAsync) TEST_F(WalletTest2, WalletCallbackSent) { - Monero::Wallet * wallet_src = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet_src = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); // make sure testnet daemon is running ASSERT_TRUE(wallet_src->init(TESTNET_DAEMON_ADDRESS, 0)); ASSERT_TRUE(wallet_src->refresh()); MyWalletListener * wallet_src_listener = new MyWalletListener(wallet_src); uint64_t balance = wallet_src->balance(0); std::cout << "** Balance: " << wallet_src->displayAmount(wallet_src->balance(0)) << std::endl; - Monero::Wallet * wallet_dst = wmgr->openWallet(CURRENT_DST_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet_dst = wmgr->openWallet(CURRENT_DST_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); uint64_t amount = AMOUNT_1XMR * 5; std::cout << "** Sending " << Monero::Wallet::displayAmount(amount) << " to " << wallet_dst->mainAddress(); @@ -959,13 +959,13 @@ TEST_F(WalletTest2, WalletCallbackSent) TEST_F(WalletTest2, WalletCallbackReceived) { - Monero::Wallet * wallet_src = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet_src = wmgr->openWallet(CURRENT_SRC_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); // make sure testnet daemon is running ASSERT_TRUE(wallet_src->init(TESTNET_DAEMON_ADDRESS, 0)); ASSERT_TRUE(wallet_src->refresh()); std::cout << "** Balance src1: " << wallet_src->displayAmount(wallet_src->balance(0)) << std::endl; - Monero::Wallet * wallet_dst = wmgr->openWallet(CURRENT_DST_WALLET, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet_dst = wmgr->openWallet(CURRENT_DST_WALLET, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); ASSERT_TRUE(wallet_dst->init(TESTNET_DAEMON_ADDRESS, 0)); ASSERT_TRUE(wallet_dst->refresh()); uint64_t balance = wallet_dst->balance(0); @@ -1006,7 +1006,7 @@ TEST_F(WalletTest2, WalletCallbackReceived) TEST_F(WalletTest2, WalletCallbackNewBlock) { - Monero::Wallet * wallet_src = wmgr->openWallet(TESTNET_WALLET5_NAME, TESTNET_WALLET_PASS, true); + Monero::Wallet * wallet_src = wmgr->openWallet(TESTNET_WALLET5_NAME, TESTNET_WALLET_PASS, Monero::NetworkType::TESTNET); // make sure testnet daemon is running ASSERT_TRUE(wallet_src->init(TESTNET_DAEMON_ADDRESS, 0)); ASSERT_TRUE(wallet_src->refresh()); @@ -1033,7 +1033,7 @@ TEST_F(WalletTest2, WalletCallbackNewBlock) TEST_F(WalletManagerMainnetTest, CreateOpenAndRefreshWalletMainNetSync) { - Monero::Wallet * wallet = wmgr->createWallet(WALLET_NAME_MAINNET, "", WALLET_LANG); + Monero::Wallet * wallet = wmgr->createWallet(WALLET_NAME_MAINNET, "", WALLET_LANG, Monero::NetworkType::MAINNET); std::unique_ptr<MyWalletListener> wallet_listener (new MyWalletListener(wallet)); wallet->init(MAINNET_DAEMON_ADDRESS, 0); std::cerr << "TEST: waiting on refresh lock...\n"; @@ -1052,7 +1052,7 @@ TEST_F(WalletManagerMainnetTest, CreateAndRefreshWalletMainNetAsync) // supposing 120 seconds should be enough for fast refresh int SECONDS_TO_REFRESH = 120; - Monero::Wallet * wallet = wmgr->createWallet(WALLET_NAME_MAINNET, "", WALLET_LANG); + Monero::Wallet * wallet = wmgr->createWallet(WALLET_NAME_MAINNET, "", WALLET_LANG, Monero::NetworkType::MAINNET); std::unique_ptr<MyWalletListener> wallet_listener (new MyWalletListener(wallet)); boost::chrono::seconds wait_for = boost::chrono::seconds(SECONDS_TO_REFRESH); @@ -1075,9 +1075,9 @@ TEST_F(WalletManagerMainnetTest, OpenAndRefreshWalletMainNetAsync) // supposing 120 seconds should be enough for fast refresh int SECONDS_TO_REFRESH = 120; - Monero::Wallet * wallet = wmgr->createWallet(WALLET_NAME_MAINNET, "", WALLET_LANG); + Monero::Wallet * wallet = wmgr->createWallet(WALLET_NAME_MAINNET, "", WALLET_LANG, Monero::NetworkType::MAINNET); wmgr->closeWallet(wallet); - wallet = wmgr->openWallet(WALLET_NAME_MAINNET, ""); + wallet = wmgr->openWallet(WALLET_NAME_MAINNET, "", Monero::NetworkType::MAINNET); std::unique_ptr<MyWalletListener> wallet_listener (new MyWalletListener(wallet)); @@ -1102,7 +1102,7 @@ TEST_F(WalletManagerMainnetTest, RecoverAndRefreshWalletMainNetAsync) // supposing 120 seconds should be enough for fast refresh int SECONDS_TO_REFRESH = 120; - Monero::Wallet * wallet = wmgr->createWallet(WALLET_NAME_MAINNET, "", WALLET_LANG); + Monero::Wallet * wallet = wmgr->createWallet(WALLET_NAME_MAINNET, "", WALLET_LANG, Monero::NetworkType::MAINNET); std::string seed = wallet->seed(); std::string address = wallet->mainAddress(); wmgr->closeWallet(wallet); @@ -1111,7 +1111,7 @@ TEST_F(WalletManagerMainnetTest, RecoverAndRefreshWalletMainNetAsync) Utils::deleteWallet(WALLET_NAME_MAINNET); // ..and recovering wallet from seed - wallet = wmgr->recoveryWallet(WALLET_NAME_MAINNET, seed); + wallet = wmgr->recoveryWallet(WALLET_NAME_MAINNET, seed, Monero::NetworkType::MAINNET); ASSERT_TRUE(wallet->status() == Monero::Wallet::Status_Ok); ASSERT_TRUE(wallet->mainAddress() == address); std::unique_ptr<MyWalletListener> wallet_listener (new MyWalletListener(wallet)); diff --git a/tests/performance_tests/generate_keypair.h b/tests/performance_tests/generate_keypair.h index f97f4c213..91c830166 100644 --- a/tests/performance_tests/generate_keypair.h +++ b/tests/performance_tests/generate_keypair.h @@ -45,7 +45,7 @@ public: bool test() { - cryptonote::keypair::generate(); + cryptonote::keypair::generate(hw::get_device("default")); return true; } }; |