Browse Source

Merge branch 'develop' of http://github.com/ethereum/cpp-ethereum into osx-deploy-fix

cl-refactor
arkpar 10 years ago
parent
commit
ed83c34232
  1. 1
      CMakeLists.txt
  2. 1
      alethzero/AllAccounts.h
  3. 3
      alethzero/CMakeLists.txt
  4. 95
      alethzero/LogPanel.cpp
  5. 64
      alethzero/LogPanel.h
  6. 99
      alethzero/LogPanel.ui
  7. 228
      alethzero/Main.ui
  8. 8
      alethzero/MainFace.h
  9. 78
      alethzero/MainWin.cpp
  10. 12
      alethzero/MainWin.h
  11. 26
      alethzero/Transact.cpp
  12. 2
      alethzero/Transact.h
  13. 7
      alethzero/Transact.ui
  14. 1
      evmjit/CMakeLists.txt
  15. 7
      libdevcore/CMakeLists.txt
  16. 2
      libdevcore/FixedHash.h
  17. 6
      libdevcrypto/CMakeLists.txt
  18. 2
      libdevcrypto/Common.cpp
  19. 19
      libethash-cl/ethash_cl_miner.cpp
  20. 9
      libethcore/BlockInfo.cpp
  21. 1
      libethcore/BlockInfo.h
  22. 6
      libethcore/CMakeLists.txt
  23. 1
      libethcore/Common.h
  24. 2
      libethcore/Params.cpp
  25. 6
      libethereum/CMakeLists.txt
  26. 6
      libethereum/GasPricer.h
  27. 9
      libethereum/Interface.h
  28. 6
      libethereumx/Ethereum.h
  29. 6
      libevm/CMakeLists.txt
  30. 6
      libevmasm/CMakeLists.txt
  31. 6
      libevmcore/CMakeLists.txt
  32. 7
      libjsconsole/CMakeLists.txt
  33. 7
      libjsengine/CMakeLists.txt
  34. 6
      liblll/CMakeLists.txt
  35. 2
      libnatspec/CMakeLists.txt
  36. 6
      libp2p/CMakeLists.txt
  37. 6
      libscrypt/CMakeLists.txt
  38. 6
      libserpent/CMakeLists.txt
  39. 6
      libsolidity/CMakeLists.txt
  40. 6
      libtestutils/CMakeLists.txt
  41. 6
      libweb3jsonrpc/CMakeLists.txt
  42. 6
      libwebthree/CMakeLists.txt
  43. 6
      libwhisper/CMakeLists.txt
  44. 2
      libwhisper/WhisperDB.cpp
  45. 6
      secp256k1/CMakeLists.txt
  46. 1
      test/CMakeLists.txt
  47. 5
      test/contracts/CMakeLists.txt
  48. 0
      test/contracts/FixedFeeRegistrar.cpp
  49. 0
      test/contracts/Wallet.cpp
  50. 63
      test/libethcore/difficulty.cpp
  51. 8
      test/libethereum/gaspricer.cpp
  52. 2
      test/libethereum/transaction.cpp
  53. 3
      test/libp2p/net.cpp

1
CMakeLists.txt

@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 2.8.12)
set(PROJECT_VERSION "0.9.38")
if (${CMAKE_VERSION} VERSION_GREATER 3.0)
cmake_policy(SET CMP0042 NEW) # fix MACOSX_RPATH
cmake_policy(SET CMP0048 NEW) # allow VERSION argument in project()
project(ethereum VERSION ${PROJECT_VERSION})
else()

1
alethzero/AllAccounts.h

@ -49,6 +49,7 @@ private slots:
void onAllChange();
void refresh();
private:
void installWatches();

3
alethzero/CMakeLists.txt

@ -39,6 +39,7 @@ qt5_wrap_ui(ui_GasPricing.h GasPricing.ui)
# Extensions
qt5_wrap_ui(ui_AllAccounts.h AllAccounts.ui)
qt5_wrap_ui(ui_LogPanel.h LogPanel.ui)
file(GLOB HEADERS "*.h")
@ -51,7 +52,7 @@ endif ()
# eth_add_executable is defined in cmake/EthExecutableHelper.cmake
eth_add_executable(${EXECUTABLE}
ICON alethzero
UI_RESOURCES alethzero.icns Main.ui Connect.ui Debugger.ui Transact.ui ExportState.ui GetPassword.ui GasPricing.ui AllAccounts.ui
UI_RESOURCES alethzero.icns Main.ui Connect.ui Debugger.ui Transact.ui ExportState.ui GetPassword.ui GasPricing.ui AllAccounts.ui LogPanel.ui
WIN_RESOURCES alethzero.rc
)

95
alethzero/LogPanel.cpp

