|
@ -1097,7 +1097,7 @@ void Main::refreshBlockChain() |
|
|
auto b = bc.block(h); |
|
|
auto b = bc.block(h); |
|
|
for (auto const& i: RLP(b)[1]) |
|
|
for (auto const& i: RLP(b)[1]) |
|
|
{ |
|
|
{ |
|
|
Transaction t(i.data()); |
|
|
Transaction t(i.data(), CheckSignature::Sender); |
|
|
if (bm || transactionMatch(filter, t)) |
|
|
if (bm || transactionMatch(filter, t)) |
|
|
{ |
|
|
{ |
|
|
QString s = t.receiveAddress() ? |
|
|
QString s = t.receiveAddress() ? |
|
@ -1385,7 +1385,7 @@ void Main::on_blocks_currentItemChanged() |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
unsigned txi = item->data(Qt::UserRole + 1).toInt(); |
|
|
unsigned txi = item->data(Qt::UserRole + 1).toInt(); |
|
|
Transaction tx(block[1][txi].data()); |
|
|
Transaction tx(block[1][txi].data(), CheckSignature::Sender); |
|
|
auto ss = tx.safeSender(); |
|
|
auto ss = tx.safeSender(); |
|
|
h256 th = sha3(rlpList(ss, tx.nonce())); |
|
|
h256 th = sha3(rlpList(ss, tx.nonce())); |
|
|
TransactionReceipt receipt = ethereum()->blockChain().receipts(h).receipts[txi]; |
|
|
TransactionReceipt receipt = ethereum()->blockChain().receipts(h).receipts[txi]; |
|
@ -1648,13 +1648,18 @@ static shh::Topic topicFromText(QString _s) |
|
|
return ret; |
|
|
return ret; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Main::sourceIsSolidity(string const& _source) |
|
|
bool Main::sourceIsSolidity(string const& _source) |
|
|
{ |
|
|
{ |
|
|
// TODO: Improve this heuristic
|
|
|
// TODO: Improve this heuristic
|
|
|
return (_source.substr(0, 8) == "contract" || _source.substr(0, 5) == "//sol"); |
|
|
return (_source.substr(0, 8) == "contract" || _source.substr(0, 5) == "//sol"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static bool sourceIsSerpent(string const& _source) |
|
|
|
|
|
{ |
|
|
|
|
|
// TODO: Improve this heuristic
|
|
|
|
|
|
return (_source.substr(0, 5) == "//ser"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
string const Main::getFunctionHashes(dev::solidity::CompilerStack const &_compiler, |
|
|
string const Main::getFunctionHashes(dev::solidity::CompilerStack const &_compiler, |
|
|
string const& _contractName) |
|
|
string const& _contractName) |
|
|
{ |
|
|
{ |
|
@ -1689,6 +1694,7 @@ void Main::on_data_textChanged() |
|
|
dev::solidity::CompilerStack compiler; |
|
|
dev::solidity::CompilerStack compiler; |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
|
|
|
// compiler.addSources(dev::solidity::StandardSources);
|
|
|
m_data = compiler.compile(src, m_enableOptimizer); |
|
|
m_data = compiler.compile(src, m_enableOptimizer); |
|
|
solidity = "<h4>Solidity</h4>"; |
|
|
solidity = "<h4>Solidity</h4>"; |
|
|
solidity += "<pre>" + QString::fromStdString(compiler.getInterface()).replace(QRegExp("\\s"), "").toHtmlEscaped() + "</pre>"; |
|
|
solidity += "<pre>" + QString::fromStdString(compiler.getInterface()).replace(QRegExp("\\s"), "").toHtmlEscaped() + "</pre>"; |
|
@ -1706,10 +1712,7 @@ void Main::on_data_textChanged() |
|
|
solidity = "<h4>Solidity</h4><pre>Uncaught exception.</pre>"; |
|
|
solidity = "<h4>Solidity</h4><pre>Uncaught exception.</pre>"; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
else if (sourceIsSerpent(src)) |
|
|
{ |
|
|
|
|
|
m_data = compileLLL(src, m_enableOptimizer, &errors); |
|
|
|
|
|
if (errors.size()) |
|
|
|
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
@ -1723,6 +1726,9 @@ void Main::on_data_textChanged() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
m_data = compileLLL(src, m_enableOptimizer, &errors); |
|
|
|
|
|
if (errors.empty()) |
|
|
{ |
|
|
{ |
|
|
auto asmcode = compileLLLToAsm(src, false); |
|
|
auto asmcode = compileLLLToAsm(src, false); |
|
|
lll = "<h4>Pre</h4><pre>" + QString::fromStdString(asmcode).toHtmlEscaped() + "</pre>"; |
|
|
lll = "<h4>Pre</h4><pre>" + QString::fromStdString(asmcode).toHtmlEscaped() + "</pre>"; |
|
|