Skip to content

Commit

Permalink
Add the batch of release v3.4.4 commits
Browse files Browse the repository at this point in the history
  • Loading branch information
developer-at-bcn committed May 30, 2019
1 parent 871f4e1 commit 85d7885
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bytecoin-gui

[![Build Status](https://dev.azure.com/bcndev/bytecoin/_apis/build/status/bytecoin-desktop?branchName=releases/3.4.3)](https://dev.azure.com/bcndev/bytecoin/_build/latest?definitionId=2&branchName=releases/3.4.3)
[![Build Status](https://dev.azure.com/bcndev/bytecoin/_apis/build/status/bytecoin-desktop?branchName=releases/3.4.4)](https://dev.azure.com/bcndev/bytecoin/_build/latest?definitionId=2&branchName=releases/3.4.4)

## How to build binaries from source code

Expand Down
5 changes: 5 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Release Notes

### v3.4.4 (Amethyst)

- Added a menu item to create hardware wallets.
- Updated the Bytecoin daemons.

### v3.4.3 (Amethyst)

- Fixed a falsy update notification.
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -385,5 +385,5 @@ jobs:
displayName: Create github release in desktop repo
- script: |
curl -H "Authorization: token $(GithubPAT)" -X DELETE https://api.github.com/repos/$(daemonsRepo)/git/$(Build.SourceBranch)
curl -H "Authorization: token $(GithubPAT)" -X DELETE https://api.github.com/repos/$(desktopRepo)/git/$(Build.SourceBranch)
displayName: Remove branch created for the build
30 changes: 22 additions & 8 deletions src/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ bool WalletApplication::init()

connect(m_mainWindow, &MainWindow::createLegacyWalletSignal, this, &WalletApplication::createLegacyWallet);
connect(m_mainWindow, &MainWindow::createWalletSignal, this, &WalletApplication::createWallet);
connect(m_mainWindow, &MainWindow::createHWWalletSignal, this, &WalletApplication::createHWWallet);
connect(m_mainWindow, &MainWindow::importKeysSignal, this, &WalletApplication::importKeys);
connect(m_mainWindow, &MainWindow::openWalletSignal, this, &WalletApplication::openWallet);
connect(m_mainWindow, &MainWindow::restoreWalletFromMnemonicSignal, this, &WalletApplication::restoreWalletFromMnemonic);
Expand Down Expand Up @@ -242,7 +243,7 @@ void WalletApplication::createWalletd()
{
const QString& walletFile = Settings::instance().getWalletFile();
Q_ASSERT(!walletFile.isEmpty());
runBuiltinWalletd(walletFile, false, false, QByteArray{}, QByteArray{});
runBuiltinWalletd(walletFile, false, false, false, QByteArray{}, QByteArray{});
}
else
connectToRemoteWalletd();
Expand All @@ -260,7 +261,7 @@ void WalletApplication::splashMsg(const QString& msg)
m_mainWindow->splashMsg(msg);
}

void WalletApplication::runBuiltinWalletd(const QString& walletFile, bool createNew, bool createLegacy, QByteArray&& keys, QByteArray&& mnemonic)
void WalletApplication::runBuiltinWalletd(const QString& walletFile, bool createNew, bool createLegacy, bool createHardware, QByteArray&& keys, QByteArray&& mnemonic)
{
if (walletd_)
{
Expand All @@ -271,7 +272,7 @@ void WalletApplication::runBuiltinWalletd(const QString& walletFile, bool create
}

splashMsg(tr("Running walletd..."));
BuiltinWalletd* walletd = new BuiltinWalletd(walletFile, createNew, createLegacy, std::move(keys), std::move(mnemonic), this);
BuiltinWalletd* walletd = new BuiltinWalletd(walletFile, createNew, createLegacy, createHardware, std::move(keys), std::move(mnemonic), this);
walletd_ = walletd;

connect(walletd, &BuiltinWalletd::daemonStandardOutputSignal, m_mainWindow, &MainWindow::addDaemonOutput);
Expand Down Expand Up @@ -381,7 +382,7 @@ void WalletApplication::createLegacyWallet(QWidget* parent)
if (fileName.isEmpty())
return;

runBuiltinWalletd(fileName, false, true, QByteArray{}, QByteArray{});
runBuiltinWalletd(fileName, false, true, false, QByteArray{}, QByteArray{});
}

void WalletApplication::createWallet(QWidget* parent)
Expand All @@ -399,7 +400,20 @@ void WalletApplication::createWallet(QWidget* parent)
return;

QByteArray mnemonic = dlg.getMnemonic();
runBuiltinWalletd(fileName, true, false, QByteArray{}, std::move(mnemonic));
runBuiltinWalletd(fileName, true, false, false, QByteArray{}, std::move(mnemonic));
}

void WalletApplication::createHWWallet(QWidget *parent)
{
const QString fileName = QFileDialog::getSaveFileName(
parent,
tr("Create wallet file"),
QDir::homePath(),
tr("Wallet files (*.wallet);;All files (*)"));
if (fileName.isEmpty())
return;

runBuiltinWalletd(fileName, false, false, true, QByteArray{}, QByteArray{});
}

void WalletApplication::openWallet(QWidget* parent)
Expand All @@ -412,7 +426,7 @@ void WalletApplication::openWallet(QWidget* parent)
if (fileName.isEmpty())
return;

runBuiltinWalletd(fileName, false, false, QByteArray{}, QByteArray{});
runBuiltinWalletd(fileName, false, false, false, QByteArray{}, QByteArray{});
}

void WalletApplication::restoreWalletFromMnemonic(QWidget *parent)
Expand All @@ -430,7 +444,7 @@ void WalletApplication::restoreWalletFromMnemonic(QWidget *parent)
return;

QByteArray mnemonic = dlg.getMnemonic();
runBuiltinWalletd(fileName, false, false, QByteArray{}, std::move(mnemonic));
runBuiltinWalletd(fileName, false, false, false, QByteArray{}, std::move(mnemonic));
}

void WalletApplication::remoteWallet(QWidget* parent)
Expand Down Expand Up @@ -467,7 +481,7 @@ void WalletApplication::importKeys(QWidget* parent)
return;

QByteArray keys = dlg.getKey();
runBuiltinWalletd(fileName, false, true, std::move(keys), QByteArray{});
runBuiltinWalletd(fileName, false, true, false, std::move(keys), QByteArray{});
}

