Browse Source

Merge branch 'develop' of github.com:ethereum/cpp-ethereum into develop

cl-refactor
Gav Wood 10 years ago
parent
commit
22ff5b1ee1
  1. 2
      alethzero/MainWin.h
  2. 6
      alethzero/NatspecHandler.h
  3. 7
      ethminer/MinerAux.h
  4. 5
      json_spirit/json_spirit_writer_template.h
  5. 4
      libdevcrypto/Common.cpp
  6. 2
      libdevcrypto/CryptoPP.cpp
  7. 2
      libdevcrypto/CryptoPP.h
  8. 4
      libdevcrypto/OverlayDB.cpp
  9. 51
      libethash-cl/ethash_cl_miner.cpp
  10. 5
      libethash-cl/ethash_cl_miner.h
  11. 15
      libethcore/Ethash.cpp
  12. 6
      libethcore/Ethash.h
  13. 4
      libethereum/Client.h
  14. 7
      libethereum/ClientBase.h
  15. 8
      libethereum/Precompiled.cpp
  16. 2
      libevmasm/Assembly.cpp
  17. 4
      libp2p/Common.h
  18. 4
      libp2p/Host.cpp
  19. 2
      libp2p/Network.cpp
  20. 10
      libp2p/NodeTable.cpp
  21. 4
      libp2p/RLPxFrameIO.cpp
  22. 4
      libp2p/UDP.cpp
  23. 2
      libp2p/UDP.h
  24. 42
      libsolidity/AST.cpp
  25. 2
      libsolidity/AST.h
  26. 2
      libsolidity/CompilerContext.cpp
  27. 2
      libsolidity/LValue.h
  28. 12
      libsolidity/Types.cpp
  29. 4
      libsolidity/Types.h
  30. 2
      libtestutils/FixedClient.h
  31. 2
      libweb3jsonrpc/WebThreeStubServer.h
  32. 18
      libweb3jsonrpc/WebThreeStubServerBase.cpp
  33. 3
      libweb3jsonrpc/WebThreeStubServerBase.h
  34. 14
      libweb3jsonrpc/abstractwebthreestubserver.h
  35. 3
      libweb3jsonrpc/spec.json
  36. 8
      libwhisper/WhisperHost.h
  37. 4
      mix/ClientModel.cpp
  38. 2
      mix/CodeModel.cpp
  39. 2
      mix/MixClient.h
  40. BIN
      mix/qml/img/addblock.png
  41. BIN
      mix/qml/img/addblock@2x.png
  42. BIN
      mix/qml/img/duplicateicon.png
  43. BIN
      mix/qml/img/duplicateicon@2x.png
  44. BIN
      mix/qml/img/leftarrow.png
  45. BIN
      mix/qml/img/leftarrow@2x.png
  46. BIN
      mix/qml/img/newaccounticon.png
  47. BIN
      mix/qml/img/newaccounticon@2x.png
  48. BIN
      mix/qml/img/recyclediscard.png
  49. BIN
      mix/qml/img/recyclediscard@2x.png
  50. BIN
      mix/qml/img/recycleicon.png
  51. BIN
      mix/qml/img/recycleicon@2x.png
  52. BIN
      mix/qml/img/recyclekeep.png
  53. BIN
      mix/qml/img/recyclekeep@2x.png
  54. BIN
      mix/qml/img/restoreicon.png
  55. BIN
      mix/qml/img/restoreicon@2x.png
  56. BIN
      mix/qml/img/rightarrow.png
  57. BIN
      mix/qml/img/rightarrow@2x.png
  58. BIN
      mix/qml/img/saveicon.png
  59. BIN
      mix/qml/img/saveicon@2x.png
  60. BIN
      mix/qml/img/sendtransactionicon.png
  61. BIN
      mix/qml/img/sendtransactionicon@2x.png
  62. 2384
      test/libethereum/StateTestsFiller/stPreCompiledContractsFiller.json
  63. 38
      test/libethereum/StateTestsFiller/stSpecialTestFiller.json
  64. 15
      test/libethereum/TransactionTestsFiller/ttTransactionTestFiller.json
  65. 2
      test/libp2p/net.cpp
  66. 14
      test/libweb3jsonrpc/webthreestubclient.h
  67. 4
      test/libwhisper/whisperMessage.cpp

2
alethzero/MainWin.h

@ -238,7 +238,7 @@ private:
void installNameRegWatch(); void installNameRegWatch();
void installBalancesWatch(); void installBalancesWatch();
virtual void timerEvent(QTimerEvent*); virtual void timerEvent(QTimerEvent*) override;
void refreshNetwork(); void refreshNetwork();
void refreshMining(); void refreshMining();

6
alethzero/NatspecHandler.h

@ -39,17 +39,17 @@ class NatspecHandler: public NatSpecFace
~NatspecHandler(); ~NatspecHandler();
/// Stores locally in a levelDB a key value pair of contract code hash to natspec documentation /// Stores locally in a levelDB a key value pair of contract code hash to natspec documentation
void add(dev::h256 const& _contractHash, std::string const& _doc); virtual void add(dev::h256 const& _contractHash, std::string const& _doc) override;
/// Retrieves the natspec documentation as a string given a contract code hash /// Retrieves the natspec documentation as a string given a contract code hash
std::string retrieve(dev::h256 const& _contractHash) const override; std::string retrieve(dev::h256 const& _contractHash) const override;
/// Given a json natspec string and the transaction data return the user notice /// Given a json natspec string and the transaction data return the user notice
std::string getUserNotice(std::string const& json, const dev::bytes& _transactionData); virtual std::string getUserNotice(std::string const& json, const dev::bytes& _transactionData) override;
/// Given a contract code hash and the transaction's data retrieve the natspec documention's /// Given a contract code hash and the transaction's data retrieve the natspec documention's
/// user notice for that transaction. /// user notice for that transaction.
/// @returns The user notice or an empty string if no natspec for the contract exists /// @returns The user notice or an empty string if no natspec for the contract exists
/// or if the existing natspec does not document the @c _methodName /// or if the existing natspec does not document the @c _methodName
std::string getUserNotice(dev::h256 const& _contractHash, dev::bytes const& _transactionDacta); virtual std::string getUserNotice(dev::h256 const& _contractHash, dev::bytes const& _transactionDacta) override;
private: private:
ldb::ReadOptions m_readOptions; ldb::ReadOptions m_readOptions;

7
ethminer/MinerAux.h

