From e0e2ffeb1a560e9c0027abacbd224ee8bb2751fe Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 2 Jul 2014 10:19:04 +0200 Subject: [PATCH] Remove unneeded dependencies. --- alethzero/Main.ui | 2 +- alethzero/MainWin.cpp | 2 +- libethereum/Client.h | 26 +++++++++++++++++++++++++- liblll/Assembly.cpp | 1 - liblll/Assembly.h | 1 - liblll/Parser.cpp | 5 ++++- stdserv.js | 3 +-- 7 files changed, 32 insertions(+), 8 deletions(-) diff --git a/alethzero/Main.ui b/alethzero/Main.ui index 3712ca489..d35e97646 100644 --- a/alethzero/Main.ui +++ b/alethzero/Main.ui @@ -1289,7 +1289,7 @@ font-size: 14pt background: white; border: 0; font-family: Monospace, Ubuntu Mono, Lucida Console, Courier New; -font-size: 12pt +font-size: 14pt diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 06fe64078..49434703c 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -803,6 +803,7 @@ void Main::on_blocks_currentItemChanged() { ui->info->clear(); eth::ClientGuard g(m_client.get()); + debugFinished(); if (auto item = ui->blocks->currentItem()) { auto hba = item->data(Qt::UserRole).toByteArray(); @@ -876,7 +877,6 @@ void Main::on_blocks_currentItemChanged() Transaction t = st.pending()[txi]; auto r = t.rlp(); - debugFinished(); bool done = m_currentExecution->setup(&r); if (!done) { diff --git a/libethereum/Client.h b/libethereum/Client.h index 8683b90f8..8279eed87 100644 --- a/libethereum/Client.h +++ b/libethereum/Client.h @@ -77,6 +77,27 @@ private: unsigned m_protocolVersion; }; +class TransactionFilter +{ +public: + TransactionFilter(int _blockFrom = 0, int _blockTo = -1, unsigned _max = 10): m_blockFrom(_blockFrom), m_blockTo(_blockTo), m_max(_max) {} + + TransactionFilter from(Address _a) { m_from.insert(_a); return *this; } + TransactionFilter to(Address _a) { m_to.insert(_a); return *this; } + TransactionFilter stateAltered(Address _a, u256 _l) { m_stateAltered.insert(std::make_pair(_a, _l)); return *this; } + TransactionFilter stateAltered(Address _a) { m_altered.insert(_a); return *this; } + TransactionFilter withMax(unsigned _m) { m_max = _m; return *this; } + +private: + std::set
m_from; + std::set
m_to; + std::set> m_stateAltered; + std::set
m_altered; + int m_blockFrom; + int m_blockTo; + unsigned m_max; +}; + /** * @brief Main API hub for interfacing with Ethereum. */ @@ -145,7 +166,7 @@ public: u256 countAt(Address _a, int _block = -1) const; u256 stateAt(Address _a, u256 _l, int _block = -1) const; bytes codeAt(Address _a, int _block = -1) const; - Transactions transactions(Addresses const& _from, Addresses const& _to, std::vector> const& _stateAlterations, Addresses const& _altered, int _blockFrom = 0, int _blockTo = -1, unsigned _max = 10) const; + Transactions transactions(TransactionFilter const& _f) const; // Misc stuff: @@ -195,6 +216,9 @@ public: private: void work(); + /// Return the actual block number of the block with the given int-number (positive/zero is the same, -(1 << 31) is next to be mined, < 0 is negative age, thus -1 is most recently mined, 0 is genesis. + unsigned blockNumber(int _b) const; + std::string m_clientVersion; ///< Our end-application client's name/version. VersionChecker m_vc; ///< Dummy object to check & update the protocol version. BlockChain m_bc; ///< Maintains block database. diff --git a/liblll/Assembly.cpp b/liblll/Assembly.cpp index 7016b2863..f4d700f92 100644 --- a/liblll/Assembly.cpp +++ b/liblll/Assembly.cpp @@ -22,7 +22,6 @@ #include "Assembly.h" #include -#include using namespace std; using namespace eth; diff --git a/liblll/Assembly.h b/liblll/Assembly.h index 9cd10a820..4a6d02ce0 100644 --- a/liblll/Assembly.h +++ b/liblll/Assembly.h @@ -25,7 +25,6 @@ #include #include #include -#include #include "Exceptions.h" namespace eth diff --git a/liblll/Parser.cpp b/liblll/Parser.cpp index 0ae3c6fee..d7658f672 100644 --- a/liblll/Parser.cpp +++ b/liblll/Parser.cpp @@ -24,7 +24,6 @@ #include #include #include -#include using namespace std; using namespace eth; @@ -73,6 +72,10 @@ void eth::parseTreeLLL(string const& _s, sp::utree& o_out) typedef sp::basic_string symbol_type; typedef string::const_iterator it; + static const u256 ether = u256(1000000000) * 1000000000; + static const u256 finney = u256(1000000000) * 1000000; + static const u256 szabo = u256(1000000000) * 1000; + qi::rule element; qi::rule str = '"' > qi::lexeme[+(~qi::char_(std::string("\"") + '\0'))] > '"'; qi::rule strsh = '\'' > qi::lexeme[+(~qi::char_(std::string(" ;@()[]{}:") + '\0'))]; diff --git a/stdserv.js b/stdserv.js index be7ce6cb0..d3a1fb212 100644 --- a/stdserv.js +++ b/stdserv.js @@ -52,8 +52,7 @@ eth.transact(eth.key, '0', config, "0".pad(32) + nameReg.pad(32), 10000, eth.gas var gavCoinCode = eth.lll("{ [[ (caller) ]]: 0x1000000 - [0] 'GavCoin - (call (- (gas) 100) " + nameReg + " 0 0 7 0 0) + (call (- (gas) 100) " + nameReg + " 0 0 (lit 0 'GavCoin) 0 0) (returnlll { (when (!= (calldatasize) 64) (stop)) [fromBal] @@(caller)