Skip to content

Commit

Permalink
Add the batch of release v3.1.0 commits
Browse files Browse the repository at this point in the history
  • Loading branch information
developer-at-bcn committed May 22, 2018
1 parent 2682192 commit b9daab8
Show file tree
Hide file tree
Showing 10 changed files with 157 additions and 126 deletions.
7 changes: 6 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
## Release Notes

### v3.1.0

- Increment the major version to conform with the daemon versioning.
- Updated the Bytecoin daemons.

### v2.0.4

- Updated Bytecoin daemons.
- Updated the Bytecoin daemons.
- Fixed window file path on MacOS.
- Fixed bug in transaction list.
- Fixed minor GUI fixes.
Expand Down
14 changes: 7 additions & 7 deletions Windows Installer/Installer.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -1483,23 +1483,23 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Bytecoin"
"ProductCode" = "8:{5474A905-4D3C-41AF-84CE-A5A0364CA5AE}"
"PackageCode" = "8:{EE7D4D39-E381-4011-ABFE-284DB213F964}"
"ProductCode" = "8:{74A885F4-73BC-48E5-AE9D-31B32EBA01EF}"
"PackageCode" = "8:{2C5C62F2-9B6B-49F8-A503-8A34097B2536}"
"UpgradeCode" = "8:{DC5C7D60-BB08-4B97-B634-E87679CCEB3C}"
"AspNetVersion" = "8:"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:18.4.4"
"ProductVersion" = "8:18.5.21"
"Manufacturer" = "8:Bytecoin Developers"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
"Title" = "8:Bytecoin 2.0.2 Installer"
"Title" = "8:Bytecoin 3.1.0 Installer"
"Subject" = "8:"
"ARPCONTACT" = "8:Bytecoin Developers"
"Keywords" = "8:"
"ARPCOMMENTS" = "8:Release version of bytecoin from 4 April 2018"
"ARPCOMMENTS" = "8:Release version of bytecoin from 21 May 2018"
"ARPURLINFOABOUT" = "8:https://bytecoin.org"
"ARPPRODUCTICON" = "8:_ABCF8F071D16461785EDF6D56ED2ABCE"
"ARPIconIndex" = "3:0"
Expand Down Expand Up @@ -1706,7 +1706,7 @@
"ContextData" = "8:"
"Attributes" = "3:0"
"Setting" = "3:2"
"Value" = "8:Release version 2.0.2 of bytecoin core and GUI wallet from 2018/04/04."
"Value" = "8:Release version 3.1.0 of bytecoin core and GUI wallet from 2018/05/21."
"DefaultValue" = "8:#1202"
"UsePlugInResources" = "11:TRUE"
}
Expand Down Expand Up @@ -1945,7 +1945,7 @@
"ContextData" = "8:"
"Attributes" = "3:0"
"Setting" = "3:2"
"Value" = "8:Release version 2.0.2 of bytecoin core and GUI wallet from 2018/04/04."
"Value" = "8:Release version 3.1.0 of bytecoin core and GUI wallet from 2018/05/21."
"DefaultValue" = "8:#1202"
"UsePlugInResources" = "11:TRUE"
}
Expand Down
14 changes: 7 additions & 7 deletions Windows Installer/Installer32.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -1483,23 +1483,23 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Bytecoin"
"ProductCode" = "8:{6520DE51-70F3-48E2-BA6D-0FAFCBC4E56D}"
"PackageCode" = "8:{61DFFA9D-888A-4916-A0AE-3E3AF727ACD4}"
"ProductCode" = "8:{F957B4C2-A6B6-42FB-91B5-D7679BC27EBB}"
"PackageCode" = "8:{FD11C38A-D7DB-45B1-8DA6-77246C4ECD9E}"
"UpgradeCode" = "8:{DC5C7D60-BB08-4B97-B634-E87679CCEB3C}"
"AspNetVersion" = "8:"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:18.4.4"
"ProductVersion" = "8:18.5.21"
"Manufacturer" = "8:Bytecoin Developers"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
"Title" = "8:32-bit Bytecoin 2.0.2 Installer"
"Title" = "8:32-bit Bytecoin 3.1.0 Installer"
"Subject" = "8:"
"ARPCONTACT" = "8:Bytecoin Developers"
"Keywords" = "8:"
"ARPCOMMENTS" = "8:32-bit release version of bytecoin from 4 April 2018"
"ARPCOMMENTS" = "8:32-bit release version of bytecoin from 21 May 2018"
"ARPURLINFOABOUT" = "8:https://bytecoin.org"
"ARPPRODUCTICON" = "8:_A84FAE3CB14C4108B5D13DF9AD54E661"
"ARPIconIndex" = "3:0"
Expand Down Expand Up @@ -1706,7 +1706,7 @@
"ContextData" = "8:"
"Attributes" = "3:0"
"Setting" = "3:2"
"Value" = "8:32-bit release version 2.0.2 of bytecoin core and GUI wallet from 2018/04/04."
"Value" = "8:32-bit release version 3.1.0 of bytecoin core and GUI wallet from 2018/05/21."
"DefaultValue" = "8:#1202"
"UsePlugInResources" = "11:TRUE"
}
Expand Down Expand Up @@ -1945,7 +1945,7 @@
"ContextData" = "8:"
"Attributes" = "3:0"
"Setting" = "3:2"
"Value" = "8:32-bit release version 2.0.2 of bytecoin core and GUI wallet from 2018/04/04."
"Value" = "8:32-bit release version 3.1.0 of bytecoin core and GUI wallet from 2018/05/21."
"DefaultValue" = "8:#1202"
"UsePlugInResources" = "11:TRUE"
}
Expand Down
117 changes: 93 additions & 24 deletions src/JsonRpc/JsonRpcClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,22 +163,23 @@ void Client::replyFinished(QNetworkReply* reply)
{
const JsonRpcResponse& response = static_cast<JsonRpcResponse&>(*jsonRpcObject);
auto it = responseHandlers_.find(response.getId());
if (response.isErrorResponse())
{
qDebug("[JsonRpcClient] Error response for %s id. %s", qPrintable(response.getId()), qPrintable(response.getErrorMessage()));
if (it != responseHandlers_.end())
responseHandlers_.erase(it);
emit jsonErrorResponse(response.getId(), response.getErrorMessage());
return;
}
// if (response.isErrorResponse())
// {
// qDebug("[JsonRpcClient] Error response for %s id. %s", qPrintable(response.getId()), qPrintable(response.getErrorMessage()));
// if (it != responseHandlers_.end())
// responseHandlers_.erase(it);
// emit jsonErrorResponse(response.getId(), response.getErrorMessage());
// return;
// }
if (it == responseHandlers_.end())
{
qDebug("[JsonRpcClient] Cannot find handler for id '%s'.", qPrintable(response.getId()));
emit jsonUnknownMessageId(response.getId());
return;
}
const QVariantMap result = response.getResultAsObject();
it.value()(result);
// const QVariantMap result = response.getResultAsObject();
// it.value()(result);
it.value()(response);
responseHandlers_.erase(it);
}
}
Expand Down Expand Up @@ -289,52 +290,120 @@ void WalletClient::sendCheckProof(const RpcApi::CheckSendProof::Request& req)
insertResponseHandler(requestID, std::bind(&WalletClient::checkProofHandler, this, _1));
}

