Browse Source

fixed transaction log function formatting, style

cl-refactor
arkpar 10 years ago
parent
commit
ebebe0fe56
  1. 8
      mix/ClientModel.cpp
  2. 2
      mix/CodeModel.cpp

8
mix/ClientModel.cpp

@ -323,6 +323,7 @@ void ClientModel::onNewTransaction()
//TODO: handle value transfer //TODO: handle value transfer
FixedHash<4> functionHash; FixedHash<4> functionHash;
bool call = false;
if (creation) if (creation)
{ {
//contract creation //contract creation
@ -339,8 +340,13 @@ void ClientModel::onNewTransaction()
{ {
//call //call
if (tr.transactionData.size() >= 4) if (tr.transactionData.size() >= 4)
{
functionHash = FixedHash<4>(tr.transactionData.data(), FixedHash<4>::ConstructFromPointer); 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("<none>");
} }
if (m_contractAddress != 0 && (tr.address == m_contractAddress || tr.contractAddress == m_contractAddress)) 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(); auto compilerRes = m_context->codeModel()->code();
QContractDefinition* def = compilerRes->contract(); QContractDefinition* def = compilerRes->contract();
contract = def->name(); contract = def->name();
if (!creation) if (call)
{ {
QFunctionDefinition* funcDef = def->getFunction(functionHash); QFunctionDefinition* funcDef = def->getFunction(functionHash);
if (funcDef) if (funcDef)

2
mix/CodeModel.cpp

@ -201,7 +201,7 @@ dev::bytes const& CodeModel::getStdContractCode(const QString& _contractName, co
solidity::CompilerStack cs(false); solidity::CompilerStack cs(false);
cs.setSource(source); cs.setSource(source);
cs.compile(false); cs.compile(false);
for(std::string name: cs.getContractNames()) for (std::string const& name: cs.getContractNames())
{ {
dev::bytes code = cs.getBytecode(name); dev::bytes code = cs.getBytecode(name);
m_compiledContracts.insert(std::make_pair(QString::fromStdString(name), std::move(code))); m_compiledContracts.insert(std::make_pair(QString::fromStdString(name), std::move(code)));

Loading…
Cancel
Save