Browse Source

issues fixes

cl-refactor
Marek Kotewicz 10 years ago
parent
commit
e8c4d68164
  1. 3
      alethzero/CMakeLists.txt
  2. 2
      alethzero/MainWin.cpp
  3. 2
      alethzero/MainWin.h
  4. 2
      libdevcore/CommonJS.h
  5. 10
      libethrpc/WebThreeStubServer.cpp
  6. 2
      libethrpc/WebThreeStubServer.h
  7. 3
      libqethereum/CMakeLists.txt
  8. 7
      libqethereum/QEthereum.cpp

3
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

2
alethzero/MainWin.cpp

@ -144,7 +144,7 @@ Main::Main(QWidget *parent) :
f->disconnect(SIGNAL(javaScriptWindowObjectCleared()));
auto list = owned().toStdList();
m_server = auto_ptr<WebThreeStubServer>(new WebThreeStubServer(new QWebThreeConnector(qweb), *web3(), {std::begin(list), std::end(list)}));
m_server = unique_ptr<WebThreeStubServer>(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));

2
alethzero/MainWin.h

@ -248,6 +248,6 @@ private:
QString m_logHistory;
bool m_logChanged = true;
std::auto_ptr<WebThreeStubServer> m_server;
std::unique_ptr<WebThreeStubServer> m_server;
QWebThree* m_qweb = nullptr;
};

2
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;

10
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<dev::KeyPair> _accounts):
WebThreeStubServer::WebThreeStubServer(jsonrpc::AbstractServerConnector* _conn, WebThreeDirect& _web3, std::vector<dev::KeyPair> 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;

2
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<dev::KeyPair> _accounts);
WebThreeStubServer(jsonrpc::AbstractServerConnector* _conn, dev::WebThreeDirect& _web3, std::vector<dev::KeyPair> const& _accounts);
virtual Json::Value accounts();
virtual std::string balanceAt(std::string const& _address);

3
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})

7
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());
}

Loading…
Cancel
Save