void WalletClient::statusHandler(const QVariantMap& result) const
void WalletClient::statusHandler(const JsonRpcResponse& response)
{
if (response.isErrorResponse())
{
qDebug("[JsonRpcClient] Error response for %s id. %s", qPrintable(response.getId()), qPrintable(response.getErrorMessage()));
emit jsonErrorResponse(response.getId(), response.getErrorMessage());
return;
}

const QVariantMap result = response.getResultAsObject();
emit statusReceived(RpcApi::Status::fromJson(result));
}

void WalletClient::transfersHandler(const QVariantMap& result) const
void WalletClient::transfersHandler(const JsonRpcResponse& response)
{
if (response.isErrorResponse())
{
qDebug("[JsonRpcClient] Error response for %s id. %s", qPrintable(response.getId()), qPrintable(response.getErrorMessage()));
emit jsonErrorResponse(response.getId(), response.getErrorMessage());
return;
}

const QVariantMap result = response.getResultAsObject();
emit transfersReceived(RpcApi::Transfers::fromJson(result));
}
void WalletClient::addressesHandler(const QVariantMap& result) const

void WalletClient::addressesHandler(const JsonRpcResponse& response)
{
if (response.isErrorResponse())
{
qDebug("[JsonRpcClient] Error response for %s id. %s", qPrintable(response.getId()), qPrintable(response.getErrorMessage()));
emit jsonErrorResponse(response.getId(), response.getErrorMessage());
return;
}

const QVariantMap result = response.getResultAsObject();
emit addressesReceived(RpcApi::Addresses::fromJson(result));
}

