diff --git a/libjsqrc/natspec.js b/libjsqrc/natspec.js index d0bbdff17..c8cf07496 100644 --- a/libjsqrc/natspec.js +++ b/libjsqrc/natspec.js @@ -29,10 +29,20 @@ var getContractMethods = function (address, abi) { return web3.eth.contract(address, abi); }; +var getMethodWithName = function(abi, name) { + for (var i = 0; i < abi.length; i++) { + if (abi[i].name === name) { + return abi[i]; + } + } + console.warn('could not find method with name: ' + name); + return undefined; +}; + /// Function called to get all contract method input variables /// @returns hashmap with all contract's method input variables var getContractInputParams = function (abi, methodName, params) { - var method = web3.abi.getMethodWithName(abi, methodName); + var method = getMethodWithName(abi, methodName); return method.inputs.reduce(function (acc, current, index) { acc[current.name] = params[index]; return acc; diff --git a/mix/AppContext.cpp b/mix/AppContext.cpp index e27eac9fd..4f7c494e8 100644 --- a/mix/AppContext.cpp +++ b/mix/AppContext.cpp @@ -27,15 +27,16 @@ #include #include #include -#include +#include #include "CodeModel.h" #include "FileIo.h" #include "ClientModel.h" #include "CodeEditorExtensionManager.h" #include "Exceptions.h" -#include "AppContext.h" #include "QEther.h" +#include "QVariableDefinition.h" #include "HttpServer.h" +#include "AppContext.h" using namespace dev; using namespace dev::eth; @@ -82,7 +83,7 @@ void AppContext::load() qmlRegisterType("CodeEditorExtensionManager", 1, 0, "CodeEditorExtensionManager"); qmlRegisterType("HttpServer", 1, 0, "HttpServer"); m_applicationEngine->load(QUrl("qrc:/qml/main.qml")); - QQuickWindow *window = qobject_cast(m_applicationEngine->rootObjects().at(0)); + QWindow *window = qobject_cast(m_applicationEngine->rootObjects().at(0)); window->setIcon(QIcon(":/res/mix_256x256x32.png")); appLoaded(); } diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index 365dce9a9..4ce7b7755 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -30,6 +30,7 @@ #include "Exceptions.h" #include "QContractDefinition.h" #include "QVariableDeclaration.h" +#include "QVariableDefinition.h" #include "ContractCallDataEncoder.h" #include "CodeModel.h" #include "ClientModel.h" diff --git a/mix/ClientModel.h b/mix/ClientModel.h index 1eb508dac..493290780 100644 --- a/mix/ClientModel.h +++ b/mix/ClientModel.h @@ -26,8 +26,7 @@ #include #include #include -#include "MixClient.h" -#include "QVariableDefinition.h" +#include "MachineStates.h" namespace dev { @@ -39,6 +38,8 @@ class Web3Server; class RpcConnector; class QEther; class QDebugData; +class MixClient; +class QVariableDefinition; /// Backend transaction config class struct TransactionSettings