Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
2bc972f
BLock2: state test filling issue
Aug 11, 2015
4f29904
restore lost changes blockmining
Aug 12, 2015
93f6e0a
Link consecutive basic blocks after all blocks are compiled.
chfast Aug 12, 2015
0cad5c0
fixed typos and unified expressions
Aug 13, 2015
f231ffd
Added name and license info as required
Aug 13, 2015
1d5c8c2
'coinbase' to 'etherbase' (parameters, help text)
Aug 13, 2015
c050fc3
Corrects pre-coffee typo
Aug 13, 2015
157c4a0
Undo ether/coinbase renaming, will be changed later to for example be…
Aug 13, 2015
299fc12
Resolve jumps after code compilation.
chfast Aug 13, 2015
f97dd87
Merge remote-tracking branch 'upstream/develop' into evmjit-resolve-j…
chfast Aug 13, 2015
b3f8338
NewAccount ui
debris Aug 13, 2015
f36a002
Anable stack offloading for all OSs. Adjust offloading point.
chfast Aug 13, 2015
9e40a05
First dubby impl.
gavofyork Aug 13, 2015
4c81c34
fixed another case of misplaced invariant check
arkpar Aug 13, 2015
6d29d72
immediate invariants check
arkpar Aug 13, 2015
0d05a40
edit button changes, color of selected blocks
duckized Aug 13, 2015
cb2a5ec
new account plugin finished
debris Aug 13, 2015
0dc12f8
Merge branch 'develop' of https://github.com/ethereum/cpp-ethereum in…
debris Aug 13, 2015
f30991f
make hint text field enabled only when entering password is enabled
debris Aug 14, 2015
51a7d57
Merge pull request #2817 from arkpar/bc
Aug 14, 2015
8fc404f
Style changes.
chfast Aug 14, 2015
0ff44bd
Async transact gas determination.
gavofyork Aug 14, 2015
375829a
Merge pull request #2818 from chfast/stack-offloading-again
Aug 14, 2015
c7dc2b2
Merge pull request #2820 from debris/new_account_ui
Aug 14, 2015
63f6e98
moved export state dialog to plugin
arkpar Aug 14, 2015
e69a0c1
Forgot to record the timer id.
gavofyork Aug 14, 2015
60b0dcb
Don't start timer, cleanup before next time.
gavofyork Aug 14, 2015
8542700
additional ssh methods
debris Aug 14, 2015
291fbcb
BlockChainTests mining
Aug 14, 2015
1a5039f
Merge pull request #2822 from ethereum/transactasyncgas
Aug 14, 2015
4ca3608
Mining
Aug 14, 2015
a72ba9e
Brain wallet in ethkey CLI.
gavofyork Aug 14, 2015
77da524
clean up
CJentzsch Aug 14, 2015
79e4aab
Merge remote-tracking branch 'upstream/develop' into winsvegaBlock2
CJentzsch Aug 14, 2015
e087e69
BLock2: state test filling issue
Aug 11, 2015
feea9ae
restore lost changes blockmining
Aug 12, 2015
238f17e
BlockChainTests mining
Aug 14, 2015
9c19f5d
Mining
Aug 14, 2015
bcd6602
Fill tests
Aug 15, 2015
9cd4643
Bulk transaction injection.
gavofyork Aug 15, 2015
2b4c5cd
Merge pull request #2826 from ethereum/shh_addition
Aug 15, 2015
6bf73bc
Merge pull request #2814 from chfast/evmjit-resolve-jumps
Aug 15, 2015
07c59dc
Merge pull request #2831 from alexvandesande/ui-fixes-avsa
Aug 15, 2015
54bf061
Merge pull request #2824 from arkpar/az-refactor
Aug 15, 2015
18d9398
Fix --sign-tx in ethkey.
gavofyork Aug 15, 2015
00868c0
Merge branch 'develop' of github.com:ethereum/cpp-ethereum into develop
gavofyork Aug 15, 2015
525113e
Merge branch 'develop' of https://github.com/imifos/cpp-ethereum into…
gavofyork Aug 15, 2015
8fb2042
Merge branch 'imifos-develop' into develop
gavofyork Aug 15, 2015
a05ae39
Merge pull request #2832 from ethereum/bulktxinj
Aug 15, 2015
3308b77
Merge branch 'develop' of github.com:ethereum/cpp-ethereum into develop
gavofyork Aug 15, 2015
03351a1
Fix templates.
gavofyork Aug 15, 2015
a13be48
ethkey can be used to make transactions as well as sign them.
gavofyork Aug 15, 2015
0fc3d1b
All Accounts panel works with address book.
gavofyork Aug 15, 2015
be9f868
HD wallet stuff.
gavofyork Aug 15, 2015
de420f9
Storage keys in order in AllAccounts view.
gavofyork Aug 15, 2015
15e9979
Presale import in AZ.
gavofyork Aug 15, 2015
17cbfd0
Bug fix in ethkey.
gavofyork Aug 15, 2015
07eb0a0
Fix build for gcc 5.2.0
LefterisJP Aug 15, 2015
05a1df5
msvc does not like gcc attributes
LefterisJP Aug 15, 2015
e8b6d43
vector_ref::cleanse actually sets to zero.
gavofyork Aug 16, 2015
441105e
ImportKey dialog.
gavofyork Aug 16, 2015
d5776ef
Fixes for new import dialog.
gavofyork Aug 16, 2015
bb8e88f
Minor additional fix for dialog.
gavofyork Aug 16, 2015
7e9f719
Merge pull request #2838 from LefterisJP/s_noteplugin_unused
Aug 16, 2015
7362c38
Minor UI improvements
gavofyork Aug 16, 2015
e8da5d3
Merge remote-tracking branch 'winsvega/block2' into winsvegaBlock2
CJentzsch Aug 17, 2015
bcbe9ae
style
CJentzsch Aug 17, 2015
413ebfe
fix coinbase rewards in blockChainTests
CJentzsch Aug 17, 2015
0d1fd85
Tests fix; ignore missing web3 keys path.
gavofyork Aug 17, 2015
7cef4dd
Merge pull request #2844 from ethereum/importkey
Aug 17, 2015
be88673
Merge remote-tracking branch 'upstream/develop' into winsvegaBlock2
CJentzsch Aug 17, 2015
ea2e290
BLock2: state test filling issue
Aug 11, 2015
5824c88
restore lost changes blockmining
Aug 12, 2015
eae2407
BlockChainTests mining
Aug 14, 2015
1459e28
Mining
Aug 14, 2015
0e32935
Fill tests
Aug 15, 2015
1315bb5
Merge remote-tracking branch 'winsvega/block2' into winsvegaBlock2
CJentzsch Aug 17, 2015
cccf005
Merge pull request #4 from CJentzsch/winsvegaBlock2
Aug 17, 2015
7955212
BlockTests: restore corelibs and mining
Aug 17, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions alethzero/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ qt5_wrap_ui(ui_Main.h Main.ui)
qt5_wrap_ui(ui_Connect.h Connect.ui)
qt5_wrap_ui(ui_Debugger.h Debugger.ui)
qt5_wrap_ui(ui_Transact.h Transact.ui)
qt5_wrap_ui(ui_ExportState.h ExportState.ui)
qt5_wrap_ui(ui_GetPassword.h GetPassword.ui)
qt5_wrap_ui(ui_GasPricing.h GasPricing.ui)