@ -127,6 +127,11 @@ public:
cerr << "Bad " << arg << " option: " << argv[i] << endl; cerr << "Bad " << arg << " option: " << argv[i] << endl;
throw BadArgument(); throw BadArgument();
} }
else if (arg == "--list-devices")
{
ProofOfWork::GPUMiner::listDevices();
exit(0);
}
else if (arg == "--use-chunks") else if (arg == "--use-chunks")
{ {
dagChunks = 4; dagChunks = 4;
@ -175,7 +180,7 @@ public:
m_minerType = MinerType::CPU; m_minerType = MinerType::CPU;
else if (arg == "-G" || arg == "--opencl") else if (arg == "-G" || arg == "--opencl")
{ {
if (!ProofOfWork::GPUMiner::haveSufficientGPUMemory()) if (!ProofOfWork::GPUMiner::haveSufficientMemory())
{ {
cout << "No GPU device with sufficient memory was found. Defaulting to CPU" << endl; cout << "No GPU device with sufficient memory was found. Defaulting to CPU" << endl;
m_minerType = MinerType::CPU; m_minerType = MinerType::CPU;

5
json_spirit/json_spirit_writer_template.h

@ -25,13 +25,9 @@ namespace json_spirit
return 'A' - 10 + ch; return 'A' - 10 + ch;
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-local-typedefs")
template< class String_type > template< class String_type >
String_type non_printable_to_string( unsigned int c ) String_type non_printable_to_string( unsigned int c )
{ {
typedef typename String_type::value_type Char_type;
String_type result( 6, '\\' ); String_type result( 6, '\\' );
result[1] = 'u'; result[1] = 'u';
@ -43,7 +39,6 @@ namespace json_spirit
return result; return result;
} }
#pragma GCC diagnostic pop
template< typename Char_type, class String_type > template< typename Char_type, class String_type >
bool add_esc_char( Char_type c, String_type& s ) bool add_esc_char( Char_type c, String_type& s )

4
libdevcrypto/Common.cpp

@ -54,7 +54,7 @@ Public dev::toPublic(Secret const& _secret)
{ {
Public p; Public p;
s_secp256k1.toPublic(_secret, p); s_secp256k1.toPublic(_secret, p);
return std::move(p); return p;
} }
Address dev::toAddress(Public const& _public) Address dev::toAddress(Public const& _public)
@ -230,7 +230,7 @@ h256 crypto::kdf(Secret const& _priv, h256 const& _hash)
if (!s || !_hash || !_priv) if (!s || !_hash || !_priv)
BOOST_THROW_EXCEPTION(InvalidState()); BOOST_THROW_EXCEPTION(InvalidState());
return std::move(s); return s;
} }
h256 Nonce::get(bool _commit) h256 Nonce::get(bool _commit)

2
libdevcrypto/CryptoPP.cpp

@ -61,7 +61,7 @@ bytes Secp256k1::eciesKDF(Secret _z, bytes _s1, unsigned kdByteLen)
} }
k.resize(kdByteLen); k.resize(kdByteLen);
return move(k); return k;
} }
void Secp256k1::encryptECIES(Public const& _k, bytes& io_cipher) void Secp256k1::encryptECIES(Public const& _k, bytes& io_cipher)

2
libdevcrypto/CryptoPP.h

@ -59,7 +59,7 @@ namespace crypto
using namespace CryptoPP; using namespace CryptoPP;
inline ECP::Point publicToPoint(Public const& _p) { Integer x(_p.data(), 32); Integer y(_p.data() + 32, 32); return std::move(ECP::Point(x,y)); } inline ECP::Point publicToPoint(Public const& _p) { Integer x(_p.data(), 32); Integer y(_p.data() + 32, 32); return ECP::Point(x,y); }
inline Integer secretToExponent(Secret const& _s) { return std::move(Integer(_s.data(), Secret::size)); } inline Integer secretToExponent(Secret const& _s) { return std::move(Integer(_s.data(), Secret::size)); }

4
libdevcrypto/OverlayDB.cpp

@ -95,7 +95,7 @@ bytes OverlayDB::lookupAux(h256 const& _h) const
{ {
bytes ret = MemoryDB::lookupAux(_h); bytes ret = MemoryDB::lookupAux(_h);
if (!ret.empty() || !m_db) if (!ret.empty() || !m_db)
return move(ret); return ret;
std::string v; std::string v;
bytes b = _h.asBytes(); bytes b = _h.asBytes();
b.push_back(255); // for aux b.push_back(255); // for aux
@ -116,7 +116,7 @@ std::string OverlayDB::lookup(h256 const& _h) const
std::string ret = MemoryDB::lookup(_h); std::string ret = MemoryDB::lookup(_h);
if (ret.empty() && m_db) if (ret.empty() && m_db)
m_db->Get(m_readOptions, ldb::Slice((char const*)_h.data(), 32), &ret); m_db->Get(m_readOptions, ldb::Slice((char const*)_h.data(), 32), &ret);
return move(ret); return ret;
} }
bool OverlayDB::exists(h256 const& _h) const bool OverlayDB::exists(h256 const& _h) const

51
libethash-cl/ethash_cl_miner.cpp