void WalletApplication::requestPassword()
Expand Down
3 changes: 2 additions & 1 deletion src/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class WalletApplication: public QApplication
void createWalletd();
void subscribeToWalletd();
void firstRun();
void runBuiltinWalletd(const QString& walletFile, bool createNew, bool createLegacy, QByteArray&& keys, QByteArray&& mnemonic);
void runBuiltinWalletd(const QString& walletFile, bool createNew, bool createLegacy, bool createHardware, QByteArray&& keys, QByteArray&& mnemonic);

signals:
void builtinRunSignal();
Expand All @@ -86,6 +86,7 @@ public slots:

void createLegacyWallet(QWidget* parent);
void createWallet(QWidget* parent);
void createHWWallet(QWidget* parent);
void openWallet(QWidget* parent);
void restoreWalletFromMnemonic(QWidget* parent);
void remoteWallet(QWidget* parent);
Expand Down
2 changes: 1 addition & 1 deletion src/bytecoin-gui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TEMPLATE = app
macx: QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11
macx: ICON = images/bytecoin.icns
win32: RC_ICONS = images/bytecoin.ico
win32: VERSION = 3.19.5.27
win32: VERSION = 3.19.5.30

#QMAKE_CXXFLAGS += -fno-omit-frame-pointer -fsanitize=address,undefined
#LIBS += -lasan -lubsan
Expand Down
5 changes: 5 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ void MainWindow::createWallet()
emit createWalletSignal(this);
}

void MainWindow::createHWWallet()
{
emit createHWWalletSignal(this);
}

