diff --git a/alethzero/CMakeLists.txt b/alethzero/CMakeLists.txt index ded3e86de..6e75b1577 100644 --- a/alethzero/CMakeLists.txt +++ b/alethzero/CMakeLists.txt @@ -53,8 +53,7 @@ else () endif () qt5_use_modules(${EXECUTEABLE} Core)# Gui Widgets Network WebKit WebKitWidgets) -target_link_libraries(${EXECUTEABLE} webthree qethereum ethereum evm ethcore devcrypto secp256k1 gmp ${CRYPTOPP_LS} serpent lll evmface devcore) -target_link_libraries(${EXECUTEABLE} ethrpc) +target_link_libraries(${EXECUTEABLE} webthree qethereum ethereum evm ethcore devcrypto secp256k1 gmp ${CRYPTOPP_LS} serpent lll evmface devcore ethrpc) if (APPLE) # First have qt5 install plugins and frameworks diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 9063cd9c0..0d2234df9 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -144,7 +144,7 @@ Main::Main(QWidget *parent) : f->disconnect(SIGNAL(javaScriptWindowObjectCleared())); auto list = owned().toStdList(); - m_server = auto_ptr(new WebThreeStubServer(new QWebThreeConnector(qweb), *web3(), {std::begin(list), std::end(list)})); + m_server = unique_ptr(new WebThreeStubServer(new QWebThreeConnector(qweb), *web3(), {std::begin(list), std::end(list)})); m_server->StartListening(); connect(f, &QWebFrame::javaScriptWindowObjectCleared, QETH_INSTALL_JS_NAMESPACE(f, this, qweb)); diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index d1ddeebb9..0e6e07aa0 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -248,6 +248,6 @@ private: QString m_logHistory; bool m_logChanged = true; - std::auto_ptr m_server; + std::unique_ptr m_server; QWebThree* m_qweb = nullptr; }; diff --git a/libdevcore/CommonJS.h b/libdevcore/CommonJS.h index 7f5d5d976..51e362026 100644 --- a/libdevcore/CommonJS.h +++ b/libdevcore/CommonJS.h @@ -112,7 +112,7 @@ inline double jsFromFixed(std::string const& _s) return (double)jsToU256(_s) / (double)(dev::u256(1) << 128); } -struct TransactionJS +struct TransactionSkeleton { Address from; Address to; diff --git a/libethrpc/WebThreeStubServer.cpp b/libethrpc/WebThreeStubServer.cpp index 7be77c6d4..1a7131482 100644 --- a/libethrpc/WebThreeStubServer.cpp +++ b/libethrpc/WebThreeStubServer.cpp @@ -143,7 +143,7 @@ static dev::eth::MessageFilter toMessageFilter(Json::Value const& _json) return filter; } -WebThreeStubServer::WebThreeStubServer(jsonrpc::AbstractServerConnector* _conn, WebThreeDirect& _web3, std::vector _accounts): +WebThreeStubServer::WebThreeStubServer(jsonrpc::AbstractServerConnector* _conn, WebThreeDirect& _web3, std::vector const& _accounts): AbstractWebThreeStubServer(_conn), m_web3(_web3) { @@ -192,9 +192,9 @@ Json::Value WebThreeStubServer::blockByNumber(int const& _number) return toJson(client()->blockInfo(client()->hashFromNumber(_number))); } -static TransactionJS toTransaction(Json::Value const& _json) +static TransactionSkeleton toTransaction(Json::Value const& _json) { - TransactionJS ret; + TransactionSkeleton ret; if (!_json.isObject() || _json.empty()){ return ret; } @@ -235,7 +235,7 @@ std::string WebThreeStubServer::call(Json::Value const& _json) std::string ret; if (!client()) return ret; - TransactionJS t = toTransaction(_json); + TransactionSkeleton t = toTransaction(_json); if (!t.from && m_accounts.size()) { auto b = m_accounts.begin()->first; @@ -379,7 +379,7 @@ Json::Value WebThreeStubServer::transact(Json::Value const& _json) std::string ret; if (!client()) return ret; - TransactionJS t = toTransaction(_json); + TransactionSkeleton t = toTransaction(_json); if (!t.from && m_accounts.size()) { auto b = m_accounts.begin()->first; diff --git a/libethrpc/WebThreeStubServer.h b/libethrpc/WebThreeStubServer.h index 17257f9ac..c2f85c6ff 100644 --- a/libethrpc/WebThreeStubServer.h +++ b/libethrpc/WebThreeStubServer.h @@ -36,7 +36,7 @@ namespace dev { class WebThreeDirect; namespace eth { class Interface; } class K class WebThreeStubServer: public AbstractWebThreeStubServer { public: - WebThreeStubServer(jsonrpc::AbstractServerConnector* _conn, dev::WebThreeDirect& _web3, std::vector _accounts); + WebThreeStubServer(jsonrpc::AbstractServerConnector* _conn, dev::WebThreeDirect& _web3, std::vector const& _accounts); virtual Json::Value accounts(); virtual std::string balanceAt(std::string const& _address); diff --git a/libqethereum/CMakeLists.txt b/libqethereum/CMakeLists.txt index 16e686a6d..724d6e420 100644 --- a/libqethereum/CMakeLists.txt +++ b/libqethereum/CMakeLists.txt @@ -60,8 +60,7 @@ endif() include_directories(/) qt5_use_modules(${EXECUTABLE} Core Gui WebKit WebKitWidgets Widgets Network Quick Qml) -target_link_libraries(${EXECUTABLE} ethereum secp256k1 ${CRYPTOPP_LS}) -target_link_libraries(${EXECUTABLE} ${JSONRPC_LS}) +target_link_libraries(${EXECUTABLE} ethereum secp256k1 ${CRYPTOPP_LS} ${JSONRPC_LS}) if (APPLE) if (${ADDFRAMEWORKS}) diff --git a/libqethereum/QEthereum.cpp b/libqethereum/QEthereum.cpp index 537e7ce4f..a7167f396 100644 --- a/libqethereum/QEthereum.cpp +++ b/libqethereum/QEthereum.cpp @@ -101,12 +101,9 @@ void QWebThree::postData(QString _json) QJsonObject f = QJsonDocument::fromJson(_json.toUtf8()).object(); QString method = f["call"].toString(); - if (!method.compare("uninstallFilter")) + if (!method.compare("uninstallFilter") && f["args"].isArray() && f["args"].toArray().size()) { - int idToRemove = -1; - if (f["args"].isArray()) - if (f["args"].toArray().size()) - idToRemove = f["args"].toArray()[0].toInt();; + int idToRemove = f["args"].toArray()[0].toInt(); m_watches.erase(std::remove(m_watches.begin(), m_watches.end(), idToRemove), m_watches.end()); }