@ -127,7 +127,7 @@ unsigned ethash_cl_miner::get_num_devices(unsigned _platformId)
return devices.size(); return devices.size();
} }
bool ethash_cl_miner::haveSufficientGPUMemory(unsigned _platformId) bool ethash_cl_miner::haveSufficientGPUMemory()
{ {
std::vector<cl::Platform> platforms; std::vector<cl::Platform> platforms;
cl::Platform::get(&platforms); cl::Platform::get(&platforms);
@ -136,15 +136,25 @@ bool ethash_cl_miner::haveSufficientGPUMemory(unsigned _platformId)
ETHCL_LOG("No OpenCL platforms found."); ETHCL_LOG("No OpenCL platforms found.");
return false; return false;
} }
for (unsigned i = 0; i < platforms.size(); ++i)
if (haveSufficientGPUMemory(i))
return true;
return false;
}
bool ethash_cl_miner::haveSufficientGPUMemory(unsigned _platformId)
{
std::vector<cl::Platform> platforms;
cl::Platform::get(&platforms);
if (_platformId >= platforms.size())
return false;
std::vector<cl::Device> devices; std::vector<cl::Device> devices;
unsigned platform_num = std::min<unsigned>(_platformId, platforms.size() - 1); unsigned platform_num = std::min<unsigned>(_platformId, platforms.size() - 1);
platforms[platform_num].getDevices(CL_DEVICE_TYPE_ALL, &devices); platforms[platform_num].getDevices(CL_DEVICE_TYPE_ALL, &devices);
if (devices.empty()) if (devices.empty())
{
ETHCL_LOG("No OpenCL devices found.");
return false; return false;
}
for (cl::Device const& device: devices) for (cl::Device const& device: devices)
{ {
@ -168,6 +178,39 @@ bool ethash_cl_miner::haveSufficientGPUMemory(unsigned _platformId)
return false; return false;
} }
void ethash_cl_miner::listDevices()
{
std::vector<cl::Platform> platforms;
cl::Platform::get(&platforms);
if (platforms.empty())
{
ETHCL_LOG("No OpenCL platforms found.");
return;
}
for (unsigned i = 0; i < platforms.size(); ++i)
listDevices(i);
}
void ethash_cl_miner::listDevices(unsigned _platformId)
{
std::vector<cl::Platform> platforms;
cl::Platform::get(&platforms);
if (_platformId >= platforms.size())
return;
std::string outString ="Listing OpenCL devices for platform " + to_string(_platformId) + "\n[deviceID] deviceName\n";
std::vector<cl::Device> devices;
platforms[_platformId].getDevices(CL_DEVICE_TYPE_ALL, &devices);
unsigned i = 0;
std::string deviceString;
for (cl::Device const& device: devices)
{
outString += "[" + to_string(i) + "] " + device.getInfo<CL_DEVICE_NAME>() + "\n";
++i;
}
ETHCL_LOG(outString);
}
void ethash_cl_miner::finish() void ethash_cl_miner::finish()
{ {
if (m_queue()) if (m_queue())

5
libethash-cl/ethash_cl_miner.h

@ -35,7 +35,10 @@ public:
static unsigned get_num_platforms(); static unsigned get_num_platforms();
static unsigned get_num_devices(unsigned _platformId = 0); static unsigned get_num_devices(unsigned _platformId = 0);
static std::string platform_info(unsigned _platformId = 0, unsigned _deviceId = 0); static std::string platform_info(unsigned _platformId = 0, unsigned _deviceId = 0);
static bool haveSufficientGPUMemory(unsigned _platformId = 0); static bool haveSufficientGPUMemory();
static bool haveSufficientGPUMemory(unsigned _platformId);
static void listDevices();
static void listDevices(unsigned _platformId);
bool init( bool init(
uint8_t const* _dag, uint8_t const* _dag,

15
libethcore/Ethash.cpp

@ -364,11 +364,6 @@ void Ethash::GPUMiner::pause()
stopWorking(); stopWorking();
} }
bool Ethash::GPUMiner::haveSufficientGPUMemory()
{
return ethash_cl_miner::haveSufficientGPUMemory(s_platformId);
}
std::string Ethash::GPUMiner::platformInfo() std::string Ethash::GPUMiner::platformInfo()
{ {
return ethash_cl_miner::platform_info(s_platformId, s_deviceId); return ethash_cl_miner::platform_info(s_platformId, s_deviceId);
@ -379,6 +374,16 @@ unsigned Ethash::GPUMiner::getNumDevices()
return ethash_cl_miner::get_num_devices(s_platformId); return ethash_cl_miner::get_num_devices(s_platformId);
} }
void Ethash::GPUMiner::listDevices()
{
return ethash_cl_miner::listDevices();
}
bool Ethash::GPUMiner::haveSufficientMemory()
{
return ethash_cl_miner::haveSufficientGPUMemory();
}
#endif #endif
} }

6
libethcore/Ethash.h

@ -87,10 +87,11 @@ public:
static unsigned instances() { return s_numInstances > 0 ? s_numInstances : std::thread::hardware_concurrency(); } static unsigned instances() { return s_numInstances > 0 ? s_numInstances : std::thread::hardware_concurrency(); }
static std::string platformInfo(); static std::string platformInfo();
static bool haveSufficientGPUMemory() { return false; }
static void setDefaultPlatform(unsigned) {} static void setDefaultPlatform(unsigned) {}
static void setDagChunks(unsigned) {} static void setDagChunks(unsigned) {}
static void setDefaultDevice(unsigned) {} static void setDefaultDevice(unsigned) {}
static void listDevices() {}
static bool haveSufficientMemory() { return false; }
static void setNumInstances(unsigned _instances) { s_numInstances = std::min<unsigned>(_instances, std::thread::hardware_concurrency()); } static void setNumInstances(unsigned _instances) { s_numInstances = std::min<unsigned>(_instances, std::thread::hardware_concurrency()); }
protected: protected:
void kickOff() override void kickOff() override
@ -117,8 +118,9 @@ public:
static unsigned instances() { return s_numInstances > 0 ? s_numInstances : 1; } static unsigned instances() { return s_numInstances > 0 ? s_numInstances : 1; }
static std::string platformInfo(); static std::string platformInfo();
static bool haveSufficientGPUMemory();
static unsigned getNumDevices(); static unsigned getNumDevices();
static void listDevices();
static bool haveSufficientMemory();
static void setDefaultPlatform(unsigned _id) { s_platformId = _id; } static void setDefaultPlatform(unsigned _id) { s_platformId = _id; }
static void setDefaultDevice(unsigned _id) { s_deviceId = _id; } static void setDefaultDevice(unsigned _id) { s_deviceId = _id; }
static void setNumInstances(unsigned _instances) { s_numInstances = std::min<unsigned>(_instances, getNumDevices()); } static void setNumInstances(unsigned _instances) { s_numInstances = std::min<unsigned>(_instances, getNumDevices()); }

4
libethereum/Client.h

@ -143,7 +143,7 @@ public:
ExecutionResult call(Address _dest, bytes const& _data = bytes(), u256 _gas = 125000, u256 _value = 0, u256 _gasPrice = 1 * ether, Address const& _from = Address()); ExecutionResult call(Address _dest, bytes const& _data = bytes(), u256 _gas = 125000, u256 _value = 0, u256 _gasPrice = 1 * ether, Address const& _from = Address());
/// Get the remaining gas limit in this block. /// Get the remaining gas limit in this block.
virtual u256 gasLimitRemaining() const { return m_postMine.gasLimitRemaining(); } virtual u256 gasLimitRemaining() const override { return m_postMine.gasLimitRemaining(); }
// [PRIVATE API - only relevant for base clients, not available in general] // [PRIVATE API - only relevant for base clients, not available in general]
dev::eth::State state(unsigned _txi, h256 _block) const; dev::eth::State state(unsigned _txi, h256 _block) const;
@ -159,7 +159,7 @@ public:
// Mining stuff: // Mining stuff:
void setAddress(Address _us) { WriteGuard l(x_preMine); m_preMine.setAddress(_us); } virtual void setAddress(Address _us) override { WriteGuard l(x_preMine); m_preMine.setAddress(_us); }
/// Check block validity prior to mining. /// Check block validity prior to mining.
bool miningParanoia() const { return m_paranoia; } bool miningParanoia() const { return m_paranoia; }

7
libethereum/ClientBase.h

@ -132,8 +132,8 @@ public:
virtual Transactions pending() const override; virtual Transactions pending() const override;
virtual h256s pendingHashes() const override; virtual h256s pendingHashes() const override;
ImportResult injectTransaction(bytes const& _rlp) override { prepareForTransaction(); return m_tq.import(_rlp); } virtual ImportResult injectTransaction(bytes const& _rlp) override { prepareForTransaction(); return m_tq.import(_rlp); }
ImportResult injectBlock(bytes const& _block); virtual ImportResult injectBlock(bytes const& _block) override;
using Interface::diff; using Interface::diff;
virtual StateDiff diff(unsigned _txi, h256 _block) const override; virtual StateDiff diff(unsigned _txi, h256 _block) const override;
@ -143,9 +143,6 @@ public:
virtual Addresses addresses(BlockNumber _block) const override; virtual Addresses addresses(BlockNumber _block) const override;
virtual u256 gasLimitRemaining() const override; virtual u256 gasLimitRemaining() const override;
/// Set the coinbase address
virtual void setAddress(Address _us) = 0;
/// Get the coinbase address /// Get the coinbase address
virtual Address address() const override; virtual Address address() const override;

8
libethereum/Precompiled.cpp

@ -55,9 +55,13 @@ void ecrecoverCode(bytesConstRef _in, bytesRef _out)
{ {
try try
{ {
ret = sha3(recover(sig, in.hash)); Public rec = recover(sig, in.hash);
if (rec)
ret = dev::sha3(rec);
else
return;
} }
catch (...) {} catch (...) { return; }
} }
} }