Expand All @@ -60,7 +59,7 @@ endif ()
# eth_add_executable is defined in cmake/EthExecutableHelper.cmake
eth_add_executable(${EXECUTABLE}
ICON alethzero
UI_RESOURCES ${PLUGIN_UI} alethzero.icns Main.ui Connect.ui Debugger.ui Transact.ui ExportState.ui GetPassword.ui GasPricing.ui
UI_RESOURCES ${PLUGIN_UI} alethzero.icns Main.ui Connect.ui Debugger.ui Transact.ui GetPassword.ui GasPricing.ui
WIN_RESOURCES alethzero.rc
)

Expand Down
28 changes: 20 additions & 8 deletions alethzero/Main.ui
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@
<addaction name="prepNextDAG"/>
<addaction name="separator"/>
<addaction name="newTransaction"/>
<addaction name="newAccount"/>
<addaction name="importKey"/>
<addaction name="importKeyFile"/>
<addaction name="importPresale"/>
<addaction name="claimPresale"/>
<addaction name="exportKey"/>
<addaction name="reencryptAll"/>
Expand All @@ -173,7 +173,6 @@
<addaction name="separator"/>
<addaction name="loadJS"/>
<addaction name="separator"/>
<addaction name="exportState"/>
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
Expand All @@ -189,7 +188,6 @@
<addaction name="paranoia"/>
<addaction name="clearPending"/>
<addaction name="killBlockchain"/>
<addaction name="inject"/>
<addaction name="injectBlock"/>
<addaction name="forceMining"/>
<addaction name="separator"/>
Expand All @@ -214,6 +212,7 @@
<property name="title">
<string>&amp;Debug</string>
</property>
<addaction name="debugPending"/>
<addaction name="debugCurrent"/>
<addaction name="debugDumpState"/>
<addaction name="debugDumpStatePre"/>
Expand Down Expand Up @@ -1098,11 +1097,6 @@ font-size: 14pt</string>
<string>&amp;Load Javascript...</string>
</property>
</action>
<action name="exportState">
<property name="text">
<string>&amp;Export State...</string>
</property>
</action>
<action name="debugStepBack">
<property name="enabled">
<bool>false</bool>
Expand Down Expand Up @@ -1388,6 +1382,24 @@ font-size: 14pt</string>
<string>Dump &amp;Block State as JSON...</string>
</property>
</action>
<action name="bulkTransactions">
<property name="text">
<string>&amp;Bulk Inject Transactions...</string>
</property>
</action>
<action name="debugPending">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Debug &amp;Pending Transaction</string>
</property>
</action>
<action name="importPresale">
<property name="text">
<string>Import Ether &amp;Presale Wallet...</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
Expand Down
5 changes: 5 additions & 0 deletions alethzero/MainFace.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ namespace shh { class WhisperHost; }
namespace az
{

#ifndef _MSC_VER // MSVC does not like gcc compiler attributes
#define DEV_AZ_NOTE_PLUGIN(ClassName) \
static bool s_notePlugin __attribute__((unused)) = [](){ MainFace::notePlugin([](MainFace* m){ return new ClassName(m); }); return true; }()
#else
#define DEV_AZ_NOTE_PLUGIN(ClassName) \
static bool s_notePlugin = [](){ MainFace::notePlugin([](MainFace* m){ return new ClassName(m); }); return true; }()
#endif

class Plugin;
class MainFace;
Expand Down
159 changes: 51 additions & 108 deletions alethzero/MainWin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
#include "DappLoader.h"
#include "DappHost.h"
#include "WebPage.h"
#include "ExportState.h"
#include "ui_Main.h"
#include "ui_GetPassword.h"
#include "ui_GasPricing.h"
Expand Down Expand Up @@ -241,7 +240,7 @@ Main::Main(QWidget* _parent):
ui->vmSmart->setEnabled(false);
#endif

readSettings();
readSettings(true, false);

m_transact = new Transact(this, this);
m_transact->setWindowFlags(Qt::Dialog);
Expand All @@ -263,6 +262,8 @@ Main::Main(QWidget* _parent):

for (auto const& i: *s_linkedPlugins)
initPlugin(i(this));

readSettings(false, true);
}