void MainWindow::openWallet()
{
emit openWalletSignal(this);
Expand Down
2 changes: 2 additions & 0 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class MainWindow : public QMainWindow

Q_SLOT void createLegacyWallet();
Q_SLOT void createWallet();
Q_SLOT void createHWWallet();
Q_SLOT void openWallet();
Q_SLOT void restoreWalletFromMnemonic();
Q_SLOT void remoteWallet();
Expand All @@ -138,6 +139,7 @@ class MainWindow : public QMainWindow

void createLegacyWalletSignal(QWidget* parent);
void createWalletSignal(QWidget* parent);
void createHWWalletSignal(QWidget* parent);
void openWalletSignal(QWidget* parent);
void restoreWalletFromMnemonicSignal(QWidget* parent);
void remoteWalletSignal(QWidget* parent);
Expand Down
23 changes: 23 additions & 0 deletions src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@
<string>&amp;Wallet</string>
</property>
<addaction name="m_createNewWalletAction"/>
<addaction name="m_createHWWalletAction"/>
<addaction name="m_restoreWalletFromMnemonicAction"/>
<addaction name="m_openWalletAction"/>
<addaction name="separator"/>
Expand Down Expand Up @@ -879,6 +880,11 @@
<string>&amp;Restore Amethyst wallet from mnemonic</string>
</property>
</action>
<action name="m_createHWWalletAction">
<property name="text">
<string>Create &amp;hardware Amethyst wallet file</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
Expand Down Expand Up @@ -1282,6 +1288,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>m_createHWWalletAction</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>createHWWallet()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>636</x>
<y>411</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>aboutQt()</slot>
Expand All @@ -1303,6 +1325,7 @@
<slot>exportKeys()</slot>
<slot>createWallet()</slot>
<slot>restoreWalletFromMnemonic()</slot>
<slot>createHWWallet()</slot>
</slots>
<buttongroups>
<buttongroup name="m_toolButtonGroup">
Expand Down
4 changes: 2 additions & 2 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

namespace WalletGUI {

constexpr char VERSION[] = "3.4.3";
constexpr char VERSION[] = "3.4.4";
constexpr char CODENAME[] = "Amethyst";
constexpr char VERSION_SUFFIX[] = "stable";
constexpr char REVISION[] = "20190527";
constexpr char REVISION[] = "20190530";

// returns <0, if newVersion is worse than currentVersion, returns >0, if newVersion is better, and returns 0, if versions are equal
int compareVersion(const QString& newVersion, const QString& currentVersion);
Expand Down
12 changes: 9 additions & 3 deletions src/walletd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,15 @@ void RemoteWalletd::authRequired(QAuthenticator* authenticator)
}


BuiltinWalletd::BuiltinWalletd(const QString& pathToWallet, bool createNew, bool createLegacy, QByteArray&& keys, QByteArray&& mnemonic, QObject* parent)
BuiltinWalletd::BuiltinWalletd(const QString& pathToWallet, bool createNew, bool createLegacy, bool createHardware, QByteArray&& keys, QByteArray&& mnemonic, QObject* parent)
: RemoteWalletd(Settings::instance().getBuiltinWalletdEndPoint(), parent)
, walletd_(new QProcess(this))
, state_(State::STOPPED)
, pathToWallet_(pathToWallet)
, createNew_(createNew)
, createLegacy_(createLegacy)
, changePassword_(false)
, createHardware_(createHardware)
, keys_(std::move(keys))
, mnemonic_(std::move(mnemonic))
{
Expand Down Expand Up @@ -462,6 +463,8 @@ void BuiltinWalletd::run()
args << QString{"--wallet-file=%1"}.arg(pathToWallet_);
if (createLegacy_)
args << "--create-wallet" << "--wallet-type=legacy" << "--launch-after-command";
else if (createHardware_)
args << "--create-wallet" << "--wallet-type=hardware" << "--launch-after-command" << "--import-view-key";

const bool restoreFromMnemonic = !mnemonic_.isEmpty();
if (createNew_)
Expand Down Expand Up @@ -560,7 +563,7 @@ void BuiltinWalletd::daemonStarted()
setState(State::RUNNING);

const bool restoreFromMnemonic = !createNew_ && !mnemonic_.isEmpty();
if (createLegacy_ || createNew_ || restoreFromMnemonic)
if (createLegacy_ || createNew_ || restoreFromMnemonic || createHardware_)
emit requestPasswordWithConfirmationSignal();
else if (!changePassword_)
emit requestPasswordSignal();
Expand Down Expand Up @@ -598,14 +601,17 @@ void BuiltinWalletd::daemonStarted()
else
{
walletd_->write((password_ + '\n').toUtf8());
if (createLegacy_ || createNew_ || restoreFromMnemonic)
if (createLegacy_ || createNew_ || restoreFromMnemonic || createHardware_)
walletd_->write((password_ + '\n').toUtf8()); // write confirmation
password_.fill('0', 200);
password_.clear();
}

walletd_->write((auth_.getConcatenated() + '\n').toUtf8());

if (walletd_->isReadable() && createHardware_)
QMessageBox::information(nullptr, QObject::tr("Information"), QObject::tr("Please confirm the operation on your hardware wallet."));

emit daemonStartedSignal();
}

Expand Down
3 changes: 2 additions & 1 deletion src/walletd.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class BuiltinWalletd : public RemoteWalletd
Q_ENUM(ReturnCodes)


BuiltinWalletd(const QString& pathToWallet, bool createNew, bool createLegacy, QByteArray&& keys, QByteArray&& mnemonic, QObject* parent = nullptr);
BuiltinWalletd(const QString& pathToWallet, bool createNew, bool createLegacy, bool createHardware, QByteArray&& keys, QByteArray&& mnemonic, QObject* parent = nullptr);
virtual ~BuiltinWalletd() override;

static QString errorMessage(ReturnCodes err);
Expand Down Expand Up @@ -195,6 +195,7 @@ class BuiltinWalletd : public RemoteWalletd
bool createNew_;
bool createLegacy_;
bool changePassword_;
bool createHardware_;
QByteArray keys_;
QByteArray mnemonic_;
RandomAuth auth_;
Expand Down

0 comments on commit 85d7885

Please sign in to comment.