From ff33d16935ca6eb27a7c6b3ce337e0be9369f2d7 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 22 Jun 2014 20:36:16 +0100 Subject: [PATCH 1/4] Better language detection. --- liblll/Parser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/liblll/Parser.cpp b/liblll/Parser.cpp index 13faf5839..0ae3c6fee 100644 --- a/liblll/Parser.cpp +++ b/liblll/Parser.cpp @@ -118,6 +118,9 @@ void eth::parseTreeLLL(string const& _s, sp::utree& o_out) if (!incomment) s.push_back(i); } - qi::phrase_parse(s.cbegin(), s.cend(), element, space, qi::skip_flag::dont_postskip, o_out); + auto ret = s.cbegin(); + qi::phrase_parse(ret, s.cend(), element, space, qi::skip_flag::dont_postskip, o_out); + if (ret != s.cend()) + throw std::exception(); } From 50f1cbf19dcbed686dfef19b94894d918d3f4ba9 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 25 Jun 2014 12:23:27 +0200 Subject: [PATCH 2/4] Typo fix. --- alethzero/MainWin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index f30dd0f2a..267efe4f6 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -878,7 +878,9 @@ void Main::on_blocks_currentItemChanged() s.resetTo(bi.); s <<*/ - // TODO: Make function: State::fromBlock (grabs block's parent's stateRoot, playback()'s transactions), then use State::fromPending(). Maybe even make a State::pendingDiff(). + eth::State s = m_client->blockChain().stateAt(h); + StateDiff d = s.pendingDiff(txi); + // TODO: Make function: BlockChain::stateAt (grabs block's parent's stateRoot, playback()'s transactions), then use State::fromPending(). Maybe even make a State::pendingDiff(). } @@ -987,9 +989,9 @@ void Main::on_data_textChanged() errors.push_back("Serpent " + err); } } -#endif else lll = "

Opt

" + QString::fromStdString(asmcodeopt).toHtmlEscaped() + "

Pre

" + QString::fromStdString(asmcode).toHtmlEscaped() + "
"; +#endif } QString errs; if (errors.size()) From c55327800ffb072a538c47d73a5f8e5f14a325f1 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 25 Jun 2014 16:10:57 +0200 Subject: [PATCH 3/4] Disable unfinished code. --- alethzero/MainWin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 267efe4f6..cc9b63d85 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -878,8 +878,8 @@ void Main::on_blocks_currentItemChanged() s.resetTo(bi.); s <<*/ - eth::State s = m_client->blockChain().stateAt(h); - StateDiff d = s.pendingDiff(txi); +// eth::State s = m_client->blockChain().stateAt(h); +// StateDiff d = s.pendingDiff(txi); // TODO: Make function: BlockChain::stateAt (grabs block's parent's stateRoot, playback()'s transactions), then use State::fromPending(). Maybe even make a State::pendingDiff(). } From 994af9c203159e4e6963671b48605b3e97e2d6dd Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 25 Jun 2014 19:43:39 +0200 Subject: [PATCH 4/4] Minor fix to the fix. --- alethzero/MainWin.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index cc9b63d85..00264e539 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -990,8 +990,8 @@ void Main::on_data_textChanged() } } else - lll = "

Opt

" + QString::fromStdString(asmcodeopt).toHtmlEscaped() + "

Pre

" + QString::fromStdString(asmcode).toHtmlEscaped() + "
"; #endif + lll = "

Opt

" + QString::fromStdString(asmcodeopt).toHtmlEscaped() + "

Pre

" + QString::fromStdString(asmcode).toHtmlEscaped() + "
"; } QString errs; if (errors.size()) @@ -1191,6 +1191,8 @@ void Main::on_send_clicked() void Main::on_debug_clicked() { debugFinished(); + try + { u256 totalReq = value() + fee(); eth::ClientGuard l(&*m_client); for (auto i: m_myKeys) @@ -1224,6 +1226,11 @@ void Main::on_debug_clicked() return; } statusBar()->showMessage("Couldn't make transaction: no single account contains at least the required amount."); + } + catch (eth::Exception const& _e) + { + statusBar()->showMessage("Error running transaction: " + QString::fromStdString(_e.description())); + } } void Main::on_create_triggered()