2
libevmasm/Assembly.cpp

@ -109,7 +109,7 @@ string Assembly::getLocationFromSources(StringMap const& _sourceCodes, SourceLoc
if (newLinePos != string::npos) if (newLinePos != string::npos)
cut = cut.substr(0, newLinePos) + "..."; cut = cut.substr(0, newLinePos) + "...";
return move(cut); return cut;
} }
ostream& Assembly::streamAsm(ostream& _out, string const& _prefix, StringMap const& _sourceCodes) const ostream& Assembly::streamAsm(ostream& _out, string const& _prefix, StringMap const& _sourceCodes) const

4
libp2p/Common.h

@ -183,8 +183,8 @@ struct NodeIPEndpoint
uint16_t udpPort = 0; uint16_t udpPort = 0;
uint16_t tcpPort = 0; uint16_t tcpPort = 0;
operator bi::udp::endpoint() const { return std::move(bi::udp::endpoint(address, udpPort)); } operator bi::udp::endpoint() const { return bi::udp::endpoint(address, udpPort); }
operator bi::tcp::endpoint() const { return std::move(bi::tcp::endpoint(address, tcpPort)); } operator bi::tcp::endpoint() const { return bi::tcp::endpoint(address, tcpPort); }
operator bool() const { return !address.is_unspecified() && udpPort > 0 && tcpPort > 0; } operator bool() const { return !address.is_unspecified() && udpPort > 0 && tcpPort > 0; }

4
libp2p/Host.cpp

@ -834,7 +834,7 @@ KeyPair Host::networkAlias(bytesConstRef _b)
{ {
RLP r(_b); RLP r(_b);
if (r.itemCount() == 3 && r[0].isInt() && r[0].toInt<unsigned>() >= 3) if (r.itemCount() == 3 && r[0].isInt() && r[0].toInt<unsigned>() >= 3)
return move(KeyPair(move(Secret(r[1].toBytes())))); return KeyPair(Secret(r[1].toBytes()));
else else
return move(KeyPair::create()); return KeyPair::create();
} }

2
libp2p/Network.cpp

@ -111,7 +111,7 @@ std::set<bi::address> Network::getInterfaceAddresses()
#endif #endif
return std::move(addresses); return addresses;
} }
int Network::tcp4Listen(bi::tcp::acceptor& _acceptor, NetworkPreferences const& _netPrefs) int Network::tcp4Listen(bi::tcp::acceptor& _acceptor, NetworkPreferences const& _netPrefs)

10
libp2p/NodeTable.cpp

@ -88,7 +88,7 @@ shared_ptr<NodeEntry> NodeTable::addNode(Node const& _node, NodeRelation _relati
} }
if (!_node.endpoint) if (!_node.endpoint)
return move(shared_ptr<NodeEntry>()); return shared_ptr<NodeEntry>();
// ping address to recover nodeid if nodeid is empty // ping address to recover nodeid if nodeid is empty
if (!_node.id) if (!_node.id)
@ -98,7 +98,7 @@ shared_ptr<NodeEntry> NodeTable::addNode(Node const& _node, NodeRelation _relati
DEV_GUARDED(x_pubkDiscoverPings) DEV_GUARDED(x_pubkDiscoverPings)
m_pubkDiscoverPings[_node.endpoint.address] = std::chrono::steady_clock::now(); m_pubkDiscoverPings[_node.endpoint.address] = std::chrono::steady_clock::now();
ping(_node.endpoint); ping(_node.endpoint);
return move(shared_ptr<NodeEntry>()); return shared_ptr<NodeEntry>();
} }
DEV_GUARDED(x_nodes) DEV_GUARDED(x_nodes)
@ -129,7 +129,7 @@ list<NodeId> NodeTable::nodes() const
DEV_GUARDED(x_nodes) DEV_GUARDED(x_nodes)
for (auto& i: m_nodes) for (auto& i: m_nodes)
nodes.push_back(i.second->id); nodes.push_back(i.second->id);
return move(nodes); return nodes;
} }
list<NodeEntry> NodeTable::snapshot() const list<NodeEntry> NodeTable::snapshot() const
@ -140,7 +140,7 @@ list<NodeEntry> NodeTable::snapshot() const
for (auto const& np: s.nodes) for (auto const& np: s.nodes)
if (auto n = np.lock()) if (auto n = np.lock())
ret.push_back(*n); ret.push_back(*n);
return move(ret); return ret;
} }
Node NodeTable::node(NodeId const& _id) Node NodeTable::node(NodeId const& _id)
@ -282,7 +282,7 @@ vector<shared_ptr<NodeEntry>> NodeTable::nearestNodeEntries(NodeId _target)
for (auto const& n: nodes.second) for (auto const& n: nodes.second)
if (ret.size() < s_bucketSize && !!n->endpoint && n->endpoint.isAllowed()) if (ret.size() < s_bucketSize && !!n->endpoint && n->endpoint.isAllowed())
ret.push_back(n); ret.push_back(n);
return move(ret); return ret;
} }
void NodeTable::ping(NodeIPEndpoint _to) const void NodeTable::ping(NodeIPEndpoint _to) const

4
libp2p/RLPxFrameIO.cpp

@ -154,7 +154,7 @@ h128 RLPXFrameIO::egressDigest()
SHA3_256 h(m_egressMac); SHA3_256 h(m_egressMac);
h128 digest; h128 digest;
h.TruncatedFinal(digest.data(), h128::size); h.TruncatedFinal(digest.data(), h128::size);
return move(digest); return digest;
} }
h128 RLPXFrameIO::ingressDigest() h128 RLPXFrameIO::ingressDigest()
@ -162,7 +162,7 @@ h128 RLPXFrameIO::ingressDigest()
SHA3_256 h(m_ingressMac); SHA3_256 h(m_ingressMac);
h128 digest; h128 digest;
h.TruncatedFinal(digest.data(), h128::size); h.TruncatedFinal(digest.data(), h128::size);
return move(digest); return digest;
} }
void RLPXFrameIO::updateEgressMACWithHeader(bytesConstRef _headerCipher) void RLPXFrameIO::updateEgressMACWithHeader(bytesConstRef _headerCipher)

4
libp2p/UDP.cpp

@ -52,12 +52,12 @@ h256 RLPXDatagramFace::sign(Secret const& _k)
bytesConstRef signedRLPx(&data[h256::size], data.size() - h256::size); bytesConstRef signedRLPx(&data[h256::size], data.size() - h256::size);
dev::sha3(signedRLPx).ref().copyTo(rlpxHash); dev::sha3(signedRLPx).ref().copyTo(rlpxHash);
return std::move(sighash); return sighash;
} }
Public RLPXDatagramFace::authenticate(bytesConstRef _sig, bytesConstRef _rlp) Public RLPXDatagramFace::authenticate(bytesConstRef _sig, bytesConstRef _rlp)
{ {
Signature const& sig = *(Signature const*)_sig.data(); Signature const& sig = *(Signature const*)_sig.data();
return std::move(dev::recover(sig, sha3(_rlp))); return dev::recover(sig, sha3(_rlp));
} }