@ -0,0 +1,95 @@
/*
This file is part of cpp-ethereum.
cpp-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file LogPanel.h
* @author Gav Wood <i@gavwood.com>
* @date 2015
*/
#include "LogPanel.h"
#include <sstream>
#include <QClipboard>
#include <QSettings>
#include <libdevcore/Log.h>
#include <libdevcore/SHA3.h>
#include <libevmcore/Instruction.h>
#include <libethereum/Client.h>
#include "ui_LogPanel.h"
using namespace std;
using namespace dev;
using namespace az;
using namespace eth;
static QString filterOutTerminal(QString _s)
{
return _s.replace(QRegExp("\x1b\\[(\\d;)?\\d+m"), "");
}
LogPanel::LogPanel(MainFace* _m):
Plugin(_m, "LogPanel"),
m_ui(new Ui::LogPanel)
{
dock(Qt::RightDockWidgetArea, "Log")->setWidget(new QWidget);
m_ui->setupUi(dock()->widget());
connect(m_ui->verbosity, SIGNAL(valueChanged(int)), SLOT(on_verbosity_valueChanged()));
g_logPost = [=](string const& s, char const* c)
{
simpleDebugOut(s, c);
m_logLock.lock();
m_logHistory.append(filterOutTerminal(QString::fromStdString(s)) + "\n");
m_logChanged = true;
m_logLock.unlock();
};
on_verbosity_valueChanged();
}
LogPanel::~LogPanel()
{
// Must do this here since otherwise m_ethereum'll be deleted (and therefore clearWatches() called by the destructor)
// *after* the client is dead.
g_logPost = simpleDebugOut;
}
void LogPanel::readSettings(QSettings const& _s)
{
m_ui->verbosity->setValue(_s.value("verbosity", 1).toInt());
}
void LogPanel::writeSettings(QSettings& _s)
{
_s.setValue("verbosity", m_ui->verbosity->value());
}
void LogPanel::timerEvent(QTimerEvent*)
{
if (m_logChanged)
{
m_logLock.lock();
m_logChanged = false;
m_ui->log->appendPlainText(m_logHistory.mid(0, m_logHistory.length() - 1));
m_logHistory.clear();
m_logLock.unlock();
}
}
void LogPanel::on_verbosity_valueChanged()
{
g_logVerbosity = m_ui->verbosity->value();
m_ui->verbosityLabel->setText(QString::number(g_logVerbosity));
}

64
alethzero/LogPanel.h

@ -0,0 +1,64 @@
/*
This file is part of cpp-ethereum.
cpp-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file AllAccounts.h
* @author Gav Wood <i@gavwood.com>
* @date 2015
*/
#pragma once
#include <QMutex>
#include <QString>
#include <QPair>
#include <QList>
#include "MainFace.h"
namespace Ui
{
class LogPanel;
}
namespace dev
{
namespace az
{
class LogPanel: public QObject, public Plugin
{
Q_OBJECT
public:
LogPanel(MainFace* _m);
~LogPanel();
private slots:
void on_verbosity_valueChanged();
private:
void timerEvent(QTimerEvent*) override;
void readSettings(QSettings const&) override;
void writeSettings(QSettings&) override;
Ui::LogPanel* m_ui;
QMutex m_logLock;
QString m_logHistory;
bool m_logChanged = true;
};
}
}

99
alethzero/LogPanel.ui

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LogPanel</class>
<widget class="QWidget" name="LogPanel">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>834</width>
<height>265</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPlainTextEdit" name="log">
<property name="font">
<font>
<family>Ubuntu Mono</family>
</font>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QSlider" name="verbosity">
<property name="maximum">
<number>20</number>
</property>
<property name="value">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBothSides</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="verbosityLabel">
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>20</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

228
alethzero/Main.ui

@ -383,96 +383,6 @@
</layout>
</widget>
</widget>
<widget class="QDockWidget" name="dockWidget_4">
<property name="features">
<set>QDockWidget::DockWidgetFeatureMask</set>
</property>
<property name="windowTitle">
<string>Log</string>
</property>
<attribute name="dockWidgetArea">
<number>8</number>
</attribute>
<widget class="QWidget" name="dockWidgetContents_4">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPlainTextEdit" name="log">
<property name="font">
<font>
<family>Ubuntu Mono</family>
</font>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QSlider" name="verbosity">
<property name="maximum">
<number>20</number>
</property>
<property name="value">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBothSides</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="verbosityLabel">
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>20</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<widget class="QDockWidget" name="dockWidget">
<property name="features">
<set>QDockWidget::DockWidgetFeatureMask</set>
@ -1111,40 +1021,37 @@ font-size: 14pt</string>
</attribute>
<widget class="QWidget" name="dockWidgetContents_14">
<layout class="QGridLayout" name="gridLayout_4">
<item row="2" column="4">
<widget class="QSpinBox" name="shhWork">
<property name="suffix">
<string> ms</string>
</property>
<property name="minimum">
<number>1</number>
<item row="4" column="0" rowspan="2">
<widget class="QLabel" name="label_8">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximum">
<number>1000</number>
<property name="text">
<string>Data</string>
</property>
<property name="value">
<number>50</number>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_9">
<item row="2" column="2" colspan="2">
<widget class="QLabel" name="label5_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Topic</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
<string>Work to Prove</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="4">
<widget class="QPlainTextEdit" name="shhTopic">
<item row="5" column="1" colspan="4">
<widget class="QPlainTextEdit" name="shhData">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -1159,8 +1066,8 @@ font-size: 14pt</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="4">
<widget class="QPlainTextEdit" name="shhData">
<item row="3" column="1" colspan="4">
<widget class="QPlainTextEdit" name="shhTopic">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -1175,36 +1082,26 @@ font-size: 14pt</string>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QPushButton" name="post">
<property name="text">
<string>Post</string>
<item row="1" column="1" colspan="4">
<widget class="QComboBox" name="shhFrom">
<property name="editable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label5_5">
<item row="3" column="0">
<widget class="QLabel" name="label_9">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TTL</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label5_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<string>Topic</string>
</property>
<property name="text">
<string>From</string>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
@ -1221,13 +1118,6 @@ font-size: 14pt</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="4">
<widget class="QComboBox" name="shhFrom">
<property name="editable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1" colspan="4">
<widget class="QComboBox" name="shhTo">
<property name="editable">
@ -1235,22 +1125,6 @@ font-size: 14pt</string>
</property>
</widget>
</item>
<item row="4" column="0" rowspan="2">
<widget class="QLabel" name="label_8">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Data</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="shhTtl">
<property name="suffix">
@ -1264,8 +1138,8 @@ font-size: 14pt</string>
</property>
</widget>
</item>
<item row="2" column="2" colspan="2">
<widget class="QLabel" name="label5_6">
<item row="2" column="0">
<widget class="QLabel" name="label5_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -1273,7 +1147,43 @@ font-size: 14pt</string>
</sizepolicy>
</property>
<property name="text">
<string>Work to Prove</string>
<string>TTL</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label5_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>From</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QSpinBox" name="shhWork">
<property name="suffix">
<string> ms</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000</number>
</property>
<property name="value">
<number>50</number>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QPushButton" name="post">
<property name="text">
<string>Post</string>
</property>
</widget>
</item>
@ -1762,9 +1672,7 @@ font-size: 14pt</string>
<tabstop>shhTopic</tabstop>
<tabstop>shhWork</tabstop>
<tabstop>shhData</tabstop>
<tabstop>log</tabstop>
<tabstop>post</tabstop>
<tabstop>verbosity</tabstop>
<tabstop>tabWidget</tabstop>
<tabstop>urlEdit</tabstop>
<tabstop>listenIP</tabstop>

