Browse Source

Remove unneeded dependencies.

cl-refactor
Gav Wood 11 years ago
parent
commit
e0e2ffeb1a
  1. 2
      alethzero/Main.ui
  2. 2
      alethzero/MainWin.cpp
  3. 26
      libethereum/Client.h
  4. 1
      liblll/Assembly.cpp
  5. 1
      liblll/Assembly.h
  6. 5
      liblll/Parser.cpp
  7. 3
      stdserv.js

2
alethzero/Main.ui

@ -1289,7 +1289,7 @@ font-size: 14pt</string>
<string notr="true">background: white; <string notr="true">background: white;
border: 0; border: 0;
font-family: Monospace, Ubuntu Mono, Lucida Console, Courier New; font-family: Monospace, Ubuntu Mono, Lucida Console, Courier New;
font-size: 12pt</string> font-size: 14pt</string>
</property> </property>
<property name="inputMask"> <property name="inputMask">
<string/> <string/>

2
alethzero/MainWin.cpp

@ -803,6 +803,7 @@ void Main::on_blocks_currentItemChanged()
{ {
ui->info->clear(); ui->info->clear();
eth::ClientGuard g(m_client.get()); eth::ClientGuard g(m_client.get());
debugFinished();
if (auto item = ui->blocks->currentItem()) if (auto item = ui->blocks->currentItem())
{ {
auto hba = item->data(Qt::UserRole).toByteArray(); auto hba = item->data(Qt::UserRole).toByteArray();
@ -876,7 +877,6 @@ void Main::on_blocks_currentItemChanged()
Transaction t = st.pending()[txi]; Transaction t = st.pending()[txi];
auto r = t.rlp(); auto r = t.rlp();
debugFinished();
bool done = m_currentExecution->setup(&r); bool done = m_currentExecution->setup(&r);
if (!done) if (!done)
{ {

26
libethereum/Client.h

@ -77,6 +77,27 @@ private:
unsigned m_protocolVersion; 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<Address> m_from;
std::set<Address> m_to;
std::set<std::pair<Address, u256>> m_stateAltered;
std::set<Address> m_altered;
int m_blockFrom;
int m_blockTo;
unsigned m_max;
};
/** /**
* @brief Main API hub for interfacing with Ethereum. * @brief Main API hub for interfacing with Ethereum.
*/ */
@ -145,7 +166,7 @@ public:
u256 countAt(Address _a, int _block = -1) const; u256 countAt(Address _a, int _block = -1) const;
u256 stateAt(Address _a, u256 _l, int _block = -1) const; u256 stateAt(Address _a, u256 _l, int _block = -1) const;
bytes codeAt(Address _a, int _block = -1) const; bytes codeAt(Address _a, int _block = -1) const;
Transactions transactions(Addresses const& _from, Addresses const& _to, std::vector<std::pair<u256, u256>> const& _stateAlterations, Addresses const& _altered, int _blockFrom = 0, int _blockTo = -1, unsigned _max = 10) const; Transactions transactions(TransactionFilter const& _f) const;
// Misc stuff: // Misc stuff:
@ -195,6 +216,9 @@ public:
private: private:
void work(); 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. std::string m_clientVersion; ///< Our end-application client's name/version.
VersionChecker m_vc; ///< Dummy object to check & update the protocol version. VersionChecker m_vc; ///< Dummy object to check & update the protocol version.
BlockChain m_bc; ///< Maintains block database. BlockChain m_bc; ///< Maintains block database.

1
liblll/Assembly.cpp

@ -22,7 +22,6 @@
#include "Assembly.h" #include "Assembly.h"
#include <libethential/Log.h> #include <libethential/Log.h>
#include <libethcore/CommonEth.h>
using namespace std; using namespace std;
using namespace eth; using namespace eth;

1
liblll/Assembly.h

@ -25,7 +25,6 @@
#include <sstream> #include <sstream>
#include <libethential/Common.h> #include <libethential/Common.h>
#include <libevmface/Instruction.h> #include <libevmface/Instruction.h>
#include <libethcore/SHA3.h>
#include "Exceptions.h" #include "Exceptions.h"
namespace eth namespace eth

5
liblll/Parser.cpp

@ -24,7 +24,6 @@
#include <boost/spirit/include/qi.hpp> #include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix.hpp> #include <boost/spirit/include/phoenix.hpp>
#include <boost/spirit/include/support_utree.hpp> #include <boost/spirit/include/support_utree.hpp>
#include <libethcore/CommonEth.h>
using namespace std; using namespace std;
using namespace eth; using namespace eth;
@ -73,6 +72,10 @@ void eth::parseTreeLLL(string const& _s, sp::utree& o_out)
typedef sp::basic_string<std::string, sp::utree_type::symbol_type> symbol_type; typedef sp::basic_string<std::string, sp::utree_type::symbol_type> symbol_type;
typedef string::const_iterator it; 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<it, qi::ascii::space_type, sp::utree()> element; qi::rule<it, qi::ascii::space_type, sp::utree()> element;
qi::rule<it, string()> str = '"' > qi::lexeme[+(~qi::char_(std::string("\"") + '\0'))] > '"'; qi::rule<it, string()> str = '"' > qi::lexeme[+(~qi::char_(std::string("\"") + '\0'))] > '"';
qi::rule<it, string()> strsh = '\'' > qi::lexeme[+(~qi::char_(std::string(" ;@()[]{}:") + '\0'))]; qi::rule<it, string()> strsh = '\'' > qi::lexeme[+(~qi::char_(std::string(" ;@()[]{}:") + '\0'))];

3
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("{ var gavCoinCode = eth.lll("{
[[ (caller) ]]: 0x1000000 [[ (caller) ]]: 0x1000000
[0] 'GavCoin (call (- (gas) 100) " + nameReg + " 0 0 (lit 0 'GavCoin) 0 0)
(call (- (gas) 100) " + nameReg + " 0 0 7 0 0)
(returnlll { (returnlll {
(when (!= (calldatasize) 64) (stop)) (when (!= (calldatasize) 64) (stop))
[fromBal] @@(caller) [fromBal] @@(caller)

Loading…
Cancel
Save