Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptozoidberg committed Nov 12, 2020
2 parents 6154e2f + f099ca9 commit 04ba1f6
Show file tree
Hide file tree
Showing 142 changed files with 20,652 additions and 1,332 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(Boost_LIBRARY_DIRS "/Users/roky/projects/Zano/mobile_repo/ofxiOSBoost/libs/boost/ios/")
set(Boost_LIBRARIES "libboost.a")
set(Boost_VERSION "ofxiOSBoost 1.60.0")
#workaround for new XCode 12 policy for builds(now it includes a slice for the "arm64" when builds for simulator)
set(__iphoneos_archs "armv7 armv7s arm64")
set(__iphonesimulator_archs "i386 x86_64")
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "${__iphoneos_archs}")
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "${__iphoneos_archs}")
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "${__iphonesimulator_archs}")
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "${__iphonesimulator_archs}")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
set(Boost_INCLUDE_DIRS "/Users/roky/projects/Zano/mobile_repo/Boost-for-Android-Prebuilt/1.69.0/include")
set(Boost_LIBRARY_DIRS "/Users/roky/projects/Zano/mobile_repo/Boost-for-Android-Prebuilt/1.69.0/libs/llvm/${CMAKE_ANDROID_ARCH_ABI}/")
Expand Down
4 changes: 3 additions & 1 deletion contrib/db/liblmdb/mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ extern int cacheflush(char *addr, int nbytes, int cache);

#ifdef _WIN32
typedef int64_t off64_t;
#elif __APPLE__
typedef off_t off64_t;
#else
//typedef off_t off64_t;