8
alethzero/MainFace.h

@ -31,6 +31,8 @@
#include <libevm/ExtVMFace.h>
#include "Context.h"
class QSettings;
namespace dev
{
@ -64,6 +66,10 @@ public:
virtual unsigned installWatch(dev::eth::LogFilter const& _tf, WatchHandler const& _f) = 0;
virtual unsigned installWatch(dev::h256 const& _tf, WatchHandler const& _f) = 0;
protected:
template <class F> void forEach(F const& _f) { for (auto const& p: m_plugins) _f(p.second); }
std::shared_ptr<Plugin> takePlugin(std::string const& _name) { auto it = m_plugins.find(_name); std::shared_ptr<Plugin> ret; if (it != m_plugins.end()) { ret = it->second; m_plugins.erase(it); } return ret; }
private:
std::unordered_map<std::string, std::shared_ptr<Plugin>> m_plugins;
};
@ -85,6 +91,8 @@ public:
void addAction(QAction* _a);
virtual void onAllChange() {}
virtual void readSettings(QSettings const&) {}
virtual void writeSettings(QSettings&) {}
private:
MainFace* m_main = nullptr;

78
alethzero/MainWin.cpp

@ -75,6 +75,7 @@
#include "WebPage.h"
#include "ExportState.h"
#include "AllAccounts.h"
#include "LogPanel.h"
#include "ui_Main.h"
#include "ui_GetPassword.h"
#include "ui_GasPricing.h"
@ -123,11 +124,6 @@ QString contentsOfQResource(string const& res)
Address c_newConfig = Address("c6d9d2cd449a754c494264e1809c50e34d64562b");
//Address c_nameReg = Address("ddd1cea741d548f90d86fb87a3ae6492e18c03a1");
static QString filterOutTerminal(QString _s)
{
return _s.replace(QRegExp("\x1b\\[(\\d;)?\\d+m"), "");
}
Main::Main(QWidget* _parent):
MainFace(_parent),
ui(new Ui::Main),
@ -158,16 +154,6 @@ Main::Main(QWidget* _parent):
else if (c_network == eth::Network::Frontier)
setWindowTitle("AlethZero Frontier");
g_logPost = [=](string const& s, char const* c)
{
simpleDebugOut(s, c);
m_logLock.lock();
m_logHistory.append(filterOutTerminal(QString::fromStdString(s)) + "\n");
m_logChanged = true;
m_logLock.unlock();
// ui->log->addItem(QString::fromStdString(s));
};
// Open Key Store
bool opened = false;
if (m_keyManager.exists())
@ -217,7 +203,6 @@ Main::Main(QWidget* _parent):
cerr << "Client database version: " << c_databaseVersion << endl;
ui->configDock->close();
on_verbosity_valueChanged();
statusBar()->addPermanentWidget(ui->cacheUsage);
statusBar()->addPermanentWidget(ui->balance);
@ -303,21 +288,24 @@ Main::Main(QWidget* _parent):
QSettings s("ethereum", "alethzero");
if (s.value("splashMessage", true).toBool())
{
QMessageBox::information(this, "Here Be Dragons!", "This is proof-of-concept software. The project as a whole is not even at the alpha-testing stage. It is here to show you, if you have a technical bent, the sort of thing that might be possible down the line.\nPlease don't blame us if it does something unexpected or if you're underwhelmed with the user-experience. We have great plans for it in terms of UX down the line but right now we just want to get the groundwork sorted. We welcome contributions, be they in code, testing or documentation!\nAfter you close this message it won't appear again.");
QMessageBox::information(this, "Here Be Dragons!", "This is beta software: it is not yet at the release stage.\nPlease don't blame us if it does something unexpected or if you're underwhelmed with the user-experience. We have great plans for it in terms of UX down the line but right now we just want to make sure everything works roughly as expected. We welcome contributions, be they in code, testing or documentation!\nAfter you close this message it won't appear again.");
s.setValue("splashMessage", false);
}
}
new dev::az::AllAccounts(this);
loadPlugin<dev::az::AllAccounts>();
loadPlugin<dev::az::LogPanel>();
}
Main::~Main()
{
m_httpConnector->StopListening();
// save all settings here so we don't have to explicitly finalise plugins.
// NOTE: as soon as plugin finalisation means anything more than saving settings, this will
// need to be rethought into something more like:
// forEach([&](shared_ptr<Plugin> const& p){ finalisePlugin(p.get()); });
writeSettings();
// Must do this here since otherwise m_ethereum'll be deleted (and therefore clearWatches() called by the destructor)
// *after* the client is dead.
g_logPost = simpleDebugOut;
}
bool Main::confirm() const
@ -769,6 +757,11 @@ void Main::writeSettings()
s.setValue("identities", b);
}
forEach([&](std::shared_ptr<Plugin> p)
{
p->writeSettings(s);
});
s.setValue("askPrice", QString::fromStdString(toString(static_cast<TrivialGasPricer*>(ethereum()->gasPricer().get())->ask())));
s.setValue("bidPrice", QString::fromStdString(toString(static_cast<TrivialGasPricer*>(ethereum()->gasPricer().get())->bid())));
s.setValue("upnp", ui->upnp->isChecked());
@ -779,14 +772,12 @@ void Main::writeSettings()
s.setValue("paranoia", ui->paranoia->isChecked());
s.setValue("natSpec", ui->natSpec->isChecked());
s.setValue("showAll", ui->showAll->isChecked());
s.setValue("showAllAccounts", ui->showAllAccounts->isChecked());
s.setValue("clientName", ui->clientName->text());
s.setValue("idealPeers", ui->idealPeers->value());
s.setValue("listenIP", ui->listenIP->text());
s.setValue("port", ui->port->value());
s.setValue("url", ui->urlEdit->text());
s.setValue("privateChain", m_privateChain);
s.setValue("verbosity", ui->verbosity->value());
if (auto vm = m_vmSelectionGroup->checkedAction())
s.setValue("vm", vm->text());
@ -865,6 +856,11 @@ void Main::readSettings(bool _skipGeometry)
}
}
forEach([&](std::shared_ptr<Plugin> p)
{
p->readSettings(s);
});
static_cast<TrivialGasPricer*>(ethereum()->gasPricer().get())->setAsk(u256(s.value("askPrice", "500000000000").toString().toStdString()));
static_cast<TrivialGasPricer*>(ethereum()->gasPricer().get())->setBid(u256(s.value("bidPrice", "500000000000").toString().toStdString()));
@ -879,7 +875,6 @@ void Main::readSettings(bool _skipGeometry)
ui->paranoia->setChecked(s.value("paranoia", false).toBool());
ui->natSpec->setChecked(s.value("natSpec", true).toBool());
ui->showAll->setChecked(s.value("showAll", false).toBool());
ui->showAllAccounts->setChecked(s.value("showAllAccounts", false).toBool());
ui->clientName->setText(s.value("clientName", "").toString());
if (ui->clientName->text().isEmpty())
ui->clientName->setText(QInputDialog::getText(nullptr, "Enter identity", "Enter a name that will identify you on the peer network"));
@ -888,7 +883,6 @@ void Main::readSettings(bool _skipGeometry)
ui->port->setValue(s.value("port", ui->port->value()).toInt());
ui->nameReg->setText(s.value("nameReg", "").toString());
setPrivateChain(s.value("privateChain", "").toString());
ui->verbosity->setValue(s.value("verbosity", 1).toInt());
#if ETH_EVMJIT // We care only if JIT is enabled. Otherwise it can cause misconfiguration.
auto vmName = s.value("vm").toString();
@ -1453,15 +1447,6 @@ void Main::timerEvent(QTimerEvent*)
if ((interval / 100 % 2 == 0 && m_webThree->ethereum()->isSyncing()) || interval == 1000)
ui->downloadView->update();
if (m_logChanged)
{
m_logLock.lock();
m_logChanged = false;
ui->log->appendPlainText(m_logHistory.mid(0, m_logHistory.length() - 1));
m_logHistory.clear();
m_logLock.unlock();
}
// refresh peer list every 1000ms, reset counter
if (interval == 1000)
{
@ -2030,12 +2015,6 @@ void Main::on_connect_triggered()
}
}
void Main::on_verbosity_valueChanged()
{
g_logVerbosity = ui->verbosity->value();
ui->verbosityLabel->setText(QString::number(g_logVerbosity));
}
void Main::on_mine_triggered()
{
if (ui->mine->isChecked())
@ -2306,3 +2285,22 @@ void Main::pageLoaded(QByteArray const& _content, QString const& _mimeType, QUrl
{
ui->webView->page()->setContent(_content, _mimeType, _uri);
}
void Main::initPlugin(Plugin* _p)
{
QSettings s("ethereum", "alethzero");
_p->readSettings(s);
}
void Main::finalisePlugin(Plugin* _p)
{
QSettings s("ethereum", "alethzero");
_p->writeSettings(s);
}
void Main::unloadPlugin(string const& _name)
{
shared_ptr<Plugin> p = takePlugin(_name);
if (p)
finalisePlugin(p.get());
}

12
alethzero/MainWin.h

@ -153,10 +153,6 @@ private slots:
void on_blockChainFilter_textChanged();
void on_blocks_currentItemChanged();
// Logging
// void on_log_doubleClicked();
void on_verbosity_valueChanged();
// Misc
void on_urlEdit_returnPressed();
void on_jsInput_returnPressed();
@ -203,6 +199,11 @@ signals:
void poll();
private:
template <class P> void loadPlugin() { dev::az::Plugin* p = new P(this); initPlugin(p); }
void initPlugin(dev::az::Plugin* _p);
void finalisePlugin(dev::az::Plugin* _p);
void unloadPlugin(std::string const& _name);
void debugDumpState(int _add);
dev::p2p::NetworkPreferences netPrefs() const;
@ -270,9 +271,6 @@ private:
QActionGroup* m_vmSelectionGroup = nullptr;
QList<QPair<QString, QString>> m_consoleHistory;
QMutex m_logLock;
QString m_logHistory;
bool m_logChanged = true;
std::unique_ptr<jsonrpc::HttpServer> m_httpConnector;
std::unique_ptr<OurWebThreeStubServer> m_server;

26
alethzero/Transact.cpp

@ -28,6 +28,7 @@
#include <boost/algorithm/string.hpp>
#include <QFileDialog>
#include <QMessageBox>
#include <QClipboard>
#include <liblll/Compiler.h>
#include <liblll/CodeFragment.h>
#if ETH_SOLIDITY || !ETH_TRUE
@ -118,6 +119,11 @@ u256 Transact::gasPrice() const
return ui->gasPrice->value() * units()[units().size() - 1 - ui->gasPriceUnits->currentIndex()].first;
}
Address Transact::to() const
{
return m_context->fromString(ui->destination->currentText().toStdString()).first;
}
u256 Transact::total() const
{
return value() + fee();
@ -133,7 +139,7 @@ void Transact::updateDestination()
if (ui->destination->findText(s, Qt::MatchExactly | Qt::MatchCaseSensitive) == -1)
ui->destination->addItem(s);
for (int i = 0; i < ui->destination->count(); ++i)
if (ui->destination->itemText(i) != "(Create Contract)" && !m_context->fromString(ui->destination->itemText(i).toStdString()).first)
if (ui->destination->itemText(i) != "(Create Contract)" && !to())
ui->destination->removeItem(i--);
}
@ -181,7 +187,23 @@ void Transact::on_destination_currentTextChanged(QString)
else
ui->calculatedName->setText("Create Contract");
rejigData();
// updateFee();
// updateFee();
}
void Transact::on_copyUnsigned_clicked()
{
auto a = fromAccount();
u256 nonce = ui->autoNonce->isChecked() ? ethereum()->countAt(a, PendingBlock) : ui->nonce->value();
Transaction t;
if (isCreation())
// If execution is a contract creation, add Natspec to
// a local Natspec LEVELDB
t = Transaction(value(), gasPrice(), ui->gas->value(), m_data, nonce);
else
// TODO: cache like m_data.
t = Transaction(value(), gasPrice(), ui->gas->value(), to(), m_data, nonce);
qApp->clipboard()->setText(QString::fromStdString(toHex(t.rlp())));
}
static std::string toString(TransactionException _te)