Main::~Main()
Expand Down Expand Up @@ -668,9 +669,10 @@ std::string Main::render(dev::Address const& _a) const
if (p.size() == 9 && p.find_first_not_of("QWERYUOPASDFGHJKLZXCVBNM1234567890") == string::npos)
p = ICAP(p, "XREG").encoded();
else
DEV_IGNORE_EXCEPTIONS(n = ICAP(_a).encoded());
if (n.empty())
n = _a.abridged();
DEV_IGNORE_EXCEPTIONS(n = ICAP(_a).encoded().substr(0, 8));
if (!n.empty())
n += " ";
n += _a.abridged();
return p.empty() ? n : (p + " " + n);
}

Expand Down Expand Up @@ -850,13 +852,15 @@ Secret Main::retrieveSecret(Address const& _address) const
}
}

void Main::readSettings(bool _skipGeometry)
void Main::readSettings(bool _skipGeometry, bool _onlyGeometry)
{
QSettings s("ethereum", "alethzero");

if (!_skipGeometry)
restoreGeometry(s.value("geometry").toByteArray());
restoreState(s.value("windowState").toByteArray());
if (_onlyGeometry)
return;

forEach([&](std::shared_ptr<Plugin> p)
{
Expand Down Expand Up @@ -1018,6 +1022,28 @@ void Main::on_claimPresale_triggered()
}
}

void Main::on_importPresale_triggered()
{
QString s = QFileDialog::getOpenFileName(this, "Claim Account Contents", QDir::homePath(), "JSON Files (*.json);;All Files (*)");
try
{
string pass;
KeyPair k = m_keyManager.presaleSecret(dev::contentsString(s.toStdString()), [&](bool){ return (pass = QInputDialog::getText(this, "Enter Password", "Enter the wallet's passphrase", QLineEdit::Password).toStdString()); });
cnote << k.address();
if (!m_keyManager.hasAccount(k.address()))
keyManager().import(k.secret(), "Presale wallet (" + s.toStdString() + ")", pass, "Same password as for the presale wallet");
else
QMessageBox::warning(this, "Already Have Key", "Could not import the secret key: we already own this account.");
}
catch (dev::eth::PasswordUnknown&) {}
catch (...)
{
cerr << "Unhandled exception!" << endl <<
boost::current_exception_diagnostic_information();
QMessageBox::warning(this, "Key File Invalid", "Could not find secret key definition. This is probably not an Ethereum key file.");
}
}

void Main::on_exportKey_triggered()
{
if (ui->ourAccounts->currentRow() >= 0)
Expand All @@ -1029,12 +1055,6 @@ void Main::on_exportKey_triggered()
}
}

