|
|
@ -242,7 +242,12 @@ void ClientModel::executeSequence(std::vector<TransactionSettings> const& _seque |
|
|
|
break; |
|
|
|
} |
|
|
|
if (!f) |
|
|
|
BOOST_THROW_EXCEPTION(FunctionNotFoundException() << FunctionName(transaction.functionId.toStdString())); |
|
|
|
{ |
|
|
|
emit runFailed("Function '" + transaction.functionId + tr("' not found. Please check transactions or the contract code.")); |
|
|
|
m_running = false; |
|
|
|
emit runStateChanged(); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!transaction.functionId.isEmpty()) |
|
|
|
encoder.encode(f); |
|
|
|
for (QVariableDeclaration const* p: f->parametersList()) |
|
|
@ -269,7 +274,12 @@ void ClientModel::executeSequence(std::vector<TransactionSettings> const& _seque |
|
|
|
{ |
|
|
|
auto contractAddressIter = m_contractAddresses.find(transaction.contractId); |
|
|
|
if (contractAddressIter == m_contractAddresses.end()) |
|
|
|
BOOST_THROW_EXCEPTION(dev::Exception() << dev::errinfo_comment("Contract not deployed: " + transaction.contractId.toStdString())); |
|
|
|
{ |
|
|
|
emit runFailed("Contract '" + transaction.contractId + tr(" not deployed.") + "' " + tr(" Cannot call ") + transaction.functionId); |
|
|
|
m_running = false; |
|
|
|
emit runStateChanged(); |
|
|
|
return; |
|
|
|
} |
|
|
|
callContract(contractAddressIter->second, encoder.encodedData(), transaction); |
|
|
|
} |
|
|
|
} |
|
|
@ -283,7 +293,6 @@ void ClientModel::executeSequence(std::vector<TransactionSettings> const& _seque |
|
|
|
std::cerr << boost::current_exception_diagnostic_information(); |
|
|
|
emit runFailed(QString::fromStdString(boost::current_exception_diagnostic_information())); |
|
|
|
} |
|
|
|
|
|
|
|
catch(std::exception const& e) |
|
|
|
{ |
|
|
|
std::cerr << boost::current_exception_diagnostic_information(); |
|
|
@ -376,6 +385,8 @@ void ClientModel::showDebuggerForTransaction(ExecutionResult const& _t) |
|
|
|
for(auto l: solLocals) |
|
|
|
if (l.first < (int)s.stack.size()) |
|
|
|
{ |
|
|
|
if (l.second->type()->name().startsWith("mapping")) |
|
|
|
break; //mapping type not yet managed
|
|
|
|
localDeclarations.push_back(QVariant::fromValue(l.second)); |
|
|
|
localValues[l.second->name()] = formatValue(l.second->type()->type(), s.stack[l.first]); |
|
|
|
} |
|
|
@ -400,6 +411,8 @@ void ClientModel::showDebuggerForTransaction(ExecutionResult const& _t) |
|
|
|
storageDec = new QVariableDeclaration(debugData, storageIter.value().name.toStdString(), storageIter.value().type); |
|
|
|
storageDeclarations[storageDec->name()] = storageDec; |
|
|
|
} |
|
|
|
if (storageDec->type()->name().startsWith("mapping")) |
|
|
|
break; //mapping type not yet managed
|
|
|
|
storageDeclarationList.push_back(QVariant::fromValue(storageDec)); |
|
|
|
storageValues[storageDec->name()] = formatValue(storageDec->type()->type(), st.second); |
|
|
|
} |
|
|
@ -408,7 +421,7 @@ void ClientModel::showDebuggerForTransaction(ExecutionResult const& _t) |
|
|
|
storage["values"] = storageValues; |
|
|
|
|
|
|
|
prevInstructionIndex = instructionIndex; |
|
|
|
solState = new QSolState(debugData, std::move(storage), std::move(solCallStack), std::move(locals), instruction.getLocation().start, instruction.getLocation().end); |
|
|
|
solState = new QSolState(debugData, std::move(storage), std::move(solCallStack), std::move(locals), instruction.getLocation().start, instruction.getLocation().end, QString::fromUtf8(instruction.getLocation().sourceName->c_str())); |
|
|
|
} |
|
|
|
|
|
|
|
states.append(QVariant::fromValue(new QMachineState(debugData, instructionIndex, s, codes[s.codeIndex], data[s.dataIndex], solState))); |
|
|
|