2
alethzero/Transact.h

@ -54,6 +54,7 @@ private slots:
void on_gasPrice_valueChanged(int) { updateFee(); rejigData(); }
void on_data_textChanged() { rejigData(); }
void on_optimize_clicked() { rejigData(); }
void on_copyUnsigned_clicked();
void on_send_clicked();
void on_debug_clicked();
void on_cancel_clicked() { close(); }
@ -71,6 +72,7 @@ private:
dev::u256 total() const;
dev::u256 value() const;
dev::u256 gasPrice() const;
dev::Address to() const;
std::string natspecNotice(dev::Address _to, dev::bytes const& _data);
dev::Secret findSecret(dev::u256 _totalReq) const;

7
alethzero/Transact.ui

@ -254,6 +254,13 @@
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QPushButton" name="copyUnsigned">
<property name="text">
<string>Copy &amp;Unsigned</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>

1
evmjit/CMakeLists.txt

@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 2.8.12)
if (${CMAKE_VERSION} VERSION_GREATER 3.0)
cmake_policy(SET CMP0042 NEW) # fix MACOSX_RPATH
cmake_policy(SET CMP0048 NEW) # allow VERSION argument in project()
project(EVMJIT VERSION 0.9.0 LANGUAGES CXX)
else()

7
libdevcore/CMakeLists.txt