2
libp2p/UDP.h

@ -81,7 +81,7 @@ template <class T>
struct RLPXDatagram: public RLPXDatagramFace struct RLPXDatagram: public RLPXDatagramFace
{ {
RLPXDatagram(bi::udp::endpoint const& _ep): RLPXDatagramFace(_ep) {} RLPXDatagram(bi::udp::endpoint const& _ep): RLPXDatagramFace(_ep) {}
static T fromBytesConstRef(bi::udp::endpoint const& _ep, bytesConstRef _bytes) { try { T t(_ep); t.interpretRLP(_bytes); return std::move(t); } catch(...) { T t(_ep); return std::move(t); } } static T fromBytesConstRef(bi::udp::endpoint const& _ep, bytesConstRef _bytes) { try { T t(_ep); t.interpretRLP(_bytes); return t; } catch(...) { return T{_ep}; } }
uint8_t packetType() { return T::type; } uint8_t packetType() { return T::type; }
}; };

42
libsolidity/AST.cpp

@ -410,7 +410,14 @@ void InheritanceSpecifier::checkTypeRequirements()
BOOST_THROW_EXCEPTION(createTypeError("Wrong argument count for constructor call.")); BOOST_THROW_EXCEPTION(createTypeError("Wrong argument count for constructor call."));
for (size_t i = 0; i < m_arguments.size(); ++i) for (size_t i = 0; i < m_arguments.size(); ++i)
if (!m_arguments[i]->getType()->isImplicitlyConvertibleTo(*parameterTypes[i])) if (!m_arguments[i]->getType()->isImplicitlyConvertibleTo(*parameterTypes[i]))
BOOST_THROW_EXCEPTION(createTypeError("Invalid type for argument in constructer call.")); BOOST_THROW_EXCEPTION(m_arguments[i]->createTypeError(
"Invalid type for argument in constructor call. "
"Invalid implicit conversion from " +
m_arguments[i]->getType()->toString() +
" to " +
parameterTypes[i]->toString() +
" requested."
));
} }
TypePointer StructDefinition::getType(ContractDefinition const*) const TypePointer StructDefinition::getType(ContractDefinition const*) const
@ -592,7 +599,14 @@ void ModifierInvocation::checkTypeRequirements(vector<ContractDefinition const*>
BOOST_THROW_EXCEPTION(createTypeError("Wrong argument count for modifier invocation.")); BOOST_THROW_EXCEPTION(createTypeError("Wrong argument count for modifier invocation."));
for (size_t i = 0; i < m_arguments.size(); ++i) for (size_t i = 0; i < m_arguments.size(); ++i)
if (!m_arguments[i]->getType()->isImplicitlyConvertibleTo(*(*parameters)[i]->getType())) if (!m_arguments[i]->getType()->isImplicitlyConvertibleTo(*(*parameters)[i]->getType()))
BOOST_THROW_EXCEPTION(createTypeError("Invalid type for argument in modifier invocation.")); BOOST_THROW_EXCEPTION(m_arguments[i]->createTypeError(
"Invalid type for argument in modifier invocation. "
"Invalid implicit conversion from " +
m_arguments[i]->getType()->toString() +
" to " +
(*parameters)[i]->getType()->toString() +
" requested."
));
} }
void EventDefinition::checkTypeRequirements() void EventDefinition::checkTypeRequirements()
@ -782,9 +796,18 @@ void FunctionCall::checkTypeRequirements(TypePointers const*)
{ {
// call by positional arguments // call by positional arguments
for (size_t i = 0; i < m_arguments.size(); ++i) for (size_t i = 0; i < m_arguments.size(); ++i)
if (!functionType->takesArbitraryParameters() && if (
!m_arguments[i]->getType()->isImplicitlyConvertibleTo(*parameterTypes[i])) !functionType->takesArbitraryParameters() &&
BOOST_THROW_EXCEPTION(m_arguments[i]->createTypeError("Invalid type for argument in function call.")); !m_arguments[i]->getType()->isImplicitlyConvertibleTo(*parameterTypes[i])
)
BOOST_THROW_EXCEPTION(m_arguments[i]->createTypeError(
"Invalid type for argument in function call. "
"Invalid implicit conversion from " +
m_arguments[i]->getType()->toString() +
" to " +
parameterTypes[i]->toString() +
" requested."
));
} }
else else
{ {
@ -808,7 +831,14 @@ void FunctionCall::checkTypeRequirements(TypePointers const*)
if (parameterNames[j] == *m_names[i]) { if (parameterNames[j] == *m_names[i]) {
// check type convertible // check type convertible
if (!m_arguments[i]->getType()->isImplicitlyConvertibleTo(*parameterTypes[j])) if (!m_arguments[i]->getType()->isImplicitlyConvertibleTo(*parameterTypes[j]))
BOOST_THROW_EXCEPTION(createTypeError("Invalid type for argument in function call.")); BOOST_THROW_EXCEPTION(m_arguments[i]->createTypeError(
"Invalid type for argument in function call. "
"Invalid implicit conversion from " +
m_arguments[i]->getType()->toString() +
" to " +
parameterTypes[i]->toString() +
" requested."
));
found = true; found = true;
break; break;

2
libsolidity/AST.h

@ -503,7 +503,7 @@ public:
/// Returns the declared or inferred type. Can be an empty pointer if no type was explicitly /// Returns the declared or inferred type. Can be an empty pointer if no type was explicitly
/// declared and there is no assignment to the variable that fixes the type. /// declared and there is no assignment to the variable that fixes the type.
TypePointer getType(ContractDefinition const* = nullptr) const { return m_type; } TypePointer getType(ContractDefinition const* = nullptr) const override { return m_type; }
void setType(std::shared_ptr<Type const> const& _type) { m_type = _type; } void setType(std::shared_ptr<Type const> const& _type) { m_type = _type; }
virtual bool isLValue() const override; virtual bool isLValue() const override;

2
libsolidity/CompilerContext.cpp

@ -133,7 +133,7 @@ set<Declaration const*> CompilerContext::getFunctionsWithoutCode()
for (auto const& it: m_functionEntryLabels) for (auto const& it: m_functionEntryLabels)
if (m_functionsWithCode.count(it.first) == 0) if (m_functionsWithCode.count(it.first) == 0)
functions.insert(it.first); functions.insert(it.first);
return move(functions); return functions;
} }
ModifierDefinition const& CompilerContext::getFunctionModifier(string const& _name) const ModifierDefinition const& CompilerContext::getFunctionModifier(string const& _name) const

2
libsolidity/LValue.h

@ -109,7 +109,7 @@ public:
StorageItem(CompilerContext& _compilerContext, Declaration const& _declaration); StorageItem(CompilerContext& _compilerContext, Declaration const& _declaration);
/// Constructs the LValue and assumes that the storage reference is already on the stack. /// Constructs the LValue and assumes that the storage reference is already on the stack.
StorageItem(CompilerContext& _compilerContext, Type const& _type); StorageItem(CompilerContext& _compilerContext, Type const& _type);
virtual unsigned sizeOnStack() const { return 2; } virtual unsigned sizeOnStack() const override { return 2; }
virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const override; virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const override;
virtual void storeValue( virtual void storeValue(
Type const& _sourceType, Type const& _sourceType,

12
libsolidity/Types.cpp

@ -1459,29 +1459,29 @@ MagicType::MagicType(MagicType::Kind _kind):
switch (m_kind) switch (m_kind)
{ {
case Kind::Block: case Kind::Block:
m_members = move(MemberList({ m_members = MemberList({
{"coinbase", make_shared<IntegerType>(0, IntegerType::Modifier::Address)}, {"coinbase", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
{"timestamp", make_shared<IntegerType>(256)}, {"timestamp", make_shared<IntegerType>(256)},
{"blockhash", make_shared<FunctionType>(strings{"uint"}, strings{"bytes32"}, FunctionType::Location::BlockHash)}, {"blockhash", make_shared<FunctionType>(strings{"uint"}, strings{"bytes32"}, FunctionType::Location::BlockHash)},
{"difficulty", make_shared<IntegerType>(256)}, {"difficulty", make_shared<IntegerType>(256)},
{"number", make_shared<IntegerType>(256)}, {"number", make_shared<IntegerType>(256)},
{"gaslimit", make_shared<IntegerType>(256)} {"gaslimit", make_shared<IntegerType>(256)}
})); });
break; break;
case Kind::Message: case Kind::Message:
m_members = move(MemberList({ m_members = MemberList({
{"sender", make_shared<IntegerType>(0, IntegerType::Modifier::Address)}, {"sender", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
{"gas", make_shared<IntegerType>(256)}, {"gas", make_shared<IntegerType>(256)},
{"value", make_shared<IntegerType>(256)}, {"value", make_shared<IntegerType>(256)},
{"data", make_shared<ArrayType>(ReferenceType::Location::CallData)}, {"data", make_shared<ArrayType>(ReferenceType::Location::CallData)},
{"sig", make_shared<FixedBytesType>(4)} {"sig", make_shared<FixedBytesType>(4)}
})); });
break; break;
case Kind::Transaction: case Kind::Transaction:
m_members = move(MemberList({ m_members = MemberList({
{"origin", make_shared<IntegerType>(0, IntegerType::Modifier::Address)}, {"origin", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
{"gasprice", make_shared<IntegerType>(256)} {"gasprice", make_shared<IntegerType>(256)}
})); });
break; break;
default: default:
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unknown kind of magic.")); BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unknown kind of magic."));

4
libsolidity/Types.h

@ -407,7 +407,7 @@ public:
virtual TypePointer unaryOperatorResult(Token::Value _operator) const override; virtual TypePointer unaryOperatorResult(Token::Value _operator) const override;
virtual bool operator==(const Type& _other) const override; virtual bool operator==(const Type& _other) const override;
virtual unsigned getCalldataEncodedSize(bool _padded) const override; virtual unsigned getCalldataEncodedSize(bool _padded) const override;
virtual bool isDynamicallySized() const { return m_hasDynamicLength; } virtual bool isDynamicallySized() const override { return m_hasDynamicLength; }
virtual u256 getStorageSize() const override; virtual u256 getStorageSize() const override;
virtual unsigned getSizeOnStack() const override; virtual unsigned getSizeOnStack() const override;
virtual std::string toString() const override; virtual std::string toString() const override;
@ -820,7 +820,7 @@ public:
return TypePointer(); return TypePointer();
} }
virtual bool operator==(Type const& _other) const; virtual bool operator==(Type const& _other) const override;
virtual bool canBeStored() const override { return false; } virtual bool canBeStored() const override { return false; }
virtual bool canLiveOutsideStorage() const override { return true; } virtual bool canLiveOutsideStorage() const override { return true; }
virtual unsigned getSizeOnStack() const override { return 0; } virtual unsigned getSizeOnStack() const override { return 0; }

2
libtestutils/FixedClient.h

@ -48,7 +48,7 @@ public:
virtual eth::State asOf(h256 const& _h) const override; virtual eth::State asOf(h256 const& _h) const override;
virtual eth::State preMine() const override { ReadGuard l(x_stateDB); return m_state; } virtual eth::State preMine() const override { ReadGuard l(x_stateDB); return m_state; }
virtual eth::State postMine() const override { ReadGuard l(x_stateDB); return m_state; } virtual eth::State postMine() const override { ReadGuard l(x_stateDB); return m_state; }
virtual void setAddress(Address _us) { WriteGuard l(x_stateDB); m_state.setAddress(_us); } virtual void setAddress(Address _us) override { WriteGuard l(x_stateDB); m_state.setAddress(_us); }
virtual void prepareForTransaction() override {} virtual void prepareForTransaction() override {}
private: private:

2
libweb3jsonrpc/WebThreeStubServer.h

@ -43,7 +43,7 @@ class WebThreeStubServer: public dev::WebThreeStubServerBase, public dev::WebThr
public: public:
WebThreeStubServer(jsonrpc::AbstractServerConnector& _conn, dev::WebThreeDirect& _web3, std::shared_ptr<dev::eth::AccountHolder> const& _ethAccounts, std::vector<dev::KeyPair> const& _shhAccounts); WebThreeStubServer(jsonrpc::AbstractServerConnector& _conn, dev::WebThreeDirect& _web3, std::shared_ptr<dev::eth::AccountHolder> const& _ethAccounts, std::vector<dev::KeyPair> const& _shhAccounts);
virtual std::string web3_clientVersion(); virtual std::string web3_clientVersion() override;
private: private:
virtual dev::eth::Interface* client() override; virtual dev::eth::Interface* client() override;

18
libweb3jsonrpc/WebThreeStubServerBase.cpp

@ -781,17 +781,15 @@ string WebThreeStubServerBase::eth_newFilter(Json::Value const& _json)
} }
} }
string WebThreeStubServerBase::eth_newBlockFilter(string const& _filter) string WebThreeStubServerBase::eth_newBlockFilter()
{ {
h256 filter; h256 filter = dev::eth::ChainChangedFilter;
return toJS(client()->installWatch(filter));
if (_filter.compare("chain") == 0 || _filter.compare("latest") == 0) }
filter = dev::eth::ChainChangedFilter;
else if (_filter.compare("pending") == 0) string WebThreeStubServerBase::eth_newPendingTransactionFilter()
filter = dev::eth::PendingChangedFilter; {
else h256 filter = dev::eth::PendingChangedFilter;
BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS));
return toJS(client()->installWatch(filter)); return toJS(client()->installWatch(filter));
} }