void WalletClient::balanceHandler(const QVariantMap& result) const
void WalletClient::balanceHandler(const JsonRpcResponse& response)
{
if (response.isErrorResponse())
{
qDebug("[JsonRpcClient] Error response for %s id. %s", qPrintable(response.getId()), qPrintable(response.getErrorMessage()));
emit jsonErrorResponse(response.getId(), response.getErrorMessage());
return;
}

const QVariantMap result = response.getResultAsObject();
emit balanceReceived(RpcApi::Balance::fromJson(result));
}

//void WalletClient::unspentHandler(const QVariantMap& result) const
//{
// emit unspentReceived(RpcApi::Unspents::fromJson(result));
//}

void WalletClient::createTxHandler(const QVariantMap& result) const
void WalletClient::createTxHandler(const JsonRpcResponse& response)
{
if (response.isErrorResponse())
{
qDebug("[JsonRpcClient] Error response for %s id. %s", qPrintable(response.getId()), qPrintable(response.getErrorMessage()));
emit jsonErrorResponse(response.getId(), response.getErrorMessage());
return;
}

const QVariantMap result = response.getResultAsObject();
emit createTxReceived(RpcApi::CreatedTx::fromJson(result));
}

void WalletClient::sendTxHandler(const QVariantMap& result) const
void WalletClient::sendTxHandler(const JsonRpcResponse& response)
{
if (response.isErrorResponse())
{
qDebug("[JsonRpcClient] Error response for %s id. %s", qPrintable(response.getId()), qPrintable(response.getErrorMessage()));
emit jsonErrorResponse(response.getId(), response.getErrorMessage());
return;
}

const QVariantMap result = response.getResultAsObject();
emit sendTxReceived(RpcApi::SentTx::fromJson(result));
}

void WalletClient::viewKeyHandler(const QVariantMap& result) const
void WalletClient::viewKeyHandler(const JsonRpcResponse& response)
{
if (response.isErrorResponse())
{
qDebug("[JsonRpcClient] Error response for %s id. %s", qPrintable(response.getId()), qPrintable(response.getErrorMessage()));
emit jsonErrorResponse(response.getId(), response.getErrorMessage());
return;
}

const QVariantMap result = response.getResultAsObject();
emit viewKeyReceived(RpcApi::ViewKey::fromJson(result));
}

void WalletClient::proofsHandler(const QVariantMap &result) const
void WalletClient::proofsHandler(const JsonRpcResponse& response)
{
if (response.isErrorResponse())
{
qDebug("[JsonRpcClient] Error response for %s id. %s", qPrintable(response.getId()), qPrintable(response.getErrorMessage()));
emit jsonErrorResponse(response.getId(), response.getErrorMessage());
return;
}

const QVariantMap result = response.getResultAsObject();
emit proofsReceived(RpcApi::Proofs::fromJson(result));
}