@ -1,11 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB")

2
libdevcore/FixedHash.h

@ -278,7 +278,7 @@ public:
SecureFixedHash operator|(SecureFixedHash const& _c) const { return SecureFixedHash(*this) |= _c; }
SecureFixedHash& operator&=(SecureFixedHash const& _c) { static_cast<FixedHash<T>&>(*this).operator^=(static_cast<FixedHash<T> const&>(_c)); return *this; }
SecureFixedHash operator&(SecureFixedHash const& _c) const { return SecureFixedHash(*this) &= _c; }
SecureFixedHash operator~() const { ~static_cast<FixedHash<T>&>(*this); return *this; }
SecureFixedHash operator~() const { auto r = ~static_cast<FixedHash<T> const&>(*this); return static_cast<SecureFixedHash const&>(r); }
using FixedHash<T>::abridged;
using FixedHash<T>::abridgedMiddle;

6
libdevcrypto/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
aux_source_directory(. SRC_LIST)

2
libdevcrypto/Common.cpp

@ -367,7 +367,7 @@ Secret Nonce::next()
{
initialiseIfNeeded();
m_value = sha3(m_value);
return sha3(m_value);
return sha3(~m_value);
}
void Nonce::resetInternal()

19
libethash-cl/ethash_cl_miner.cpp