void Main::on_exportState_triggered()
{
ExportStateDialog dialog(this);
dialog.exec();
}

void Main::on_usePrivate_triggered()
{
QString pc;
Expand Down Expand Up @@ -1549,6 +1569,7 @@ void Main::on_transactionQueue_currentItemChanged()
int i = ui->transactionQueue->currentRow();
if (i >= 0 && i < (int)ethereum()->pending().size())
{
ui->debugPending->setEnabled(true);
Transaction tx(ethereum()->pending()[i]);
TransactionReceipt receipt(ethereum()->postState().receipt(i));
auto ss = tx.safeSender();
Expand Down Expand Up @@ -1588,30 +1609,13 @@ void Main::on_transactionQueue_currentItemChanged()
// s << "Pre: " << fs.rootHash() << "<br/>";
// s << "Post: <b>" << ts.rootHash() << "</b>";
}
else
ui->debugPending->setEnabled(false);

ui->pendingInfo->setHtml(QString::fromStdString(s.str()));
ui->pendingInfo->moveCursor(QTextCursor::Start);
}

void Main::on_inject_triggered()
{
QString s = QInputDialog::getText(this, "Inject Transaction", "Enter transaction dump in hex");
try
{
bytes b = fromHex(s.toStdString(), WhenError::Throw);
ethereum()->injectTransaction(b);
}
catch (BadHexCharacter& _e)
{
cwarn << "invalid hex character, transaction rejected";
cwarn << boost::diagnostic_information(_e);
}
catch (...)
{
cwarn << "transaction rejected";
}
}

void Main::on_injectBlock_triggered()
{
QString s = QInputDialog::getText(this, "Inject Block", "Enter block dump in hex");
Expand Down Expand Up @@ -1804,6 +1808,22 @@ void Main::on_debugCurrent_triggered()
}
}

void Main::on_debugPending_triggered()
{
int txi = ui->transactionQueue->currentRow();
if (txi == -1)
return;

Block b = ethereum()->postState();
bytes t = b.pending()[txi].rlp();
State s(ethereum()->state(txi));
BlockInfo bi(b.info());
Executive e(s, ethereum()->blockChain(), EnvInfo(bi));
Debugger dw(this, this);
dw.populate(e, Transaction(t, CheckTransaction::Everything));
dw.exec();
}

std::string minHex(h256 const& _h)
{
unsigned i = 0;
Expand Down Expand Up @@ -1988,83 +2008,6 @@ void Main::keysChanged()
onBalancesChange();
}

bool beginsWith(Address _a, bytes const& _b)
{
for (unsigned i = 0; i < min<unsigned>(20, _b.size()); ++i)
if (_a[i] != _b[i])
return false;
return true;
}