3
libweb3jsonrpc/WebThreeStubServerBase.h

@ -107,7 +107,8 @@ public:
virtual std::string eth_compileSerpent(std::string const& _s); virtual std::string eth_compileSerpent(std::string const& _s);
virtual std::string eth_compileSolidity(std::string const& _code); virtual std::string eth_compileSolidity(std::string const& _code);
virtual std::string eth_newFilter(Json::Value const& _json); virtual std::string eth_newFilter(Json::Value const& _json);
virtual std::string eth_newBlockFilter(std::string const& _filter); virtual std::string eth_newBlockFilter();
virtual std::string eth_newPendingTransactionFilter();
virtual bool eth_uninstallFilter(std::string const& _filterId); virtual bool eth_uninstallFilter(std::string const& _filterId);
virtual Json::Value eth_getFilterChanges(std::string const& _filterId); virtual Json::Value eth_getFilterChanges(std::string const& _filterId);
virtual Json::Value eth_getFilterLogs(std::string const& _filterId); virtual Json::Value eth_getFilterLogs(std::string const& _filterId);

14
libweb3jsonrpc/abstractwebthreestubserver.h

@ -47,7 +47,8 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr
this->bindAndAddMethod(jsonrpc::Procedure("eth_compileSerpent", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_compileSerpentI); this->bindAndAddMethod(jsonrpc::Procedure("eth_compileSerpent", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_compileSerpentI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_compileSolidity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_compileSolidityI); this->bindAndAddMethod(jsonrpc::Procedure("eth_compileSolidity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_compileSolidityI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_newFilterI); this->bindAndAddMethod(jsonrpc::Procedure("eth_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_newFilterI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_newBlockFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_newBlockFilterI); this->bindAndAddMethod(jsonrpc::Procedure("eth_newBlockFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_newBlockFilterI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_newPendingTransactionFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_newPendingTransactionFilterI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_uninstallFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_uninstallFilterI); this->bindAndAddMethod(jsonrpc::Procedure("eth_uninstallFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_uninstallFilterI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getFilterChanges", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getFilterChangesI); this->bindAndAddMethod(jsonrpc::Procedure("eth_getFilterChanges", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getFilterChangesI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getFilterLogs", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getFilterLogsI); this->bindAndAddMethod(jsonrpc::Procedure("eth_getFilterLogs", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getFilterLogsI);
@ -228,7 +229,13 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr
} }
inline virtual void eth_newBlockFilterI(const Json::Value &request, Json::Value &response) inline virtual void eth_newBlockFilterI(const Json::Value &request, Json::Value &response)
{ {
response = this->eth_newBlockFilter(request[0u].asString()); (void)request;
response = this->eth_newBlockFilter();
}
inline virtual void eth_newPendingTransactionFilterI(const Json::Value &request, Json::Value &response)
{
(void)request;
response = this->eth_newPendingTransactionFilter();
} }
inline virtual void eth_uninstallFilterI(const Json::Value &request, Json::Value &response) inline virtual void eth_uninstallFilterI(const Json::Value &request, Json::Value &response)
{ {
@ -359,7 +366,8 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr
virtual std::string eth_compileSerpent(const std::string& param1) = 0; virtual std::string eth_compileSerpent(const std::string& param1) = 0;
virtual std::string eth_compileSolidity(const std::string& param1) = 0; virtual std::string eth_compileSolidity(const std::string& param1) = 0;
virtual std::string eth_newFilter(const Json::Value& param1) = 0; virtual std::string eth_newFilter(const Json::Value& param1) = 0;
virtual std::string eth_newBlockFilter(const std::string& param1) = 0; virtual std::string eth_newBlockFilter() = 0;
virtual std::string eth_newPendingTransactionFilter() = 0;
virtual bool eth_uninstallFilter(const std::string& param1) = 0; virtual bool eth_uninstallFilter(const std::string& param1) = 0;
virtual Json::Value eth_getFilterChanges(const std::string& param1) = 0; virtual Json::Value eth_getFilterChanges(const std::string& param1) = 0;
virtual Json::Value eth_getFilterLogs(const std::string& param1) = 0; virtual Json::Value eth_getFilterLogs(const std::string& param1) = 0;

3
libweb3jsonrpc/spec.json

@ -36,7 +36,8 @@
{ "name": "eth_compileSerpent", "params": [""], "order": [], "returns": ""}, { "name": "eth_compileSerpent", "params": [""], "order": [], "returns": ""},
{ "name": "eth_compileSolidity", "params": [""], "order": [], "returns": ""}, { "name": "eth_compileSolidity", "params": [""], "order": [], "returns": ""},
{ "name": "eth_newFilter", "params": [{}], "order": [], "returns": ""}, { "name": "eth_newFilter", "params": [{}], "order": [], "returns": ""},
{ "name": "eth_newBlockFilter", "params": [""], "order": [], "returns": ""}, { "name": "eth_newBlockFilter", "params": [], "order": [], "returns": ""},
{ "name": "eth_newPendingTransactionFilter", "params": [], "order": [], "returns": ""},
{ "name": "eth_uninstallFilter", "params": [""], "order": [], "returns": true}, { "name": "eth_uninstallFilter", "params": [""], "order": [], "returns": true},
{ "name": "eth_getFilterChanges", "params": [""], "order": [], "returns": []}, { "name": "eth_getFilterChanges", "params": [""], "order": [], "returns": []},
{ "name": "eth_getFilterLogs", "params": [""], "order": [], "returns": []}, { "name": "eth_getFilterLogs", "params": [""], "order": [], "returns": []},

8
libwhisper/WhisperHost.h

@ -54,7 +54,7 @@ public:
virtual void inject(Envelope const& _e, WhisperPeer* _from = nullptr) override; virtual void inject(Envelope const& _e, WhisperPeer* _from = nullptr) override;
virtual Topics const& fullTopics(unsigned _id) const { try { return m_filters.at(m_watches.at(_id).id).full; } catch (...) { return EmptyTopics; } } virtual Topics const& fullTopics(unsigned _id) const override { try { return m_filters.at(m_watches.at(_id).id).full; } catch (...) { return EmptyTopics; } }
virtual unsigned installWatch(Topics const& _filter) override; virtual unsigned installWatch(Topics const& _filter) override;
virtual unsigned installWatchOnId(h256 _filterId) override; virtual unsigned installWatchOnId(h256 _filterId) override;
virtual void uninstallWatch(unsigned _watchId) override; virtual void uninstallWatch(unsigned _watchId) override;
@ -69,11 +69,11 @@ public:
void cleanup(); void cleanup();
protected: protected:
void doWork(); virtual void doWork() override;
private: private:
virtual void onStarting() { startWorking(); } virtual void onStarting() override { startWorking(); }
virtual void onStopping() { stopWorking(); } virtual void onStopping() override { stopWorking(); }
void streamMessage(h256 _m, RLPStream& _s) const; void streamMessage(h256 _m, RLPStream& _s) const;

4
mix/ClientModel.cpp

@ -539,7 +539,9 @@ void ClientModel::showDebuggerForTransaction(ExecutionResult const& _t)
// filter out locations that match whole function or contract // filter out locations that match whole function or contract
SourceLocation location = instruction.getLocation(); SourceLocation location = instruction.getLocation();
QString source = QString::fromUtf8(location.sourceName->c_str()); QString source;
if (location.sourceName)
source = QString::fromUtf8(location.sourceName->c_str());
if (m_codeModel->isContractOrFunctionLocation(location)) if (m_codeModel->isContractOrFunctionLocation(location))
location = dev::SourceLocation(-1, -1, location.sourceName); location = dev::SourceLocation(-1, -1, location.sourceName);

2
mix/CodeModel.cpp

@ -67,7 +67,7 @@ private:
return LocationPair(_node.getLocation().start, _node.getLocation().end); return LocationPair(_node.getLocation().start, _node.getLocation().end);
} }
virtual bool visit(FunctionDefinition const&) virtual bool visit(FunctionDefinition const&) override
{ {
m_functionScope = true; m_functionScope = true;
return true; return true;

2
mix/MixClient.h

@ -80,7 +80,7 @@ protected:
/// ClientBase methods /// ClientBase methods
using ClientBase::asOf; using ClientBase::asOf;
virtual dev::eth::State asOf(h256 const& _block) const override; virtual dev::eth::State asOf(h256 const& _block) const override;
virtual dev::eth::BlockChain& bc() { return *m_bc; } virtual dev::eth::BlockChain& bc() override { return *m_bc; }
virtual dev::eth::BlockChain const& bc() const override { return *m_bc; } virtual dev::eth::BlockChain const& bc() const override { return *m_bc; }
virtual dev::eth::State preMine() const override { ReadGuard l(x_state); return m_startState; } virtual dev::eth::State preMine() const override { ReadGuard l(x_state); return m_startState; }
virtual dev::eth::State postMine() const override { ReadGuard l(x_state); return m_state; } virtual dev::eth::State postMine() const override { ReadGuard l(x_state); return m_state; }

BIN
mix/qml/img/addblock.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

BIN
mix/qml/img/addblock@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
mix/qml/img/duplicateicon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1020 B

BIN
mix/qml/img/duplicateicon@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
mix/qml/img/leftarrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 B

BIN
mix/qml/img/leftarrow@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 B

BIN
mix/qml/img/newaccounticon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B

BIN
mix/qml/img/newaccounticon@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

BIN
mix/qml/img/recyclediscard.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 B

BIN
mix/qml/img/recyclediscard@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
mix/qml/img/recycleicon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

BIN
mix/qml/img/recycleicon@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
mix/qml/img/recyclekeep.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

BIN
mix/qml/img/recyclekeep@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
mix/qml/img/restoreicon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
mix/qml/img/restoreicon@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
mix/qml/img/rightarrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

BIN
mix/qml/img/rightarrow@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

BIN
mix/qml/img/saveicon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
mix/qml/img/saveicon@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
mix/qml/img/sendtransactionicon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

BIN
mix/qml/img/sendtransactionicon@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

2384
test/libethereum/StateTestsFiller/stPreCompiledContractsFiller.json

File diff suppressed because it is too large

38
test/libethereum/StateTestsFiller/stSpecialTestFiller.json

@ -194,44 +194,6 @@
} }
}, },
"txfrom0_deja" : {
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "1000000",
"currentNumber" : "0",
"currentTimestamp" : 1,
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"pre" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "1000000000000000000",
"code" : "0x6042601f53600064ffffffffff2080",
"nonce" : "0",
"storage" : {
}
},
"0000000000000000000000000000000000000000" : {
"balance" : "1000000000000000000",
"code" : "0x",
"nonce" : "0",
"storage" : {
}
}
},
"transaction" : {
"data" : "",
"gasLimit" : "1000000",
"gasPrice" : "0",
"nonce" : "0",
"r" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"s" : "0xbadf00d70ec28c94a3b55ec771bcbc70778d6ee0b51ca7ea9514594c861b1884",
"v": "27",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "100000"
}
},
"JUMPDEST_Attack" : { "JUMPDEST_Attack" : {
"env" : { "env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",

15
test/libethereum/TransactionTestsFiller/ttTransactionTestFiller.json

@ -15,6 +15,21 @@
} }
}, },
"invalidSignature" : {
"expect" : "invalid",
"transaction" : {
"data" : "",
"gasLimit" : "1000000",
"gasPrice" : "0",
"nonce" : "0",
"r" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"s" : "0xbadf00d70ec28c94a3b55ec771bcbc70778d6ee0b51ca7ea9514594c861b1884",
"v": "27",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "100000"
}
},
"NotEnoughGasLimit" : { "NotEnoughGasLimit" : {
"expect" : "invalid", "expect" : "invalid",
"transaction" : "transaction" :

2
test/libp2p/net.cpp

@ -74,7 +74,7 @@ struct TestNodeTable: public NodeTable
ret.push_back(make_pair(k,s_basePort+i)); ret.push_back(make_pair(k,s_basePort+i));
} }
return std::move(ret); return ret;
} }
void pingTestNodes(std::vector<std::pair<KeyPair,unsigned>> const& _testNodes) void pingTestNodes(std::vector<std::pair<KeyPair,unsigned>> const& _testNodes)