@ -284,6 +284,25 @@ void ethash_cl_miner::listDevices()
doForAllDevices([&outString, &i](cl::Device const _device)
{
outString += "[" + to_string(i) + "] " + _device.getInfo<CL_DEVICE_NAME>() + "\n";
outString += "\tCL_DEVICE_TYPE: ";
switch (_device.getInfo<CL_DEVICE_TYPE>())
{
case CL_DEVICE_TYPE_CPU:
outString += "CPU\n";
break;
case CL_DEVICE_TYPE_GPU:
outString += "GPU\n";
break;
case CL_DEVICE_TYPE_ACCELERATOR:
outString += "ACCELERATOR\n";
break;
default:
outString += "DEFAULT\n";
break;
}
outString += "\tCL_DEVICE_GLOBAL_MEM_SIZE: " + to_string(_device.getInfo<CL_DEVICE_GLOBAL_MEM_SIZE>()) + "\n";
outString += "\tCL_DEVICE_MAX_MEM_ALLOC_SIZE: " + to_string(_device.getInfo<CL_DEVICE_MAX_MEM_ALLOC_SIZE>()) + "\n";
outString += "\tCL_DEVICE_MAX_WORK_GROUP_SIZE: " + to_string(_device.getInfo<CL_DEVICE_MAX_WORK_GROUP_SIZE>()) + "\n";
++i;
}
);

9
libethcore/BlockInfo.cpp

@ -202,10 +202,15 @@ u256 BlockInfo::childGasLimit(u256 const& _gasFloorTarget) const
u256 BlockInfo::calculateDifficulty(BlockInfo const& _parent) const
{
const unsigned c_expDiffPeriod = 100000;
if (!m_number)
throw GenesisBlockCannotBeCalculated();
else
return max<u256>(c_minimumDifficulty, m_timestamp >= _parent.m_timestamp + c_durationLimit ? _parent.m_difficulty - (_parent.m_difficulty / c_difficultyBoundDivisor) : (_parent.m_difficulty + (_parent.m_difficulty / c_difficultyBoundDivisor)));
u256 o = max<u256>(c_minimumDifficulty, m_timestamp >= _parent.m_timestamp + c_durationLimit ? _parent.m_difficulty - (_parent.m_difficulty / c_difficultyBoundDivisor) : (_parent.m_difficulty + (_parent.m_difficulty / c_difficultyBoundDivisor)));
unsigned periodCount = unsigned(_parent.number() + 1) / c_expDiffPeriod;
if (periodCount > 1)
o = max<u256>(c_minimumDifficulty, o + (u256(1) << (periodCount - 2))); // latter will eventually become huge, so ensure it's a bigint.
return o;
}
void BlockInfo::verifyParent(BlockInfo const& _parent) const

1
libethcore/BlockInfo.h

@ -128,6 +128,7 @@ public:
void setCoinbaseAddress(Address const& _v) { m_coinbaseAddress = _v; noteDirty(); }
void setRoots(h256 const& _t, h256 const& _r, h256 const& _u, h256 const& _s) { m_transactionsRoot = _t; m_receiptsRoot = _r; m_stateRoot = _s; m_sha3Uncles = _u; noteDirty(); }
void setGasUsed(u256 const& _v) { m_gasUsed = _v; noteDirty(); }
void setNumber(u256 const& _v) { m_number = _v; noteDirty(); }
void setGasLimit(u256 const& _v) { m_gasLimit = _v; noteDirty(); }
void setExtraData(bytes const& _v) { m_extraData = _v; noteDirty(); }
void setLogBloom(LogBloom const& _v) { m_logBloom = _v; noteDirty(); }

6
libethcore/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
aux_source_directory(. SRC_LIST)

1
libethcore/Common.h

@ -80,6 +80,7 @@ template <> inline u256 exp10<0>()
static const u256 ether = exp10<18>();
static const u256 finney = exp10<15>();
static const u256 szabo = exp10<12>();
static const u256 shannon = exp10<9>();
static const u256 wei = exp10<0>();
using Nonce = h64;

2
libethcore/Params.cpp

@ -61,7 +61,7 @@ Network resetNetwork(Network _n)
c_minGasLimit = 5000;
break;
}
c_gasFloorTarget = c_network == Network::Frontier ? 5000 : 3141592;
c_gasFloorTarget = 3141592;
c_gasLimitBoundDivisor = 1024;
c_minimumDifficulty = 131072;
c_difficultyBoundDivisor = 2048;

6
libethereum/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB")

6
libethereum/GasPricer.h

@ -40,6 +40,8 @@ enum class TransactionPriority
Highest = 8
};
static const u256 c_defaultGasPrice = 50 * shannon;
class GasPricer
{
public:
@ -66,8 +68,8 @@ public:
u256 bid(TransactionPriority = TransactionPriority::Medium) const override { return m_bid; }
private:
u256 m_ask = 10 * szabo;
u256 m_bid = 10 * szabo;
u256 m_ask = c_defaultGasPrice;
u256 m_bid = c_defaultGasPrice;
};
}

9
libethereum/Interface.h