void WalletClient::checkProofHandler(const QVariantMap& result) const
void WalletClient::checkProofHandler(const JsonRpcResponse& response)
{
if (response.isErrorResponse())
{
RpcApi::ProofCheck pc{response.getErrorMessage()};
emit checkProofReceived(pc);
return;
}

const QVariantMap result = response.getResultAsObject();
emit checkProofReceived(RpcApi::ProofCheck::fromJson(result));
}

Expand Down
45 changes: 11 additions & 34 deletions src/JsonRpc/JsonRpcClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "JsonRpcNotification.h"
#include "JsonRpcObjectFactory.h"
#include "rpcapi.h"
//#include "bytecoin/rpc_api.h"

namespace JsonRpc {

Expand All @@ -29,7 +28,7 @@ class Client : public QObject
Q_DISABLE_COPY(Client)

public:
typedef std::function<void(const QVariantMap&)> FunctionHandler;
typedef std::function<void(const JsonRpcResponse&)> FunctionHandler;

Client(QObject* parent = 0);
Client(const QUrl& url, QObject* parent = 0);
Expand Down Expand Up @@ -105,38 +104,16 @@ class WalletClient : public Client
void checkProofReceived(const RpcApi::ProofCheck& result) const;

private:
void statusHandler(const QVariantMap& result) const;
void transfersHandler(const QVariantMap& result) const;
void addressesHandler(const QVariantMap& result) const;
void balanceHandler(const QVariantMap& result) const;
void viewKeyHandler(const QVariantMap& result) const;
// void unspentHandler(const QVariantMap& result) const;
void createTxHandler(const QVariantMap& result) const;
void sendTxHandler(const QVariantMap& result) const;
void proofsHandler(const QVariantMap& result) const;
void checkProofHandler(const QVariantMap& result) const;
void statusHandler(const JsonRpcResponse& response);
void transfersHandler(const JsonRpcResponse& response);
void addressesHandler(const JsonRpcResponse& response);
void balanceHandler(const JsonRpcResponse& response);
void viewKeyHandler(const JsonRpcResponse& response);
// void unspentHandler(const JsonRpcResponse& response);
void createTxHandler(const JsonRpcResponse& response);
void sendTxHandler(const JsonRpcResponse& response);
void proofsHandler(const JsonRpcResponse& response);
void checkProofHandler(const JsonRpcResponse& response);
};

//class StratumClient : public Client
//{
// Q_OBJECT
// Q_DISABLE_COPY(StratumClient)

//public:
// StratumClient(const QUrl& url, QObject* parent = 0);

// void sendLogin(const QString& login, const QString& password, quint32 difficulty);
// void sendSubmit(const QString& jobId, quint32 nonce, const QByteArray& result);

//Q_SIGNALS:
// void loginReceived(const QVariantMap& result) const;
// void submitReceived(const QVariantMap& result) const;
// void jobReceived(const QVariantMap& result) const;

//private:
// void loginHandler(const QVariantMap& result) const;
// void submitHandler(const QVariantMap& result) const;
// void jobHandler(const QVariantMap& result) const;
//};

}
2 changes: 1 addition & 1 deletion src/bytecoin-gui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TEMPLATE = app
macx: QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11
macx: ICON = images/bytecoin.icns
win32: RC_ICONS = images/bytecoin.ico
win32: VERSION = 2.18.5.9
win32: VERSION = 3.18.5.21

#QMAKE_CXXFLAGS += -fno-omit-frame-pointer -fsanitize=address,undefined
#LIBS += -lasan -lubsan
Expand Down
1 change: 1 addition & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ void MainWindow::createTx(const RpcApi::Transaction& tx, quint64 fee)
req.change_address = getAddress();
req.confirmed_height_or_depth = -static_cast<qint32>(CONFIRMATIONS) - 1;
req.fee_per_byte = fee;
req.save_history = true;

emit createTxSignal(req, QPrivateSignal{});
}
Expand Down
Loading

0 comments on commit b9daab8

Please sign in to comment.