diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 41f70ced2..0b3d6987d 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -48,7 +48,6 @@ #include #include #include -#include #include "MainWin.h" #include "DownloadView.h" #include "MiningView.h" @@ -159,7 +158,6 @@ Main::Main(QWidget *parent) : m_webThree.reset(new WebThreeDirect(string("AlethZero/v") + dev::Version + "/" DEV_QUOTED(ETH_BUILD_TYPE) "/" DEV_QUOTED(ETH_BUILD_PLATFORM), getDataDir() + "/AlethZero", false, {"eth", "shh"})); m_qwebConnector.reset(new QWebThreeConnector()); -// m_httpConnector.reset(new jsonrpc::CorsHttpServer(8080)); m_server.reset(new OurWebThreeStubServer(*m_qwebConnector, *web3(), keysAsVector(m_myKeys), this)); connect(&*m_server, SIGNAL(onNewId(QString)), SLOT(addNewId(QString))); m_server->setIdentities(keysAsVector(owned())); @@ -436,12 +434,6 @@ QVariant Main::evalRaw(QString const& _js) return ui->webView->page()->currentFrame()->evaluateJavaScript(_js); } -void Main::addToWindowObject(QObject* _object, QString const& _name) -{ - QWebFrame* f = ui->webView->page()->mainFrame(); - f->addToJavaScriptWindowObject(_name, _object, QWebFrame::QtOwnership); -} - void Main::eval(QString const& _js) { if (_js.trimmed().isEmpty()) diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index 03f6dc2fa..6f8ee7e2b 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -49,10 +49,6 @@ class Client; class State; }} -namespace jsonrpc { -class CorsHttpServer; -} - class QQuickView; class OurWebThreeStubServer; @@ -95,7 +91,6 @@ public: QList owned() const { return m_myIdentities + m_myKeys; } QVariant evalRaw(QString const& _js); - void addToWindowObject(QObject* _object, QString const& _name); public slots: void load(QString _file); @@ -284,7 +279,6 @@ private: bool m_logChanged = true; std::unique_ptr m_qwebConnector; -// std::unique_ptr m_httpConnector; std::unique_ptr m_server; QWebThree* m_qweb = nullptr; diff --git a/alethzero/OurWebThreeStubServer.cpp b/alethzero/OurWebThreeStubServer.cpp index 4769ab3ff..28705653f 100644 --- a/alethzero/OurWebThreeStubServer.cpp +++ b/alethzero/OurWebThreeStubServer.cpp @@ -87,31 +87,10 @@ QNatspecExpressionEvaluator::QNatspecExpressionEvaluator(OurWebThreeStubServer* QNatspecExpressionEvaluator::~QNatspecExpressionEvaluator() {} -QString QNatspecExpressionEvaluator::stateAt(QString _key) -{ - (void)_key; - return "1"; -} - -QString QNatspecExpressionEvaluator::call(QString _json) -{ - QJsonObject jsonObject = QJsonDocument::fromJson(_json.toUtf8()).object(); - Json::Value input; - input["to"] = jsonObject["to"].toString().toStdString(); - input["data"] = jsonObject["data"].toString().toStdString(); - return QString::fromStdString(m_server->eth_call(input)); -} - -QString QNatspecExpressionEvaluator::sha3(QString _method) -{ - return QString::fromStdString(m_server->web3_sha3(_method.toStdString())); -} - QString QNatspecExpressionEvaluator::evalExpression(QString const& _expression) { // evaluate the natspec - m_main->addToWindowObject(this, "_natspec"); m_main->evalRaw(contentsOfQResource(":/js/natspec.js")); (void)_expression; diff --git a/alethzero/OurWebThreeStubServer.h b/alethzero/OurWebThreeStubServer.h index 384b5591b..53558b121 100644 --- a/alethzero/OurWebThreeStubServer.h +++ b/alethzero/OurWebThreeStubServer.h @@ -58,10 +58,6 @@ public: QString evalExpression(QString const& _expression); - Q_INVOKABLE QString stateAt(QString _key); - Q_INVOKABLE QString call(QString _json); - Q_INVOKABLE QString sha3(QString _method); - private: OurWebThreeStubServer* m_server; Main* m_main;