14
test/libweb3jsonrpc/webthreestubclient.h

@ -374,16 +374,26 @@ class WebThreeStubClient : public jsonrpc::Client
else else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
} }
std::string eth_newBlockFilter(const std::string& param1) throw (jsonrpc::JsonRpcException) std::string eth_newBlockFilter() throw (jsonrpc::JsonRpcException)
{ {
Json::Value p; Json::Value p;
p.append(param1); p = Json::nullValue;
Json::Value result = this->CallMethod("eth_newBlockFilter",p); Json::Value result = this->CallMethod("eth_newBlockFilter",p);
if (result.isString()) if (result.isString())
return result.asString(); return result.asString();
else else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
} }
std::string eth_newPendingTransactionFilter() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p = Json::nullValue;
Json::Value result = this->CallMethod("eth_newPendingTransactionFilter",p);
if (result.isString())
return result.asString();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
bool eth_uninstallFilter(const std::string& param1) throw (jsonrpc::JsonRpcException) bool eth_uninstallFilter(const std::string& param1) throw (jsonrpc::JsonRpcException)
{ {
Json::Value p; Json::Value p;

4
test/libwhisper/whisperMessage.cpp

@ -37,7 +37,7 @@ Topics createRandomTopics(unsigned int i)
ret.push_back(t); ret.push_back(t);
} }
return move(ret); return ret;
} }
bytes createRandomPayload(unsigned int i) bytes createRandomPayload(unsigned int i)
@ -48,7 +48,7 @@ bytes createRandomPayload(unsigned int i)
for (int j = 0; j < sz; ++j) for (int j = 0; j < sz; ++j)
ret.push_back(rand() % 256); ret.push_back(rand() % 256);
return move(ret); return ret;
} }
void comparePayloads(Message const& m1, Message const& m2) void comparePayloads(Message const& m1, Message const& m2)

Loading…
Cancel
Save