";
+ s = "" Div(Mono "position: absolute; bottom: 0; border: 0px; margin: 0px; width: 100%");
for (auto const& i: m_consoleHistory)
s += "
>" + i.first.toHtmlEscaped() + "
"
"
" + i.second + "
";
@@ -755,7 +760,7 @@ void Main::on_importKey_triggered()
void Main::on_importKeyFile_triggered()
{
- QString s = QFileDialog::getOpenFileName(this, "Import Account", QDir::homePath(), "JSON Files (*.json);;All Files (*)");
+ QString s = QFileDialog::getOpenFileName(this, "Claim Account Contents", QDir::homePath(), "JSON Files (*.json);;All Files (*)");
try
{
js::mValue val;
@@ -785,8 +790,12 @@ void Main::on_importKeyFile_triggered()
if (std::find(m_myKeys.begin(), m_myKeys.end(), k) == m_myKeys.end())
{
- m_myKeys.append(k);
- keysChanged();
+ if (m_myKeys.empty())
+ {
+ m_myKeys.push_back(KeyPair::create());
+ keysChanged();
+ }
+ ethereum()->transact(k.sec(), ethereum()->balanceAt(k.address()) - gasPrice() * c_txGas, m_myKeys.back().address(), {}, c_txGas, gasPrice());
}
else
QMessageBox::warning(this, "Already Have Key", "Could not import the secret key: we already own this account.");
@@ -1093,7 +1102,7 @@ void Main::refreshBlockChain()
auto b = bc.block(h);
for (auto const& i: RLP(b)[1])
{
- Transaction t(i.data());
+ Transaction t(i.data(), CheckSignature::Sender);
if (bm || transactionMatch(filter, t))
{
QString s = t.receiveAddress() ?
@@ -1276,12 +1285,12 @@ void Main::on_transactionQueue_currentItemChanged()
if (tx.data().size())
s << dev::memDump(tx.data(), 16, true);
}
- s << "
Hex: " << toHex(tx.rlp()) << "
";
+ s << "
Hex: " Span(Mono) << toHex(tx.rlp()) << "
";
s << "
";
s << "
Log Bloom: " << receipt.bloom() << "
";
auto r = receipt.rlp();
s << "
Receipt: " << toString(RLP(r)) << "
";
- s << "
Receipt-Hex: " << toHex(receipt.rlp()) << "
";
+ s << "
Receipt-Hex: " Span(Mono) << toHex(receipt.rlp()) << "
";
s << renderDiff(ethereum()->diff(i, 0));
// s << "Pre: " << fs.rootHash() << "
";
// s << "Post:
" << ts.rootHash() << "";
@@ -1372,13 +1381,13 @@ void Main::on_blocks_currentItemChanged()
for (auto const& i: block[1])
s << "
" << sha3(i.data()).abridged();// << ":
" << i[1].toHash() << " [
" << i[2].toInt() << " used]";
s << "
Post:
" << info.stateRoot << "";
- s << "
Dump:
" << toHex(block[0].data()) << "";
- s << "
Receipts-Hex: " << toHex(ethereum()->blockChain().receipts(h).rlp()) << "
";
+ s << "
Dump: " Span(Mono) << toHex(block[0].data()) << "";
+ s << "
Receipts-Hex: " Span(Mono) << toHex(ethereum()->blockChain().receipts(h).rlp()) << "
";
}
else
{
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();
h256 th = sha3(rlpList(ss, tx.nonce()));
TransactionReceipt receipt = ethereum()->blockChain().receipts(h).receipts[txi];
@@ -1407,12 +1416,12 @@ void Main::on_blocks_currentItemChanged()
if (tx.data().size())
s << dev::memDump(tx.data(), 16, true);
}
- s << "
Hex: " << toHex(block[1][txi].data()) << "
";
+ s << "
Hex: " Span(Mono) << toHex(block[1][txi].data()) << "
";
s << "
";
s << "
Log Bloom: " << receipt.bloom() << "
";
auto r = receipt.rlp();
s << "
Receipt: " << toString(RLP(r)) << "
";
- s << "
Receipt-Hex: " << toHex(receipt.rlp()) << "
";
+ s << "
Receipt-Hex: " Span(Mono) << toHex(receipt.rlp()) << "
";
s << renderDiff(ethereum()->diff(txi, h));
ui->debugCurrent->setEnabled(true);
ui->debugDumpState->setEnabled(true);
@@ -1531,6 +1540,7 @@ void Main::on_contracts_currentItemChanged()
for (auto const& i: storage)
s << "@" << showbase << hex << prettyU256(i.first).toStdString() << " " << showbase << hex << prettyU256(i.second).toStdString() << "
";
s << "
Body Code
" << disassemble(ethereum()->codeAt(address));
+ s << Div(Mono) << toHex(ethereum()->codeAt(address)) << "
";
ui->contractInfo->appendHtml(QString::fromStdString(s.str()));
}
catch (dev::InvalidTrie)
@@ -1640,13 +1650,18 @@ static shh::Topic topicFromText(QString _s)
return ret;
}
-
bool Main::sourceIsSolidity(string const& _source)
{
// TODO: Improve this heuristic
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& _contractName)
{
@@ -1681,6 +1696,7 @@ void Main::on_data_textChanged()
dev::solidity::CompilerStack compiler;
try
{
+// compiler.addSources(dev::solidity::StandardSources);
m_data = compiler.compile(src, m_enableOptimizer);
solidity = "