Merge pull request 'wowify seed' (#105) from wownero-seed into master

Reviewed-on: https://git.wownero.com/wowlet/wowlet/pulls/105
This commit is contained in:
dsc 2022-05-20 15:41:05 +00:00
commit 4098e8c0e5
7 changed files with 13 additions and 28 deletions

View file

@ -119,23 +119,8 @@ set(HIDAPI_FOUND OFF)
# QrEncode # QrEncode
find_package(QREncode REQUIRED) find_package(QREncode REQUIRED)
# Tevador 14 word Monero seed # Tevador 14 word seed (https://git.wownero.com/wowlet/wownero-seed)
find_package(monero-seed CONFIG) find_package(wownero-seed CONFIG REQUIRED)
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()
# Boost # Boost
if(DEBUG) if(DEBUG)

View file

@ -225,9 +225,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
# https://stackoverflow.com/questions/57766620/cmake-add-library-doesnt-initialize-static-global-variable # 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. # 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() else()
target_link_libraries(wowlet PUBLIC monero-seed::monero-seed) target_link_libraries(wowlet PUBLIC wownero-seed::wownero-seed)
endif() endif()
if(ANDROID) if(ANDROID)

View file

@ -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 = this->walletManager->createDeterministicWalletFromSpendKey(path, password, seed.language, this->networkType, seed.spendKey, seed.restoreHeight, this->kdfRounds);
wallet->setCacheAttribute("wowlet.seed", seed.mnemonic.join(" ")); 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); wallet = this->walletManager->recoveryWallet(path, password, seed.mnemonic.join(" "), "", this->networkType, seed.restoreHeight, this->kdfRounds);
} }

View file

@ -7,7 +7,7 @@
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <monero_seed/monero_seed.hpp> #include <wownero_seed/wownero_seed.hpp>
#include "networktype.h" #include "networktype.h"
#include "utils/utils.h" #include "utils/utils.h"

View file

@ -8,7 +8,7 @@
#include "RestoreHeightLookup.h" #include "RestoreHeightLookup.h"
enum SeedType { enum SeedType {
MONERO = 0, // 25 word seeds WOWNERO = 0, // 25 word seeds
TEVADOR // 14 word seeds TEVADOR // 14 word seeds
}; };
@ -28,7 +28,7 @@ struct WowletSeed {
QString errorString; QString errorString;
explicit WowletSeed(RestoreHeightLookup *lookup, explicit WowletSeed(RestoreHeightLookup *lookup,
const QString &coin = "monero", const QString &coin = "wownero",
const QString &language = "English", const QString &language = "English",
const QStringList &mnemonic = {}) const QStringList &mnemonic = {})
: lookup(lookup), coin(coin), language(language), mnemonic(mnemonic) : lookup(lookup), coin(coin), language(language), mnemonic(mnemonic)
@ -36,7 +36,7 @@ struct WowletSeed {
// Generate a new mnemonic if none was given // Generate a new mnemonic if none was given
if (this->mnemonic.length() == 0) { if (this->mnemonic.length() == 0) {
this->time = std::time(nullptr); this->time = std::time(nullptr);
monero_seed seed(this->time, coin.toStdString()); wownero_seed seed(this->time, coin.toStdString());
std::stringstream buffer; std::stringstream buffer;
buffer << seed; buffer << seed;
@ -50,7 +50,7 @@ struct WowletSeed {
} }
if (this->mnemonic.length() == 25) { if (this->mnemonic.length() == 25) {
this->seedType = SeedType::MONERO; this->seedType = SeedType::WOWNERO;
} }
else if (this->mnemonic.length() == 14) { else if (this->mnemonic.length() == 14) {
this->seedType = SeedType::TEVADOR; this->seedType = SeedType::TEVADOR;
@ -61,7 +61,7 @@ struct WowletSeed {
if (seedType == SeedType::TEVADOR) { if (seedType == SeedType::TEVADOR) {
try { try {
monero_seed seed(this->mnemonic.join(" ").toStdString(), coin.toStdString()); wownero_seed seed(this->mnemonic.join(" ").toStdString(), coin.toStdString());
this->time = seed.date(); this->time = seed.date();
this->setRestoreHeight(); this->setRestoreHeight();

View file

@ -12,7 +12,7 @@
#include <QtAndroid> #include <QtAndroid>
#endif #endif
#include <monero_seed/monero_seed.hpp> #include <wownero_seed/wownero_seed.hpp>
#include "networktype.h" #include "networktype.h"
#include "libwalletqt/Wallet.h" #include "libwalletqt/Wallet.h"

View file

@ -9,7 +9,7 @@
#include <QPlainTextEdit> #include <QPlainTextEdit>
#include <QMessageBox> #include <QMessageBox>
#include <monero_seed/wordlist.hpp> // tevador 14 word #include <wownero_seed/wordlist.hpp> // tevador 14 word
#include "utils/WowletSeed.h" #include "utils/WowletSeed.h"
RestorePage::RestorePage(AppContext *ctx, QWidget *parent) : RestorePage::RestorePage(AppContext *ctx, QWidget *parent) :