mirror of
https://git.wownero.com/wowlet/wowlet.git
synced 2024-08-15 01:03:14 +00:00
wowify seed
This commit is contained in:
parent
2ebb41a371
commit
ca234008b9
7 changed files with 13 additions and 28 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
#include <monero_seed/monero_seed.hpp>
|
||||
#include <wownero_seed/wownero_seed.hpp>
|
||||
|
||||
#include "networktype.h"
|
||||
#include "utils/utils.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();
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include <QtAndroid>
|
||||
#endif
|
||||
|
||||
#include <monero_seed/monero_seed.hpp>
|
||||
#include <wownero_seed/wownero_seed.hpp>
|
||||
|
||||
#include "networktype.h"
|
||||
#include "libwalletqt/Wallet.h"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <QPlainTextEdit>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <monero_seed/wordlist.hpp> // tevador 14 word
|
||||
#include <wownero_seed/wordlist.hpp> // tevador 14 word
|
||||
#include "utils/WowletSeed.h"
|
||||
|
||||
RestorePage::RestorePage(AppContext *ctx, QWidget *parent) :
|
||||
|
|
Loading…
Reference in a new issue