From ebebe0fe56df712ac445391cdca0c2b3a65ba68b Mon Sep 17 00:00:00 2001 From: arkpar Date: Thu, 29 Jan 2015 17:29:25 +0100 Subject: [PATCH] fixed transaction log function formatting, style --- mix/ClientModel.cpp | 10 ++++++++-- mix/CodeModel.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index 31a02caae..251447c79 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -323,6 +323,7 @@ void ClientModel::onNewTransaction() //TODO: handle value transfer FixedHash<4> functionHash; + bool call = false; if (creation) { //contract creation @@ -339,8 +340,13 @@ void ClientModel::onNewTransaction() { //call if (tr.transactionData.size() >= 4) + { functionHash = FixedHash<4>(tr.transactionData.data(), FixedHash<4>::ConstructFromPointer); - function = QString::fromStdString(toJS(functionHash)); + function = QString::fromStdString(toJS(functionHash)); + call = true; + } + else + function = QObject::tr(""); } if (m_contractAddress != 0 && (tr.address == m_contractAddress || tr.contractAddress == m_contractAddress)) @@ -348,7 +354,7 @@ void ClientModel::onNewTransaction() auto compilerRes = m_context->codeModel()->code(); QContractDefinition* def = compilerRes->contract(); contract = def->name(); - if (!creation) + if (call) { QFunctionDefinition* funcDef = def->getFunction(functionHash); if (funcDef) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 4d1febf97..39edd6d6f 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -201,7 +201,7 @@ dev::bytes const& CodeModel::getStdContractCode(const QString& _contractName, co solidity::CompilerStack cs(false); cs.setSource(source); cs.compile(false); - for(std::string name: cs.getContractNames()) + for (std::string const& name: cs.getContractNames()) { dev::bytes code = cs.getBytecode(name); m_compiledContracts.insert(std::make_pair(QString::fromStdString(name), std::move(code)));