|
|
@ -60,6 +60,11 @@ using namespace dev::p2p; |
|
|
|
using namespace dev::eth; |
|
|
|
namespace js = json_spirit; |
|
|
|
|
|
|
|
#define Small "font-size: small; " |
|
|
|
#define Mono "font-family: Ubuntu Mono, Monospace, Lucida Console, Courier New; font-weight: bold; " |
|
|
|
#define Div(S) "<div style=\"" S "\">" |
|
|
|
#define Span(S) "<span style=\"" S "\">" |
|
|
|
|
|
|
|
static void initUnits(QComboBox* _b) |
|
|
|
{ |
|
|
|
for (auto n = (unsigned)units().size(); n-- != 0; ) |
|
|
@ -447,7 +452,7 @@ void Main::eval(QString const& _js) |
|
|
|
else |
|
|
|
s = "<span style=\"color: #888\">unknown type</span>"; |
|
|
|
m_consoleHistory.push_back(qMakePair(_js, s)); |
|
|
|
s = "<html><body style=\"font-family: Monospace, Ubuntu Mono, Lucida Console, Courier New; margin: 0; font-size: 12pt\"><div style=\"position: absolute; bottom: 0; border: 0px; margin: 0px; width: 100%\">"; |
|
|
|
s = "<html><body style=\"margin: 0;\">" Div(Mono "position: absolute; bottom: 0; border: 0px; margin: 0px; width: 100%"); |
|
|
|
for (auto const& i: m_consoleHistory) |
|
|
|
s += "<div style=\"border-bottom: 1 solid #eee; width: 100%\"><span style=\"float: left; width: 1em; color: #888; font-weight: bold\">></span><span style=\"color: #35d\">" + i.first.toHtmlEscaped() + "</span></div>" |
|
|
|
"<div style=\"border-bottom: 1 solid #eee; width: 100%\"><span style=\"float: left; width: 1em\"> </span><span>" + i.second + "</span></div>"; |
|
|
@ -1274,12 +1279,12 @@ void Main::on_transactionQueue_currentItemChanged() |
|
|
|
if (tx.data().size()) |
|
|
|
s << dev::memDump(tx.data(), 16, true); |
|
|
|
} |
|
|
|
s << "<div>Hex: <span style=\"font-family: Monospace,Lucida Console,Courier,Courier New,sans-serif; font-size: small\">" << toHex(tx.rlp()) << "</span></div>"; |
|
|
|
s << "<div>Hex: " Span(Mono) << toHex(tx.rlp()) << "</span></div>"; |
|
|
|
s << "<hr/>"; |
|
|
|
s << "<div>Log Bloom: " << receipt.bloom() << "</div>"; |
|
|
|
auto r = receipt.rlp(); |
|
|
|
s << "<div>Receipt: " << toString(RLP(r)) << "</div>"; |
|
|
|
s << "<div>Receipt-Hex: <span style=\"font-family: Monospace,Lucida Console,Courier,Courier New,sans-serif; font-size: small\">" << toHex(receipt.rlp()) << "</span></div>"; |
|
|
|
s << "<div>Receipt-Hex: " Span(Mono) << toHex(receipt.rlp()) << "</span></div>"; |
|
|
|
s << renderDiff(ethereum()->diff(i, 0)); |
|
|
|
// s << "Pre: " << fs.rootHash() << "<br/>";
|
|
|
|
// s << "Post: <b>" << ts.rootHash() << "</b>";
|
|
|
@ -1370,8 +1375,8 @@ void Main::on_blocks_currentItemChanged() |
|
|
|
for (auto const& i: block[1]) |
|
|
|
s << "<br/>" << sha3(i.data()).abridged();// << ": <b>" << i[1].toHash<h256>() << "</b> [<b>" << i[2].toInt<u256>() << "</b> used]";
|
|
|
|
s << "<br/>Post: <b>" << info.stateRoot << "</b>"; |
|
|
|
s << "<br/>Dump: <span style=\"font-family: Monospace,Lucida Console,Courier,Courier New,sans-serif; font-size: small\">" << toHex(block[0].data()) << "</span>"; |
|
|
|
s << "<div>Receipts-Hex: <span style=\"font-family: Monospace,Lucida Console,Courier,Courier New,sans-serif; font-size: small\">" << toHex(ethereum()->blockChain().receipts(h).rlp()) << "</span></div>"; |
|
|
|
s << "<br/>Dump: " Span(Mono) << toHex(block[0].data()) << "</span>"; |
|
|
|
s << "<div>Receipts-Hex: " Span(Mono) << toHex(ethereum()->blockChain().receipts(h).rlp()) << "</span></div>"; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -1405,12 +1410,12 @@ void Main::on_blocks_currentItemChanged() |
|
|
|
if (tx.data().size()) |
|
|
|
s << dev::memDump(tx.data(), 16, true); |
|
|
|
} |
|
|
|
s << "<div>Hex: <span style=\"font-family: Monospace,Lucida Console,Courier,Courier New,sans-serif; font-size: small\">" << toHex(block[1][txi].data()) << "</span></div>"; |
|
|
|
s << "<div>Hex: " Span(Mono) << toHex(block[1][txi].data()) << "</span></div>"; |
|
|
|
s << "<hr/>"; |
|
|
|
s << "<div>Log Bloom: " << receipt.bloom() << "</div>"; |
|
|
|
auto r = receipt.rlp(); |
|
|
|
s << "<div>Receipt: " << toString(RLP(r)) << "</div>"; |
|
|
|
s << "<div>Receipt-Hex: <span style=\"font-family: Monospace,Lucida Console,Courier,Courier New,sans-serif; font-size: small\">" << toHex(receipt.rlp()) << "</span></div>"; |
|
|
|
s << "<div>Receipt-Hex: " Span(Mono) << toHex(receipt.rlp()) << "</span></div>"; |
|
|
|
s << renderDiff(ethereum()->diff(txi, h)); |
|
|
|
ui->debugCurrent->setEnabled(true); |
|
|
|
ui->debugDumpState->setEnabled(true); |
|
|
@ -1529,6 +1534,7 @@ void Main::on_contracts_currentItemChanged() |
|
|
|
for (auto const& i: storage) |
|
|
|
s << "@" << showbase << hex << prettyU256(i.first).toStdString() << " " << showbase << hex << prettyU256(i.second).toStdString() << "<br/>"; |
|
|
|
s << "<h4>Body Code</h4>" << disassemble(ethereum()->codeAt(address)); |
|
|
|
s << Div(Mono) << toHex(ethereum()->codeAt(address)) << "</div>"; |
|
|
|
ui->contractInfo->appendHtml(QString::fromStdString(s.str())); |
|
|
|
} |
|
|
|
catch (dev::InvalidTrie) |
|
|
@ -1730,7 +1736,7 @@ void Main::on_data_textChanged() |
|
|
|
for (auto const& i: errors) |
|
|
|
errs.append("<div style=\"border-left: 6px solid #c00; margin-top: 2px\">" + QString::fromStdString(i).toHtmlEscaped() + "</div>"); |
|
|
|
} |
|
|
|
ui->code->setHtml(errs + lll + solidity + "<h4>Code</h4>" + QString::fromStdString(disassemble(m_data)).toHtmlEscaped()); |
|
|
|
ui->code->setHtml(errs + lll + solidity + "<h4>Code</h4>" + QString::fromStdString(disassemble(m_data)).toHtmlEscaped() + "<h4>Hex</h4>" Div(Mono) + QString::fromStdString(toHex(m_data)) + "</div>"); |
|
|
|
ui->gas->setMinimum((qint64)Client::txGas(m_data, 0)); |
|
|
|
if (!ui->gas->isEnabled()) |
|
|
|
ui->gas->setValue(m_backupGas); |
|
|
|