diff --git a/alethzero/Context.h b/alethzero/Context.h index a49d2be12..7dc2d5bc7 100644 --- a/alethzero/Context.h +++ b/alethzero/Context.h @@ -32,10 +32,10 @@ class QSpinBox; namespace dev { namespace eth { struct StateDiff; class KeyManager; } } -#define Small "font-size: small; " -#define Mono "font-family: Ubuntu Mono, Monospace, Lucida Console, Courier New; font-weight: bold; " -#define Div(S) "
" -#define Span(S) "" +#define ETH_HTML_SMALL "font-size: small; " +#define ETH_HTML_MONO "font-family: Ubuntu Mono, Monospace, Lucida Console, Courier New; font-weight: bold; " +#define ETH_HTML_DIV(S) "
" +#define ETH_HTML_SPAN(S) "" void initUnits(QComboBox* _b); void setValueUnits(QComboBox* _units, QSpinBox* _value, dev::u256 _v); diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 181772ddb..a22653362 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -594,7 +594,7 @@ void Main::eval(QString const& _js) void Main::addConsoleMessage(QString const& _js, QString const& _s) { m_consoleHistory.push_back(qMakePair(_js, _s)); - QString r = "" Div(Mono "position: absolute; bottom: 0; border: 0px; margin: 0px; width: 100%"); + QString r = "" ETH_HTML_DIV(ETH_HTML_MONO "position: absolute; bottom: 0; border: 0px; margin: 0px; width: 100%"); for (auto const& i: m_consoleHistory) r += "
>" + i.first.toHtmlEscaped() + "
" "
 " + i.second + "
"; @@ -1623,7 +1623,7 @@ void Main::on_transactionQueue_currentItemChanged() if (tx.data().size()) s << dev::memDump(tx.data(), 16, true); } - s << "
Hex: " Span(Mono) << toHex(tx.rlp()) << "
"; + s << "
Hex: " ETH_HTML_SPAN(ETH_HTML_MONO) << toHex(tx.rlp()) << "
"; s << "
"; if (!!receipt.bloom()) s << "
Log Bloom: " << receipt.bloom() << "
"; @@ -1633,7 +1633,7 @@ void Main::on_transactionQueue_currentItemChanged() s << "
End State: " << receipt.stateRoot().abridged() << "
"; auto r = receipt.rlp(); s << "
Receipt: " << toString(RLP(r)) << "
"; - s << "
Receipt-Hex: " Span(Mono) << toHex(receipt.rlp()) << "
"; + s << "
Receipt-Hex: " ETH_HTML_SPAN(ETH_HTML_MONO) << toHex(receipt.rlp()) << "
"; s << renderDiff(ethereum()->diff(i, PendingBlock)); // s << "Pre: " << fs.rootHash() << "
"; // s << "Post: " << ts.rootHash() << ""; @@ -1768,9 +1768,9 @@ void Main::on_blocks_currentItemChanged() s << "
" << sha3(i.data()).abridged() << ": " << receipts.receipts[ii].stateRoot() << " [" << receipts.receipts[ii].gasUsed() << " used]" << "
"; ++ii; } - s << "
Post: " << info.stateRoot() << "" << "
"; - s << "
Dump: " Span(Mono) << toHex(block[0].data()) << "" << "
"; - s << "
Receipts-Hex: " Span(Mono) << toHex(receipts.rlp()) << "
"; + s << "
Post: " << info.stateRoot << "" << "
"; + s << "
Dump: " ETH_HTML_SPAN(ETH_HTML_MONO) << toHex(block[0].data()) << "" << "
"; + s << "
Receipts-Hex: " ETH_HTML_SPAN(ETH_HTML_MONO) << toHex(receipts.rlp()) << "
"; } else { @@ -1801,7 +1801,7 @@ void Main::on_blocks_currentItemChanged() else s << "

Data

" << dev::memDump(tx.data(), 16, true); } - s << "
Hex: " Span(Mono) << toHex(block[1][txi].data()) << "
"; + s << "
Hex: " ETH_HTML_SPAN(ETH_HTML_MONO) << toHex(block[1][txi].data()) << "
"; s << "
"; if (!!receipt.bloom()) s << "
Log Bloom: " << receipt.bloom() << "
"; @@ -1811,7 +1811,7 @@ void Main::on_blocks_currentItemChanged() s << "
End State: " << receipt.stateRoot().abridged() << "
"; auto r = receipt.rlp(); s << "
Receipt: " << toString(RLP(r)) << "
"; - s << "
Receipt-Hex: " Span(Mono) << toHex(receipt.rlp()) << "
"; + s << "
Receipt-Hex: " ETH_HTML_SPAN(ETH_HTML_MONO) << toHex(receipt.rlp()) << "
"; s << "

Diff

" << renderDiff(ethereum()->diff(txi, h)); ui->debugCurrent->setEnabled(true); ui->debugDumpState->setEnabled(true); @@ -1881,7 +1881,7 @@ void Main::on_accounts_currentItemChanged() for (auto const& i: storage) s << "@" << showbase << hex << prettyU256(i.first) << "    " << showbase << hex << prettyU256(i.second) << "
"; s << "

Body Code (" << sha3(ethereum()->codeAt(address)).abridged() << ")

" << disassemble(ethereum()->codeAt(address)); - s << Div(Mono) << toHex(ethereum()->codeAt(address)) << "
"; + s << ETH_HTML_DIV(ETH_HTML_MONO) << toHex(ethereum()->codeAt(address)) << "
"; ui->accountInfo->appendHtml(QString::fromStdString(s.str())); } catch (dev::InvalidTrie) diff --git a/alethzero/Transact.cpp b/alethzero/Transact.cpp index 594133ba4..80ac7fe91 100644 --- a/alethzero/Transact.cpp +++ b/alethzero/Transact.cpp @@ -346,7 +346,7 @@ void Transact::rejigData() htmlInfo = "

Dump

" + QString::fromStdString(dev::memDump(m_data, 8, true)); } - htmlInfo += "

Hex

" + QString(Div(Mono)) + QString::fromStdString(toHex(m_data)) + ""; + htmlInfo += "

Hex

" + QString(ETH_HTML_DIV(ETH_HTML_MONO)) + QString::fromStdString(toHex(m_data)) + ""; // Determine the minimum amount of gas we need to play... qint64 baseGas = (qint64)Transaction::gasRequired(m_data, 0);