@ -26,6 +26,7 @@
#include <libdevcore/Guards.h>
#include <libdevcrypto/Common.h>
#include <libethcore/Ethash.h>
#include <libethereum/GasPricer.h>
#include "LogFilter.h"
#include "Transaction.h"
#include "AccountDiff.h"
@ -70,25 +71,25 @@ public:
virtual std::pair<h256, Address> submitTransaction(TransactionSkeleton const& _t, Secret const& _secret) = 0;
/// Submits the given message-call transaction.
void submitTransaction(Secret const& _secret, u256 const& _value, Address const& _dest, bytes const& _data = bytes(), u256 const& _gas = 10000, u256 const& _gasPrice = 10 * szabo, u256 const& _nonce = UndefinedU256);
void submitTransaction(Secret const& _secret, u256 const& _value, Address const& _dest, bytes const& _data = bytes(), u256 const& _gas = 10000, u256 const& _gasPrice = c_defaultGasPrice, u256 const& _nonce = UndefinedU256);
/// Submits a new contract-creation transaction.
/// @returns the new contract's address (assuming it all goes through).
Address submitTransaction(Secret const& _secret, u256 const& _endowment, bytes const& _init, u256 const& _gas = 10000, u256 const& _gasPrice = 10 * szabo, u256 const& _nonce = UndefinedU256);
Address submitTransaction(Secret const& _secret, u256 const& _endowment, bytes const& _init, u256 const& _gas = 10000, u256 const& _gasPrice = c_defaultGasPrice, u256 const& _nonce = UndefinedU256);
/// Blocks until all pending transactions have been processed.
virtual void flushTransactions() = 0;
/// Makes the given call. Nothing is recorded into the state.
virtual ExecutionResult call(Address const& _from, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice, BlockNumber _blockNumber, FudgeFactor _ff = FudgeFactor::Strict) = 0;
ExecutionResult call(Address const& _from, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo, FudgeFactor _ff = FudgeFactor::Strict) { return call(_from, _value, _dest, _data, _gas, _gasPrice, m_default, _ff); }
ExecutionResult call(Address const& _from, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = c_defaultGasPrice, FudgeFactor _ff = FudgeFactor::Strict) { return call(_from, _value, _dest, _data, _gas, _gasPrice, m_default, _ff); }
ExecutionResult call(Secret const& _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice, BlockNumber _blockNumber, FudgeFactor _ff = FudgeFactor::Strict) { return call(toAddress(_secret), _value, _dest, _data, _gas, _gasPrice, _blockNumber, _ff); }
ExecutionResult call(Secret const& _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice, FudgeFactor _ff = FudgeFactor::Strict) { return call(toAddress(_secret), _value, _dest, _data, _gas, _gasPrice, _ff); }
/// Does the given creation. Nothing is recorded into the state.
/// @returns the pair of the Address of the created contract together with its code.
virtual ExecutionResult create(Address const& _from, u256 _value, bytes const& _data, u256 _gas, u256 _gasPrice, BlockNumber _blockNumber, FudgeFactor _ff = FudgeFactor::Strict) = 0;
ExecutionResult create(Address const& _from, u256 _value, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo, FudgeFactor _ff = FudgeFactor::Strict) { return create(_from, _value, _data, _gas, _gasPrice, m_default, _ff); }
ExecutionResult create(Address const& _from, u256 _value, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = c_defaultGasPrice, FudgeFactor _ff = FudgeFactor::Strict) { return create(_from, _value, _data, _gas, _gasPrice, m_default, _ff); }
ExecutionResult create(Secret const& _secret, u256 _value, bytes const& _data, u256 _gas, u256 _gasPrice, BlockNumber _blockNumber, FudgeFactor _ff = FudgeFactor::Strict) { return create(toAddress(_secret), _value, _data, _gas, _gasPrice, _blockNumber, _ff); }
ExecutionResult create(Secret const& _secret, u256 _value, bytes const& _data, u256 _gas, u256 _gasPrice, FudgeFactor _ff = FudgeFactor::Strict) { return create(toAddress(_secret), _value, _data, _gas, _gasPrice, _ff); }

6
libethereumx/Ethereum.h

@ -62,11 +62,11 @@ public:
~Ethereum();
/// Submits the given message-call transaction.
void submitTransaction(Secret const& _secret, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo);
void submitTransaction(Secret const& _secret, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = c_defaultGasPrice);
/// Submits a new contract-creation transaction.
/// @returns the new contract's address (assuming it all goes through).
Address submitTransaction(Secret const& _secret, u256 _endowment, bytes const& _init, u256 _gas = 10000, u256 _gasPrice = 10 * szabo);
Address submitTransaction(Secret const& _secret, u256 _endowment, bytes const& _init, u256 _gas = 10000, u256 _gasPrice = c_defaultGasPrice);
/// Injects the RLP-encoded transaction given by the _rlp into the transaction queue directly.
void inject(bytesConstRef _rlp);
@ -75,7 +75,7 @@ public:
void flushTransactions();
/// Makes the given call. Nothing is recorded into the state.
bytes call(Address const& _from, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo);
bytes call(Address const& _from, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = c_defaultGasPrice);
// Informational stuff

6
libevm/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB")

6
libevmasm/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB")

6
libevmcore/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
aux_source_directory(. SRC_LIST)

7
libjsconsole/CMakeLists.txt

@ -1,11 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
aux_source_directory(. SRC_LIST)

7
libjsengine/CMakeLists.txt

@ -1,11 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
aux_source_directory(. SRC_LIST)

6
liblll/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB")

2
libnatspec/CMakeLists.txt

