From ca234008b9521e438072b44b0d97756665c79abb Mon Sep 17 00:00:00 2001 From: dsc Date: Fri, 20 May 2022 17:40:22 +0200 Subject: [PATCH] wowify seed --- CMakeLists.txt | 19 ++----------------- src/CMakeLists.txt | 4 ++-- src/appcontext.cpp | 2 +- src/utils/RestoreHeightLookup.h | 2 +- src/utils/WowletSeed.h | 10 +++++----- src/utils/utils.h | 2 +- src/wizard/restorewallet.cpp | 2 +- 7 files changed, 13 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 25e2e37..ed6cb5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,23 +119,8 @@ set(HIDAPI_FOUND OFF) # QrEncode find_package(QREncode REQUIRED) -# Tevador 14 word Monero seed -find_package(monero-seed CONFIG) -if(NOT monero-seed_FOUND) - if(FETCH_DEPS) - FetchContent_Declare(monero-seed - GIT_REPOSITORY https://git.wownero.com/wowlet/monero-seed.git) - FetchContent_GetProperties(monero-seed) - if(NOT monero-seed_POPULATED) - message(STATUS "Fetching monero-seed") - FetchContent_Populate(monero-seed) - add_subdirectory(${monero-seed_SOURCE_DIR} ${monero-seed_BINARY_DIR}) - endif() - add_library(monero-seed::monero-seed ALIAS monero-seed) - else() - message(FATAL_ERROR "monero-seed was not installed and fetching deps is disabled") - endif() -endif() +# Tevador 14 word seed (https://git.wownero.com/wowlet/wownero-seed) +find_package(wownero-seed CONFIG REQUIRED) # Boost if(DEBUG) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0a57784..a2bd057 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -225,9 +225,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") if(UNIX AND NOT APPLE) # https://stackoverflow.com/questions/57766620/cmake-add-library-doesnt-initialize-static-global-variable # so that contrib/monero-seed/src/gf_elem.cpp properly initializes. A better solution is welcome. - target_link_libraries(wowlet PUBLIC -Wl,--whole-archive monero-seed::monero-seed -Wl,--no-whole-archive) + target_link_libraries(wowlet PUBLIC -Wl,--whole-archive wownero-seed::wownero-seed -Wl,--no-whole-archive) else() - target_link_libraries(wowlet PUBLIC monero-seed::monero-seed) + target_link_libraries(wowlet PUBLIC wownero-seed::wownero-seed) endif() if(ANDROID) diff --git a/src/appcontext.cpp b/src/appcontext.cpp index 694760a..caa8f8f 100644 --- a/src/appcontext.cpp +++ b/src/appcontext.cpp @@ -660,7 +660,7 @@ void AppContext::createWallet(WowletSeed seed, const QString &path, const QStrin wallet = this->walletManager->createDeterministicWalletFromSpendKey(path, password, seed.language, this->networkType, seed.spendKey, seed.restoreHeight, this->kdfRounds); wallet->setCacheAttribute("wowlet.seed", seed.mnemonic.join(" ")); } - if (seed.seedType == SeedType::MONERO) { + if (seed.seedType == SeedType::WOWNERO) { wallet = this->walletManager->recoveryWallet(path, password, seed.mnemonic.join(" "), "", this->networkType, seed.restoreHeight, this->kdfRounds); } diff --git a/src/utils/RestoreHeightLookup.h b/src/utils/RestoreHeightLookup.h index 5018a39..844ab2c 100644 --- a/src/utils/RestoreHeightLookup.h +++ b/src/utils/RestoreHeightLookup.h @@ -7,7 +7,7 @@ #include #include -#include +#include #include "networktype.h" #include "utils/utils.h" diff --git a/src/utils/WowletSeed.h b/src/utils/WowletSeed.h index 856230e..77f861a 100644 --- a/src/utils/WowletSeed.h +++ b/src/utils/WowletSeed.h @@ -8,7 +8,7 @@ #include "RestoreHeightLookup.h" enum SeedType { - MONERO = 0, // 25 word seeds + WOWNERO = 0, // 25 word seeds TEVADOR // 14 word seeds }; @@ -28,7 +28,7 @@ struct WowletSeed { QString errorString; explicit WowletSeed(RestoreHeightLookup *lookup, - const QString &coin = "monero", + const QString &coin = "wownero", const QString &language = "English", const QStringList &mnemonic = {}) : lookup(lookup), coin(coin), language(language), mnemonic(mnemonic) @@ -36,7 +36,7 @@ struct WowletSeed { // Generate a new mnemonic if none was given if (this->mnemonic.length() == 0) { this->time = std::time(nullptr); - monero_seed seed(this->time, coin.toStdString()); + wownero_seed seed(this->time, coin.toStdString()); std::stringstream buffer; buffer << seed; @@ -50,7 +50,7 @@ struct WowletSeed { } if (this->mnemonic.length() == 25) { - this->seedType = SeedType::MONERO; + this->seedType = SeedType::WOWNERO; } else if (this->mnemonic.length() == 14) { this->seedType = SeedType::TEVADOR; @@ -61,7 +61,7 @@ struct WowletSeed { if (seedType == SeedType::TEVADOR) { try { - monero_seed seed(this->mnemonic.join(" ").toStdString(), coin.toStdString()); + wownero_seed seed(this->mnemonic.join(" ").toStdString(), coin.toStdString()); this->time = seed.date(); this->setRestoreHeight(); diff --git a/src/utils/utils.h b/src/utils/utils.h index fe12914..a2ca24e 100644 --- a/src/utils/utils.h +++ b/src/utils/utils.h @@ -12,7 +12,7 @@ #include #endif -#include +#include #include "networktype.h" #include "libwalletqt/Wallet.h" diff --git a/src/wizard/restorewallet.cpp b/src/wizard/restorewallet.cpp index 83738dd..0430c2b 100644 --- a/src/wizard/restorewallet.cpp +++ b/src/wizard/restorewallet.cpp @@ -9,7 +9,7 @@ #include #include -#include // tevador 14 word +#include // tevador 14 word #include "utils/WowletSeed.h" RestorePage::RestorePage(AppContext *ctx, QWidget *parent) :