#endif


Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ MACRO(INIT_SHARED_PCH)
IF(MSVC)
set_property(SOURCE "pch/stdafx.cpp" APPEND_STRING PROPERTY COMPILE_FLAGS " /Fo$(OutDir) /Z7 /Fd$(OutDir)vc$(PlatformToolsetVersion).pdb /Ycstdafx.h /Fp$(TargetDir)pch.pch")
ELSEIF(APPLE OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
cmake_minimum_required(VERSION 3.16)
target_precompile_headers(pch PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/pch/stdafx.h")
ENDIF()
ENDIF(USE_PCH)
Expand Down Expand Up @@ -75,6 +76,7 @@ if(BUILD_GUI)
else()
file(GLOB_RECURSE QTDAEMON gui/qt-daemon/*.cpp gui/qt-daemon/*.h)
endif()
list(FILTER QTDAEMON EXCLUDE REGEX "node_modules")
endif()


Expand Down
4 changes: 2 additions & 2 deletions src/common/error_codes.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
#define API_RETURN_CODE_GENESIS_MISMATCH "GENESIS_MISMATCH"
#define API_RETURN_CODE_DISCONNECTED "DISCONNECTED"
#define API_RETURN_CODE_UNINITIALIZED "UNINITIALIZED"


#define API_RETURN_CODE_TX_IS_TOO_BIG "TX_IS_TOO_BIG"
#define API_RETURN_CODE_TX_REJECTED "TX_REJECTED"
2 changes: 2 additions & 0 deletions src/currency_core/account.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ namespace currency
bool store(const std::string& file_path);

void make_account_watch_only();
bool is_watch_only() const { return m_keys.spend_secret_key == currency::null_skey; }
bool is_auditable() const { return m_keys.account_address.is_auditable(); }

template <class t_archive>
inline void serialize(t_archive &a, const unsigned int /*ver*/)
Expand Down
54 changes: 43 additions & 11 deletions src/gui/qt-daemon/application/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,28 @@ QString MainWindow::get_tx_pool_info()
CATCH_ENTRY_FAIL_API_RESPONCE();
}

QString MainWindow::request_dummy()
{
static int code_ = 0;
TRY_ENTRY();
LOG_API_TIMING();
PREPARE_RESPONSE(currency::COMMAND_RPC_GET_POOL_INFO::response, ar);
if (code_ == 2)
{
code_ = -1;
ar.error_code = API_RETURN_CODE_CORE_BUSY;
}
else
{
ar.error_code = API_RETURN_CODE_OK;
}

++code_;
return MAKE_RESPONSE(ar);
CATCH_ENTRY_FAIL_API_RESPONCE();
}


QString MainWindow::get_default_fee()
{
TRY_ENTRY();
Expand Down Expand Up @@ -734,15 +756,8 @@ QString MainWindow::is_remnotenode_mode_preconfigured()
QString MainWindow::start_backend(const QString& params)
{
TRY_ENTRY();
view::start_backend_params sbp = AUTO_VAL_INIT(sbp);
view::api_response ar = AUTO_VAL_INIT(ar);

if (!epee::serialization::load_t_from_json(sbp, params.toStdString()))
{
ar.error_code = API_RETURN_CODE_BAD_ARG;
return MAKE_RESPONSE(ar);
}

bool r = m_backend.start();
if (!r)
{
Expand All @@ -758,13 +773,18 @@ bool MainWindow::update_wallet_status(const view::wallet_status_info& wsi)
{
TRY_ENTRY();
m_wallet_states->operator [](wsi.wallet_id) = wsi.wallet_state;

std::string json_str_pub;
epee::serialization::store_t_to_json(static_cast<const view::wallet_status_info_base&>(wsi), json_str_pub, 0, epee::serialization::eol_lf);
LOG_PRINT_L0(get_wallet_log_prefix(wsi.wallet_id) + "SENDING SIGNAL -> [update_wallet_status]:" << std::endl << json_str_pub);

std::string json_str;
epee::serialization::store_t_to_json(wsi, json_str, 0, epee::serialization::eol_lf);
LOG_PRINT_L0(get_wallet_log_prefix(wsi.wallet_id) + "SENDING SIGNAL -> [update_wallet_status]:" << std::endl << json_str );
QMetaObject::invokeMethod(this, "update_wallet_status", Qt::QueuedConnection, Q_ARG(QString, json_str.c_str()));
return true;
CATCH_ENTRY2(false);
}

bool MainWindow::set_options(const view::gui_options& opt)
{
TRY_ENTRY();
Expand Down Expand Up @@ -920,6 +940,15 @@ QString MainWindow::get_os_version()
CATCH_ENTRY2(API_RETURN_CODE_INTERNAL_ERROR);
}

QString MainWindow::get_network_type()
{
#if defined(TESTNET)
return "testnet";
#else
return "mainnet";
#endif
}

QString MainWindow::get_alias_coast(const QString& param)
{
TRY_ENTRY();
Expand All @@ -946,9 +975,12 @@ QString MainWindow::set_localization_strings(const QString param)
else
{
m_localization = lr.strings;
m_quit_action->setText(QString().fromUtf8(m_localization[localization_id_quit].c_str()));
m_restore_action->setText(QString().fromUtf8(m_localization[localization_id_tray_menu_show].c_str()));
m_minimize_action->setText(QString().fromUtf8(m_localization[localization_id_tray_menu_minimize].c_str()));
if(m_quit_action)
m_quit_action->setText(QString::fromStdString(m_localization[localization_id_quit]));
if(m_restore_action)
m_restore_action->setText(QString::fromStdString(m_localization[localization_id_tray_menu_show]));
if(m_minimize_action)
m_minimize_action->setText(QString::fromStdString(m_localization[localization_id_tray_menu_minimize]));
resp.error_code = API_RETURN_CODE_OK;
LOG_PRINT_L0("New localization set, language title: " << lr.language_title << ", strings " << lr.strings.size());
}
Expand Down
4 changes: 4 additions & 0 deletions src/gui/qt-daemon/application/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class MainWindow : public QMainWindow,

QString get_version();
QString get_os_version();
QString get_network_type();
QString transfer(const QString& json_transfer_object);
QString have_secure_app_data();
QString drop_secure_app_data();
Expand Down Expand Up @@ -158,6 +159,9 @@ class MainWindow : public QMainWindow,
QString is_remnotenode_mode_preconfigured();
QString start_backend(const QString& params);

//for test purposes onlys
QString request_dummy();

signals:
void quit_requested(const QString str);
void update_daemon_state(const QString str);
Expand Down
10 changes: 8 additions & 2 deletions src/gui/qt-daemon/html/assets/i18n/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@
"TIME3": "1 hour",
"TIME4": "Never"
},
"SCALE": {
"75": "75% scale",
"100": "100% scale",
"125": "125% scale",
"150": "150% scale"
},
"MASTER_PASSWORD": {
"TITLE": "Update master password",
"OLD": "Old password",
Expand Down Expand Up @@ -194,7 +200,7 @@
"ASSIGN_ALIAS": {
"NAME": {
"LABEL": "Alias",
"PLACEHOLDER": "@ Enter alias",
"PLACEHOLDER": " Enter alias",
"TOOLTIP": "An alias is a shortened form or your account. An alias can only include Latin letters, numbers and characters “.” and “-”. It must start with “@”."
},
"COMMENT": {
Expand All @@ -206,7 +212,7 @@
"BUTTON_ASSIGN": "Assign",
"FORM_ERRORS": {
"NAME_REQUIRED": "Name is required",
"NAME_WRONG": "Alias has wrong name",
"NAME_WRONG": "Invalid name: allowed symbols \"0-9\", \"a-z\", \"-\", \".\"",
"NAME_LENGTH": "The alias must be 6-25 characters long",
"NAME_EXISTS": "Alias name already exists",
"NO_MONEY": "You do not have enough funds to assign this alias",
Expand Down
10 changes: 8 additions & 2 deletions src/gui/qt-daemon/html/assets/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@
"TIME3": "1 hour",
"TIME4": "Never"
},
"SCALE": {
"75": "75% scale",
"100": "100% scale",
"125": "125% scale",
"150": "150% scale"
},
"MASTER_PASSWORD": {
"TITLE": "Update master password",
"OLD": "Old password",
Expand Down Expand Up @@ -194,7 +200,7 @@
"ASSIGN_ALIAS": {
"NAME": {
"LABEL": "Alias",
"PLACEHOLDER": "@ Enter alias",
"PLACEHOLDER": " Enter alias",
"TOOLTIP": "An alias is a shortened form or your account. An alias can only include Latin letters, numbers and characters “.” and “-”. It must start with “@”."
},
"COMMENT": {
Expand All @@ -206,7 +212,7 @@
"BUTTON_ASSIGN": "Assign",
"FORM_ERRORS": {
"NAME_REQUIRED": "Name is required",
"NAME_WRONG": "Alias has wrong name",
"NAME_WRONG": "Invalid name: allowed symbols \"0-9\", \"a-z\", \"-\", \".\"",
"NAME_LENGTH": "The alias must be 6-25 characters long",
"NAME_EXISTS": "Alias name already exists",
"NO_MONEY": "You do not have enough funds to assign this alias",
Expand Down
10 changes: 8 additions & 2 deletions src/gui/qt-daemon/html/assets/i18n/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@
"TIME3": "1 hour",
"TIME4": "Never"
},
"SCALE": {
"75": "75% scale",
"100": "100% scale",
"125": "125% scale",
"150": "150% scale"
},
"MASTER_PASSWORD": {
"TITLE": "Update master password",
"OLD": "Old password",
Expand Down Expand Up @@ -194,7 +200,7 @@
"ASSIGN_ALIAS": {
"NAME": {
"LABEL": "Alias",
"PLACEHOLDER": "@ Enter alias",
"PLACEHOLDER": " Enter alias",
"TOOLTIP": "An alias is a shortened form or your account. An alias can only include Latin letters, numbers and characters “.” and “-”. It must start with “@”."
},
"COMMENT": {
Expand All @@ -206,7 +212,7 @@
"BUTTON_ASSIGN": "Assign",
"FORM_ERRORS": {
"NAME_REQUIRED": "Name is required",
"NAME_WRONG": "Alias has wrong name",
"NAME_WRONG": "Invalid name: allowed symbols \"0-9\", \"a-z\", \"-\", \".\"",
"NAME_LENGTH": "The alias must be 6-25 characters long",
"NAME_EXISTS": "Alias name already exists",
"NO_MONEY": "You do not have enough funds to assign this alias",
Expand Down
10 changes: 8 additions & 2 deletions src/gui/qt-daemon/html/assets/i18n/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@
"TIME3": "1 hour",
"TIME4": "Never"
},
"SCALE": {
"75": "75% scale",
"100": "100% scale",
"125": "125% scale",
"150": "150% scale"
},
"MASTER_PASSWORD": {
"TITLE": "Update master password",
"OLD": "Old password",
Expand Down Expand Up @@ -194,7 +200,7 @@
"ASSIGN_ALIAS": {
"NAME": {
"LABEL": "Alias",
"PLACEHOLDER": "@ Enter alias",
"PLACEHOLDER": " Enter alias",
"TOOLTIP": "An alias is a shortened form or your account. An alias can only include Latin letters, numbers and characters “.” and “-”. It must start with “@”."
},
"COMMENT": {
Expand All @@ -206,7 +212,7 @@
"BUTTON_ASSIGN": "Assign",
"FORM_ERRORS": {
"NAME_REQUIRED": "Name is required",
"NAME_WRONG": "Alias has wrong name",
"NAME_WRONG": "Invalid name: allowed symbols \"0-9\", \"a-z\", \"-\", \".\"",
"NAME_LENGTH": "The alias must be 6-25 characters long",
"NAME_EXISTS": "Alias name already exists",
"NO_MONEY": "You do not have enough funds to assign this alias",
Expand Down
10 changes: 8 additions & 2 deletions src/gui/qt-daemon/html/assets/i18n/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@
"TIME3": "1 hour",
"TIME4": "Never"
},
"SCALE": {
"75": "75% scale",
"100": "100% scale",
"125": "125% scale",
"150": "150% scale"
},
"MASTER_PASSWORD": {
"TITLE": "Update master password",
"OLD": "Old password",
Expand Down Expand Up @@ -194,7 +200,7 @@
"ASSIGN_ALIAS": {
"NAME": {
"LABEL": "Alias",
"PLACEHOLDER": "@ Enter alias",
"PLACEHOLDER": " Enter alias",
"TOOLTIP": "An alias is a shortened form or your account. An alias can only include Latin letters, numbers and characters “.” and “-”. It must start with “@”."
},
"COMMENT": {
Expand All @@ -206,7 +212,7 @@
"BUTTON_ASSIGN": "Assign",
"FORM_ERRORS": {
"NAME_REQUIRED": "Name is required",
"NAME_WRONG": "Alias has wrong name",
"NAME_WRONG": "Invalid name: allowed symbols \"0-9\", \"a-z\", \"-\", \".\"",
"NAME_LENGTH": "The alias must be 6-25 characters long",
"NAME_EXISTS": "Alias name already exists",
"NO_MONEY": "You do not have enough funds to assign this alias",
Expand Down
10 changes: 8 additions & 2 deletions src/gui/qt-daemon/html/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@
"TIME3": "1 Stunde",
"TIME4": "Nie"
},
"SCALE": {
"75": "75% Rahmen",
"100": "100% Rahmen",
"125": "125% Rahmen",
"150": "150% Rahmen"
},
"MASTER_PASSWORD": {
"TITLE": "Master-Passwort aktualisieren",
"OLD": "Altes Passwort",
Expand Down Expand Up @@ -194,7 +200,7 @@
"ASSIGN_ALIAS": {
"NAME": {
"LABEL": "Alias",
"PLACEHOLDER": "@ Alias eingeben",
"PLACEHOLDER": " Alias eingeben",
"TOOLTIP": "Ein Alias ist eine verkürzte Form Ihres Kontos. Ein Alias kann nur lateinische Buchstaben, Zahlen und die Zeichen „.“ und “-” enthalten. Es muss mit “@” beginnen."
},
"COMMENT": {
Expand All @@ -206,7 +212,7 @@
"BUTTON_ASSIGN": "Zuweisen",
"FORM_ERRORS": {
"NAME_REQUIRED": "Name ist erforderlich",
"NAME_WRONG": "Alias hat einen falschen Namen",
"NAME_WRONG": "Ungültiger Name: zulässige Symbole \"0-9\", \"a-z\", \"-\", \".\"",
"NAME_LENGTH": "Der Alias muss 6-25 Zeichen lang sein",
"NAME_EXISTS": "Alias-Name existiert bereits",
"NO_MONEY": "Du hast nicht genug Geldmittel, um diesen Alias zuzuweisen",
Expand Down
8 changes: 7 additions & 1 deletion src/gui/qt-daemon/html/assets/i18n/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@
"TIME3": "1 hour",
"TIME4": "Never"
},
"SCALE": {
"75": "75% scale",
"100": "100% scale",
"125": "125% scale",
"150": "150% scale"
},
"MASTER_PASSWORD": {
"TITLE": "Update master password",
"OLD": "Old password",
Expand Down Expand Up @@ -194,7 +200,7 @@
"ASSIGN_ALIAS": {
"NAME": {
"LABEL": "Alias",
"PLACEHOLDER": "@ Enter alias",
"PLACEHOLDER": " Enter alias",
"TOOLTIP": "An alias is a shortened form or your account. An alias can only include Latin letters, numbers and characters “.” and “-”. It must start with “@”."
},
"COMMENT": {
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qt-daemon/html/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
"ASSIGN_ALIAS": {
"NAME": {
"LABEL": "Alias",
"PLACEHOLDER": "@ Enter alias",
"PLACEHOLDER": " Enter alias",
"TOOLTIP": "An alias is a shortened form or your account. An alias can only include Latin letters, numbers and characters “.” and “-”. It must start with “@”."
},
"COMMENT": {
Expand All @@ -235,7 +235,7 @@
"BUTTON_ASSIGN": "Assign",
"FORM_ERRORS": {
"NAME_REQUIRED": "Name is required",
"NAME_WRONG": "Alias has wrong name",
"NAME_WRONG": "Invalid name: allowed symbols \"0-9\", \"a-z\", \"-\", \".\"",
"NAME_LENGTH": "The alias must be 6-25 characters long",
"NAME_EXISTS": "Alias name already exists",
"NO_MONEY": "You do not have enough funds to assign this alias",
Expand Down
Loading

0 comments on commit 04ba1f6

Please sign in to comment.