void Main::on_newAccount_triggered()
{
bool ok = true;
enum { NoVanity = 0, DirectICAP, FirstTwo, FirstTwoNextTwo, FirstThree, FirstFour, StringMatch };
QStringList items = {"No vanity (instant)", "Direct ICAP address", "Two pairs first (a few seconds)", "Two pairs first and second (a few minutes)", "Three pairs first (a few minutes)", "Four pairs first (several hours)", "Specific hex string"};
unsigned v = items.QList<QString>::indexOf(QInputDialog::getItem(this, "Vanity Key?", "Would you a vanity key? This could take several hours.", items, 1, false, &ok));
if (!ok)
return;

bytes bs;
if (v == StringMatch)
{
QString s = QInputDialog::getText(this, "Vanity Beginning?", "Enter some hex digits that it should begin with.\nNOTE: The more you enter, the longer generation will take.", QLineEdit::Normal, QString(), &ok);
if (!ok)
return;
bs = fromHex(s.toStdString());
}

KeyPair p;
bool keepGoing = true;
unsigned done = 0;
function<void()> f = [&]() {
KeyPair lp;
while (keepGoing)
{
done++;
if (done % 1000 == 0)
cnote << "Tried" << done << "keys";
lp = KeyPair::create();
auto a = lp.address();
if (v == NoVanity ||
(v == DirectICAP && !a[0]) ||
(v == FirstTwo && a[0] == a[1]) ||
(v == FirstTwoNextTwo && a[0] == a[1] && a[2] == a[3]) ||
(v == FirstThree && a[0] == a[1] && a[1] == a[2]) ||
(v == FirstFour && a[0] == a[1] && a[1] == a[2] && a[2] == a[3]) ||
(v == StringMatch && beginsWith(lp.address(), bs))
)
break;
}
if (keepGoing)
p = lp;
keepGoing = false;
};
vector<std::thread*> ts;
for (unsigned t = 0; t < std::thread::hardware_concurrency() - 1; ++t)
ts.push_back(new std::thread(f));
f();
for (std::thread* t: ts)
{
t->join();
delete t;
}

QString s = QInputDialog::getText(this, "Create Account", "Enter this account's name");
if (QMessageBox::question(this, "Create Account", "Would you like to use additional security for this key? This lets you protect it with a different password to other keys, but also means you must re-enter the key's password every time you wish to use the account.", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)
{
bool ok = false;
std::string hint;
std::string password = getPassword("Create Account", "Enter the password you would like to use for this key. Don't forget it!", &hint, &ok);
if (!ok)
return;
m_keyManager.import(p.secret(), s.toStdString(), password, hint);
}
else
m_keyManager.import(p.secret(), s.toStdString());
keysChanged();
}

void Main::on_killAccount_triggered()
{
if (ui->ourAccounts->currentRow() >= 0)
Expand Down
7 changes: 3 additions & 4 deletions alethzero/MainWin.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,18 @@ private slots:
void on_preview_triggered();

// Account management
void on_newAccount_triggered();
void on_killAccount_triggered();
void on_importKey_triggered();
void on_reencryptKey_triggered();
void on_reencryptAll_triggered();
void on_importKeyFile_triggered();
void on_claimPresale_triggered();
void on_importPresale_triggered();
void on_exportKey_triggered();

// Tools
void on_newTransaction_triggered();
void on_loadJS_triggered();
void on_exportState_triggered();

// Stuff concerning the blocks/transactions/accounts panels
void on_ourAccounts_itemClicked(QListWidgetItem* _i);
Expand All @@ -181,7 +180,6 @@ private slots:
void on_paranoia_triggered();
void on_killBlockchain_triggered();
void on_clearPending_triggered();
void on_inject_triggered();
void on_injectBlock_triggered();
void on_forceMining_triggered();
void on_usePrivate_triggered();
Expand All @@ -194,6 +192,7 @@ private slots:

// Debugger
void on_debugCurrent_triggered();
void on_debugPending_triggered();
void on_debugDumpState_triggered() { debugDumpState(1); }
void on_debugDumpStatePre_triggered() { debugDumpState(0); }
void on_dumpBlockState_triggered();
Expand Down Expand Up @@ -226,7 +225,7 @@ private slots:
Address getCurrencies() const;

void updateFee();
void readSettings(bool _skipGeometry = false);
void readSettings(bool _skipGeometry = false, bool _onlyGeometry = false);
void writeSettings();

void setPrivateChain(QString const& _private, bool _forceConfigure = false);
Expand Down
Loading