@ -4,8 +4,6 @@ cmake_policy(SET CMP0020 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
cmake_policy(SET CMP0043 OLD)
endif()
set(CMAKE_AUTOMOC OFF)

6
libp2p/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB")

6
libscrypt/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB")

6
libserpent/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB")

6
libsolidity/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB")

6
libtestutils/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
aux_source_directory(. SRC_LIST)

6
libweb3jsonrpc/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
aux_source_directory(. SRC_LIST)

6
libwebthree/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB")

6
libwhisper/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB")

2
libwhisper/WhisperDB.cpp

@ -35,7 +35,7 @@ WhisperDB::WhisperDB(string const& _type)
string path = dev::getDataDir("shh");
fs::create_directories(path);
fs::permissions(path, fs::owner_all);
path.append("\\").append(_type);
path += "/" + _type;
leveldb::Options op;
op.create_if_missing = true;
op.max_open_files = 256;

6
secp256k1/CMakeLists.txt

@ -1,10 +1,4 @@
cmake_policy(SET CMP0015 NEW)
# this policy was introduced in cmake 3.0
# remove if, once 3.0 will be used on unix
if (${CMAKE_MAJOR_VERSION} GREATER 2)
# old policy do not use MACOSX_RPATH
cmake_policy(SET CMP0042 OLD)
endif()
set(CMAKE_AUTOMOC OFF)
set(EXECUTABLE secp256k1)

1
test/CMakeLists.txt

@ -33,6 +33,7 @@ endif()
if (SOLIDITY)
add_subdirectory(libsolidity)
add_subdirectory(contracts)
endif ()
if (JSONRPC)
add_subdirectory(libweb3jsonrpc)

5
test/contracts/CMakeLists.txt

@ -0,0 +1,5 @@
cmake_policy(SET CMP0015 NEW)
aux_source_directory(. SRCS)
add_sources(${SRCS})

0
test/libsolidity/SolidityFixedFeeRegistrar.cpp → test/contracts/FixedFeeRegistrar.cpp

0
test/libsolidity/SolidityWallet.cpp → test/contracts/Wallet.cpp

63
test/libethcore/difficulty.cpp

@ -0,0 +1,63 @@
/*
This file is part of cpp-ethereum.
cpp-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file difficulty.cpp
* @author Christoph Jentzsch <cj@ethdev.com>
* @date 2015
* difficulty calculation tests.
*/
#include <boost/test/unit_test.hpp>
#include <test/TestHelper.h>
#include <libethcore/BlockInfo.h>
using namespace std;
using namespace dev;
using namespace dev::eth;
namespace js = json_spirit;
BOOST_AUTO_TEST_SUITE(DifficultyTests)
BOOST_AUTO_TEST_CASE(difficultyTests)
{
string testPath = test::getTestPath();
testPath += "/BasicTests";
js::mValue v;
string s = contentsString(testPath + "/difficulty.json");
BOOST_REQUIRE_MESSAGE(s.length() > 0, "Contents of 'difficulty.json' is empty. Have you cloned the 'tests' repo branch develop?");
js::read_string(s, v);
for (auto& i: v.get_obj())
{
js::mObject o = i.second.get_obj();
cnote << "Difficulty test: " << i.first;
BlockInfo parent;
parent.setTimestamp(test::toInt(o["parentTimestamp"]));
parent.setDifficulty(test::toInt(o["parentDifficulty"]));
parent.setNumber(test::toInt(o["currentBlockNumber"]) - 1);
BlockInfo current;
current.setTimestamp(test::toInt(o["currentTimestamp"]));
current.setNumber(test::toInt(o["currentBlockNumber"]));
BOOST_CHECK_EQUAL(current.calculateDifficulty(parent), test::toInt(o["currentDifficulty"]));
}
}
BOOST_AUTO_TEST_SUITE_END()

8
test/libethereum/gaspricer.cpp

@ -54,11 +54,11 @@ BOOST_AUTO_TEST_CASE(trivialGasPricer)
{
cnote << "trivialGasPricer";
std::shared_ptr<dev::eth::GasPricer> gp(new TrivialGasPricer);
BOOST_CHECK_EQUAL(gp->ask(State()), 10 * szabo);
BOOST_CHECK_EQUAL(gp->bid(), 10 * szabo);
BOOST_CHECK_EQUAL(gp->ask(State()), c_defaultGasPrice);
BOOST_CHECK_EQUAL(gp->bid(), c_defaultGasPrice);
gp->update(CanonBlockChain<Ethash>(TransientDirectory().path(), WithExisting::Kill));
BOOST_CHECK_EQUAL(gp->ask(State()), 10 * szabo);
BOOST_CHECK_EQUAL(gp->bid(), 10 * szabo);
BOOST_CHECK_EQUAL(gp->ask(State()), c_defaultGasPrice);
BOOST_CHECK_EQUAL(gp->bid(), c_defaultGasPrice);
}
BOOST_AUTO_TEST_CASE(basicGasPricerNoUpdate)

2
test/libethereum/transaction.cpp

@ -17,7 +17,7 @@
/** @file transaction.cpp
* @author Dmitrii Khokhlov <winsvega@mail.ru>
* @date 2015
* Transaaction test functions.
* Transaction test functions.
*/
#include "../TestHelper.h"

3
test/libp2p/net.cpp

@ -339,6 +339,9 @@ BOOST_AUTO_TEST_SUITE(netTypes)
BOOST_AUTO_TEST_CASE(deadlineTimer)
{
if (test::Options::get().nonetwork)
return;
ba::io_service io;
ba::deadline_timer t(io);
bool start = false;

Loading…
Cancel
Save