remove statuslib from cmake

This commit is contained in:
Sale Djenic 2022-03-16 18:39:31 +01:00
parent 0dc7fb9fa5
commit 844543e69d
8 changed files with 22 additions and 67 deletions

View File

@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
project(Status DESCRIPTION "Status project" LANGUAGES CXX)
message("STATUS-APP-CMAKE_CXX_COMPILER_ID " ${CMAKE_CXX_COMPILER_ID})
message("STATUS-APP-CMAKE_CXX_COMPILER " ${CMAKE_CXX_COMPILER})
include("${CMAKE_SOURCE_DIR}/cmake/project-config.cmake")
include("${CMAKE_SOURCE_DIR}/cmake/conan.cmake")

View File

@ -13,7 +13,6 @@ target_link_libraries(
Qt5::Multimedia
Qt5::Concurrent
Status.Services
${STATUS_GO_LIB}
)
file(GLOB_RECURSE SOURCES

View File

@ -34,7 +34,7 @@ endif ()
check_translations()
add_dependencies(${PROJECT_NAME} ${STATUS_GO_LIB})
#add_dependencies(${PROJECT_NAME} ${STATUS_GO_LIB})
add_dependencies(${PROJECT_NAME} Status.Services)
target_sources(${PROJECT_NAME} PRIVATE ${SOURCES})

View File

@ -3,7 +3,7 @@
#include "GlobalEvents.h"
#include <QtConcurrent>
#include "libstatus.h"
//#include "libstatus.h"
using namespace Status;
@ -18,7 +18,7 @@ SignalsManager* SignalsManager::instance()
SignalsManager::SignalsManager()
: QObject(nullptr)
{
SetSignalEventCallback((void*)&SignalsManager::signalCallback);
//SetSignalEventCallback((void*)&SignalsManager::signalCallback);
signalMap = {
{"node.ready", SignalType::NodeReady},

View File

@ -93,7 +93,7 @@ namespace Backend
{
try
{
auto result = CallPrivateRPC(const_cast<QByteArray&>(payload).data());
auto result = ""; //CallPrivateRPC(const_cast<QByteArray&>(payload).data());
T jsonResult;
if(!Utils::checkReceivedResponse(result, jsonResult))
{

View File

@ -1,7 +1,7 @@
#include "StatusBackend/Accounts.h"
#include "StatusBackend/Utils.h"
#include "libstatus.h"
//#include "libstatus.h"
const int NUMBER_OF_ADDRESSES_TO_GENERATE = 5;
const int MNEMONIC_PHRASE_LENGTH = 12;
@ -19,7 +19,7 @@ RpcResponse<QJsonArray> Accounts::generateAddresses(const QVector<QString>& path
try
{
auto result = MultiAccountGenerateAndDeriveAddresses(Utils::jsonToByteArray(std::move(payload)).data());
auto result = ""; //MultiAccountGenerateAndDeriveAddresses(Utils::jsonToByteArray(std::move(payload)).data());
QJsonArray jsonResult;
if(!Utils::checkReceivedResponse(result, jsonResult))
{
@ -50,7 +50,7 @@ RpcResponse<QString> Accounts::generateIdenticon(const QString& publicKey)
QString identicon;
if(!publicKey.isEmpty())
{
identicon = Identicon(publicKey.toUtf8().data());
identicon = ""; //Identicon(publicKey.toUtf8().data());
}
return Utils::buildJsonRpcResponse(identicon);
}
@ -69,7 +69,8 @@ RpcResponse<QString> Accounts::generateAlias(const QString& publicKey)
QString alias;
if(!publicKey.isEmpty())
{
alias = GenerateAlias(publicKey.toUtf8().data());
alias = "";
//GenerateAlias(publicKey.toUtf8().data());
}
return Utils::buildJsonRpcResponse(alias);
@ -93,7 +94,8 @@ RpcResponse<QJsonObject> Accounts::storeDerivedAccounts(const QString& id, const
try
{
auto result = MultiAccountStoreDerivedAccounts(Utils::jsonToByteArray(std::move(payload)).data());
auto result = "";
//MultiAccountStoreDerivedAccounts(Utils::jsonToByteArray(std::move(payload)).data());
QJsonObject jsonResult;
if(!Utils::checkReceivedResponse(result, jsonResult))
{
@ -123,11 +125,8 @@ RpcResponse<QJsonObject> Accounts::saveAccountAndLogin(const QString& hashedPass
{
try
{
auto result = SaveAccountAndLogin(Utils::jsonToByteArray(std::move(account)).data(),
hashedPassword.toUtf8().data(),
Utils::jsonToByteArray(std::move(settings)).data(),
Utils::jsonToByteArray(std::move(nodeConfig)).data(),
Utils::jsonToByteArray(std::move(subaccounts)).data());
auto result = "";
//
QJsonObject jsonResult;
if(!Utils::checkReceivedResponse(result, jsonResult))
{
@ -155,7 +154,8 @@ Backend::RpcResponse<QJsonArray> Backend::Accounts::openAccounts(const QString&
{
try
{
auto result = OpenAccounts(path.toUtf8().data());
auto result = "";
//OpenAccounts(path.toUtf8().data());
QJsonArray jsonResult;
if(!Utils::checkReceivedResponse(result, jsonResult))
{
@ -196,7 +196,8 @@ RpcResponse<QJsonObject> Accounts::login(const QString& name, const QString& key
try
{
auto result = Login(Utils::jsonToByteArray(std::move(payload)).data(), hashedPassword.toUtf8().data());
auto result = "";
//Login(Utils::jsonToByteArray(std::move(payload)).data(), hashedPassword.toUtf8().data());
QJsonObject jsonResult;
if(!Utils::checkReceivedResponse(result, jsonResult))
{

View File

@ -5,7 +5,7 @@
namespace Status::Constants
{
const std::array SigningPhrases {
static const std::array SigningPhrases {
"area", "army", "atom", "aunt", "babe", "baby", "back", "bail", "bait", "bake", "ball", "band", "bank", "barn",
"base", "bass", "bath", "bead", "beak", "beam", "bean", "bear", "beat", "beef", "beer", "beet", "bell", "belt",
"bend", "bike", "bill", "bird", "bite", "blow", "blue", "boar", "boat", "body", "bolt", "bomb", "bone", "book",

View File

@ -15,21 +15,7 @@ void Service::init()
void Service::fetchAccounts()
{
auto response = Backend::Wallet::Accounts::getAccounts();
if(response.containsError())
{
qWarning() << response.error.message;
return;
}
foreach(const auto& value, response.result)
{
auto account = WalletAccountDto::toWalletAccountDto(value.toObject());
if(!account.isChat)
{
m_walletAccounts[account.address] = std::move(account);
}
}
}
void Service::refreshAccounts()
@ -44,65 +30,30 @@ QList<WalletAccountDto> Service::getWalletAccounts()
QString Service::generateNewAccount(const QString& password, const QString& accountName, const QString& color)
{
auto response = Backend::Wallet::Accounts::generateNewAccount(password, accountName, color);
if(response.containsError())
{
qWarning() << response.error.message;
return response.error.message;
}
refreshAccounts();
return QString();
}
QString Service::addAccountsFromPrivateKey(const QString& privateKey, const QString& password,
const QString& accountName, const QString& color)
{
auto response = Backend::Wallet::Accounts::addAccountsFromPrivateKey(privateKey, password, accountName, color);
if(response.containsError())
{
qWarning() << response.error.message;
return response.error.message;
}
refreshAccounts();
return QString();
}
QString Service::addAccountsFromSeed(const QString& seedPhrase, const QString& password, const QString& accountName, const QString& color)
{
auto response = Backend::Wallet::Accounts::addAccountsFromSeed(seedPhrase, password, accountName, color);
if(response.containsError())
{
qWarning() << response.error.message;
return response.error.message;
}
refreshAccounts();
return QString();
}
QString Service::addWatchOnlyAccount(const QString& address, const QString& accountName , const QString& color)
{
auto response = Backend::Wallet::Accounts::addWatchOnlyAccount(address, accountName, color);
if(response.containsError())
{
qWarning() << response.error.message;
return response.error.message;
}
refreshAccounts();
return QString();
}
void Service::deleteAccount(const QString& address)
{
auto response = Backend::Wallet::Accounts::deleteAccount(address);
if(response.containsError())
{
qWarning() << response.error.message;
return;
}
refreshAccounts();
}