diff --git a/CellFrameDashboardService/DapChainHistoryHandler.cpp b/CellFrameDashboardService/DapChainHistoryHandler.cpp index 9dfbfa5871f256e51a6bced002e21c19bff87f8c..136e34841e8ccff176082c7511a2ddf149e8c854 100644 --- a/CellFrameDashboardService/DapChainHistoryHandler.cpp +++ b/CellFrameDashboardService/DapChainHistoryHandler.cpp @@ -22,7 +22,7 @@ void DapChainHistoryHandler::onRequestNewHistory(const QMap<QString, QVariant>& for(int i = 0; i < wallets.count(); i++) { QProcess process; - process.start(QString(CLI_PATH) + " tx_history -net " + m_CurrentNetwork + " -chain gdb -addr " + wallets.at(i).toString()); + process.start(QString("%1 tx_history -net %2 -chain gdb -addr %3").arg(CLI_PATH).arg(m_CurrentNetwork).arg(wallets.at(i).toString())); process.waitForFinished(-1); QByteArray result = process.readAll(); @@ -51,6 +51,7 @@ void DapChainHistoryHandler::onRequestNewHistory(const QMap<QString, QVariant>& void DapChainHistoryHandler::setCurrentNetwork(const QString& aNetwork) { - if(aNetwork == m_CurrentNetwork) return; + if(aNetwork == m_CurrentNetwork) + return; m_CurrentNetwork = aNetwork; } diff --git a/CellFrameDashboardService/DapChainHistoryHandler.h b/CellFrameDashboardService/DapChainHistoryHandler.h index 221a0ae6fd424c785d9cf389c00e8b0dd446dd45..6b56f6e35801057ea3d67c547cc0e64d7b904feb 100644 --- a/CellFrameDashboardService/DapChainHistoryHandler.h +++ b/CellFrameDashboardService/DapChainHistoryHandler.h @@ -31,6 +31,8 @@ public slots: /// Request new tx history /// @param wallet list void onRequestNewHistory(const QMap<QString, QVariant>& aWallets); + /// Set current network + /// @param name of network void setCurrentNetwork(const QString& aNetwork); signals: diff --git a/CellFrameDashboardService/DapChainNodeNetworkHandler.cpp b/CellFrameDashboardService/DapChainNodeNetworkHandler.cpp index 27411397d43c924e173f82b4369507e1a86b59b0..52fda1159009e3ef01df630316192ec216ec02ee 100644 --- a/CellFrameDashboardService/DapChainNodeNetworkHandler.cpp +++ b/CellFrameDashboardService/DapChainNodeNetworkHandler.cpp @@ -9,7 +9,7 @@ DapChainNodeNetworkHandler::DapChainNodeNetworkHandler(QObject *parent) : QObjec QVariant DapChainNodeNetworkHandler::getNodeNetwork() const { QProcess process; - process.start(QString(CLI_PATH) + " node dump -net " + m_CurrentNetwork + " -full"); + process.start(QString("%1 node dump -net %2 -full").arg(CLI_PATH).arg(m_CurrentNetwork)); process.waitForFinished(-1); QByteArray result = process.readAll(); @@ -69,7 +69,8 @@ QVariant DapChainNodeNetworkHandler::getNodeNetwork() const void DapChainNodeNetworkHandler::setCurrentNetwork(const QString& aNetwork) { - if(m_CurrentNetwork == aNetwork) return; + if(m_CurrentNetwork == aNetwork) + return; m_CurrentNetwork = aNetwork; } diff --git a/CellFrameDashboardService/DapChainNodeNetworkHandler.h b/CellFrameDashboardService/DapChainNodeNetworkHandler.h index ad148d42dfe589ae63776ba7006f3e37dea582f4..ab57a373debb8cb82ee3a880f4b1326f2723823e 100644 --- a/CellFrameDashboardService/DapChainNodeNetworkHandler.h +++ b/CellFrameDashboardService/DapChainNodeNetworkHandler.h @@ -26,7 +26,8 @@ public slots: /// Get new node network /// @return data of node network QVariant getNodeNetwork() const; - + /// Set current network + /// @param name of network void setCurrentNetwork(const QString& aNetwork); }; diff --git a/CellFrameDashboardService/DapChainWalletHandler.cpp b/CellFrameDashboardService/DapChainWalletHandler.cpp index 537053a7251577d3878148f714803de8852f151a..4da008ac980a5c0b0b36a7d7f7c5ae45b89b76c1 100755 --- a/CellFrameDashboardService/DapChainWalletHandler.cpp +++ b/CellFrameDashboardService/DapChainWalletHandler.cpp @@ -94,12 +94,13 @@ QString DapChainWalletHandler::sendToken(const QString &asSendWallet, const QStr QString answer; qInfo() << QString("sendTokenTest(%1, %2, %3, %4)").arg(asSendWallet).arg(asAddressReceiver).arg(asToken).arg(aAmount); QProcess processCreate; - processCreate.start(QString("%1 tx_create -net " + m_CurrentNetwork +" -chain gdb -from_wallet %2 -to_addr %3 -token %4 -value %5") + processCreate.start(QString("%1 tx_create -net %2 -chain gdb -from_wallet %3 -to_addr %4 -token %5 -value %6") .arg(CLI_PATH) + .arg(m_CurrentNetwork) .arg(asSendWallet) .arg(asAddressReceiver) .arg(asToken) - .arg(aAmount)); + .arg(aAmount) ); processCreate.waitForFinished(-1); QString resultCreate = QString::fromLatin1(processCreate.readAll()); qDebug() << resultCreate; diff --git a/CellFrameDashboardService/DapChainWalletHandler.h b/CellFrameDashboardService/DapChainWalletHandler.h index 7385778fe60b6dc16a9159ecc6dc912c1d51be85..3f8f4a5df1a17c0f5fe06d5e30c2a5ba8214479d 100755 --- a/CellFrameDashboardService/DapChainWalletHandler.h +++ b/CellFrameDashboardService/DapChainWalletHandler.h @@ -22,11 +22,30 @@ public: signals: public slots: + /// Create new wallet + /// @param name of wallet + /// @return result QStringList createWallet(const QString& asNameWallet); + /// Remove wallet + /// @param name of wallet void removeWallet(const QString& asNameWallet); + /// Get list of wallets + /// @return QMap of available wallets, where the key is name of wallet + /// and the value is number of wallet QMap<QString, QVariant> getWallets(); + /// Get details about wallet + /// @param name of wallet + /// @return list with balances and tokens QStringList getWalletInfo(const QString& asNameWallet); + /// Create new token + /// @param name of wallet where is needed to send + /// @param andress of wallet which will receive + /// @param token name + /// @param sum for sending + /// @return result QString sendToken(const QString &asSendWallet, const QString& asAddressReceiver, const QString& asToken, const QString& aAmount); + /// Set current network + /// @param name of network void setCurrentNetwork(const QString& aNetwork); };