From 0825a884ab92dbc23c04f7d0b1807e6ca597a88c Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Mon, 4 Feb 2019 14:38:36 -0800 Subject: [PATCH 01/12] Sign binaries script --- res/SIGNATURES_README | 8 ++++++++ src/scripts/signbinaries.sh | 25 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 res/SIGNATURES_README create mode 100755 src/scripts/signbinaries.sh diff --git a/res/SIGNATURES_README b/res/SIGNATURES_README new file mode 100644 index 0000000..af94bfe --- /dev/null +++ b/res/SIGNATURES_README @@ -0,0 +1,8 @@ +This directory contains the hashes and signatures for zec-qt-wallet + +Verify the hashes by running +sha256sum -c sha256sum-vX.Y.Z.txt + +Verify signatures by runnnig +gpg --verify + diff --git a/src/scripts/signbinaries.sh b/src/scripts/signbinaries.sh new file mode 100755 index 0000000..cb6ead6 --- /dev/null +++ b/src/scripts/signbinaries.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set"; exit 1; fi + +# Store the hash and signatures here +rm -rf release/signatures +mkdir -p release/signatures + +cd artifacts +echo "[Signing Binaries]" + +# sha256sum the binaries +gsha256sum *$APP_VERSION* > ../release/signatures/sha256sum-v$APP_VERSION.txt + +for i in $( ls *zec-qt-wallet-v$APP_VERSION*); do + echo "Signing" $i + gpg --batch --output ../release/signatures/$i.sig --detach-sig $i +done + +cp ../res/SIGNATURES_README ../release/signatures/README + +cd ../release/signatures +tar -czf signatures-v$APP_VERSION.tar.gz * +cp signatures-v$APP_VERSION.tar.gz ../../artifacts + From 48336a71ea2b2f9a93cf02808415201d6b0eafee Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Mon, 4 Feb 2019 14:41:31 -0800 Subject: [PATCH 02/12] Sign binaries as part of build script --- src/scripts/dounifiedbuild.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scripts/dounifiedbuild.ps1 b/src/scripts/dounifiedbuild.ps1 index 9dc4db0..86dcf5f 100644 --- a/src/scripts/dounifiedbuild.ps1 +++ b/src/scripts/dounifiedbuild.ps1 @@ -87,3 +87,7 @@ if (! (Test-Path ./artifacts/linux-binaries-zec-qt-wallet-v$version.tar.gz) -or exit 1; } Write-Host "[OK]" + +Write-Host -NoNewline "Signing Binaries......" +APP_VERSION=$version bash src/scripts/signbinaries.sh +Write-Host "[OK]" From 8bdd9e8365bfe4fd1d8d63d41a62a0c199cdebc2 Mon Sep 17 00:00:00 2001 From: adityapk00 Date: Sat, 9 Feb 2019 20:50:36 -0800 Subject: [PATCH 03/12] #69 - Use system locale to parse amounts --- src/sendtab.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sendtab.cpp b/src/sendtab.cpp index 878e0dd..d955d42 100644 --- a/src/sendtab.cpp +++ b/src/sendtab.cpp @@ -439,6 +439,8 @@ Tx MainWindow::createTxFromSendPage() { // For each addr/amt in the sendTo tab int totalItems = ui->sendToWidgets->children().size() - 2; // The last one is a spacer, so ignore that double totalAmt = 0; + QLocale locale = QLocale::system(); + for (int i=0; i < totalItems; i++) { QString addr = ui->sendToWidgets->findChild(QString("Address") % QString::number(i+1))->text().trimmed(); // Remove label if it exists @@ -447,7 +449,7 @@ Tx MainWindow::createTxFromSendPage() { // If address is sprout, then we can't send change to sapling, because of turnstile. sendChangeToSapling = sendChangeToSapling && !Settings::getInstance()->isSproutAddress(addr); - double amt = ui->sendToWidgets->findChild(QString("Amount") % QString::number(i+1))->text().trimmed().toDouble(); + double amt = locale.toDouble(ui->sendToWidgets->findChild(QString("Amount") % QString::number(i+1))->text().trimmed()); totalAmt += amt; QString memo = ui->sendToWidgets->findChild(QString("MemoTxt") % QString::number(i+1))->text().trimmed(); @@ -455,7 +457,7 @@ Tx MainWindow::createTxFromSendPage() { } if (Settings::getInstance()->getAllowCustomFees()) { - tx.fee = ui->minerFeeAmt->text().toDouble(); + tx.fee = locale.toDouble(ui->minerFeeAmt->text()); } else { tx.fee = Settings::getMinerFee(); From 17acec73917bedab4d991df269e20bc5a379e42a Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Thu, 14 Feb 2019 12:35:11 -0800 Subject: [PATCH 04/12] #101 - Refresh after address book to update labels everywhere. --- src/addressbook.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/addressbook.cpp b/src/addressbook.cpp index c839b18..762bea6 100644 --- a/src/addressbook.cpp +++ b/src/addressbook.cpp @@ -3,6 +3,7 @@ #include "ui_mainwindow.h" #include "settings.h" #include "mainwindow.h" +#include "rpc.h" AddressBookModel::AddressBookModel(QTableView *parent) @@ -221,6 +222,9 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target) { fnSetTargetLabelAddr(target, item.first, item.second); } }; + + // Refresh after the dialog is closed to update the labels everywhere. + parent->getRPC()->refresh(true); } //============= From ea56942ba956ea2e462c5f0f4f9904e2f734fa36 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Fri, 15 Feb 2019 06:56:23 -0800 Subject: [PATCH 05/12] Revert "#69 - Use system locale to parse amounts" This reverts commit 8bdd9e8365bfe4fd1d8d63d41a62a0c199cdebc2. --- src/sendtab.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sendtab.cpp b/src/sendtab.cpp index d955d42..878e0dd 100644 --- a/src/sendtab.cpp +++ b/src/sendtab.cpp @@ -439,8 +439,6 @@ Tx MainWindow::createTxFromSendPage() { // For each addr/amt in the sendTo tab int totalItems = ui->sendToWidgets->children().size() - 2; // The last one is a spacer, so ignore that double totalAmt = 0; - QLocale locale = QLocale::system(); - for (int i=0; i < totalItems; i++) { QString addr = ui->sendToWidgets->findChild(QString("Address") % QString::number(i+1))->text().trimmed(); // Remove label if it exists @@ -449,7 +447,7 @@ Tx MainWindow::createTxFromSendPage() { // If address is sprout, then we can't send change to sapling, because of turnstile. sendChangeToSapling = sendChangeToSapling && !Settings::getInstance()->isSproutAddress(addr); - double amt = locale.toDouble(ui->sendToWidgets->findChild(QString("Amount") % QString::number(i+1))->text().trimmed()); + double amt = ui->sendToWidgets->findChild(QString("Amount") % QString::number(i+1))->text().trimmed().toDouble(); totalAmt += amt; QString memo = ui->sendToWidgets->findChild(QString("MemoTxt") % QString::number(i+1))->text().trimmed(); @@ -457,7 +455,7 @@ Tx MainWindow::createTxFromSendPage() { } if (Settings::getInstance()->getAllowCustomFees()) { - tx.fee = locale.toDouble(ui->minerFeeAmt->text()); + tx.fee = ui->minerFeeAmt->text().toDouble(); } else { tx.fee = Settings::getMinerFee(); From fcf5f4868c4bcdb7f87144c918a9a8ee0b1324c6 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Tue, 19 Feb 2019 14:37:31 -0800 Subject: [PATCH 06/12] #108 - Give zec-qt-wallet its own StartupWMClass --- src/scripts/desktopentry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/desktopentry b/src/scripts/desktopentry index a15092f..9925369 100644 --- a/src/scripts/desktopentry +++ b/src/scripts/desktopentry @@ -6,7 +6,7 @@ Exec=/usr/local/bin/zec-qt-wallet Icon=zec-qt-wallet.xpm Type=Application StartupNotify=true -StartupWMClass=Code +StartupWMClass=zecqtwallet Categories=Utility; MimeType=text/plain;inode/directory; Keywords=zec-qt-wallet; From 38986edfdefa96c4c37b0668e03f8e2f86c95747 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Tue, 19 Feb 2019 14:45:44 -0800 Subject: [PATCH 07/12] #103 - Allow only "." (dot) for decimal separators --- src/sendtab.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/sendtab.cpp b/src/sendtab.cpp index 878e0dd..a91e800 100644 --- a/src/sendtab.cpp +++ b/src/sendtab.cpp @@ -12,8 +12,7 @@ using json = nlohmann::json; void MainWindow::setupSendTab() { // Create the validator for send to/amount fields - auto amtValidator = new QDoubleValidator(0, 21000000, 8, ui->Amount1); - amtValidator->setNotation(QDoubleValidator::StandardNotation); + auto amtValidator = new QRegExpValidator(QRegExp("[0-9]{0,8}\\.?[0-9]{0,8}")); ui->Amount1->setValidator(amtValidator); // Send button @@ -74,8 +73,7 @@ void MainWindow::setupSendTab() { } }); //Fees validator - auto feesValidator = new QDoubleValidator(0, 1, 8, ui->Amount1); - feesValidator->setNotation(QDoubleValidator::StandardNotation); + auto feesValidator = new QRegExpValidator(QRegExp("[0-9]{0,8}\\.?[0-9]{0,8}")); ui->minerFeeAmt->setValidator(feesValidator); // Font for the first Memo label @@ -219,8 +217,9 @@ void MainWindow::addAddressSection() { Amount1->setPlaceholderText(tr("Amount")); Amount1->setObjectName(QString("Amount") % QString::number(itemNumber)); Amount1->setBaseSize(QSize(200, 0)); + Amount1->setAlignment(Qt::AlignRight); // Create the validator for send to/amount fields - auto amtValidator = new QDoubleValidator(0, 21000000, 8, Amount1); + auto amtValidator = new QRegExpValidator(QRegExp("[0-9]{0,8}\\.?[0-9]{0,8}")); Amount1->setValidator(amtValidator); QObject::connect(Amount1, &QLineEdit::textChanged, [=] (auto text) { this->amountChanged(itemNumber, text); From 9660a9db657610f7146700efff7175f8cc3850c1 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Tue, 19 Feb 2019 14:56:26 -0800 Subject: [PATCH 08/12] #106 - Add public key, verification procedure --- public_key.asc | 52 +++++++++++++++++++++++++++++++++++++++++++ res/SIGNATURES_README | 11 ++++++--- 2 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 public_key.asc diff --git a/public_key.asc b/public_key.asc new file mode 100644 index 0000000..cda4e1b --- /dev/null +++ b/public_key.asc @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBFxYtBoBEACfLqL2YB0pMFk7X7ILBYfakxWnTd8CKCp2EhfSj4cRDFSD5ODj +TfkRTb7Jj7zL3LkGfA5R6ZnK4994JojVfkrDWWZfaZG6Us0cZEwqPiDYli0gc7GG +KMudAorHI6ud/dQzsglJf3mcZ+7GYtrwG69QLM6Zp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AAgFiEEwjFy0MlW +lZHs7I7LDh6QJ5Uh67QFAlxYtBoCGwwACgkQDh6QJ5Uh67SF0g/9H6oDmk/J1FS4 +MQwlkY0Iuzu8BtcY0DZaOxK+cw4lu24/hy1T+RKvN8UIklx9ujixhOxJ9759ujkH +sWf9X5wVxXMSDGV8E7C+QapbuXDpmXtbQFHBfb3OulJHV+mn33MdYidq1rJPMvyZ +/aVg+WW8BOcTanDlM5mSoGIYAzV4m82RKLyIgewrYHgnvJDoE8AtOVZVqvQ20+XK +0LXPPCYeJbf3+GW+uOwC+LOnYQCFaUbaGjbJ16W9kK7+Dhb0o3v8CvEOxYc6w+5G +6sFHlZBRBssro/7Y2E10Xk+XqQbutF4jrej0Cs6ZoSDAoWpQfHL7JQGxKsE+T1R6 +ywnQ20/+J18vciV5eOjHi/c0r9DVm4BS0bZBvXk6RVhIt25VDgiv+IHBsDmB+hqE +Y5rVr4jKeCeRITCMX9KmKF18cl4BEtvgycgm3UicIB9uKHuCwxFXJU2v2zaD8vuW +LhdK8sSFOQkc6Yc9XtwUWpZkCdE+M8oFpb8W1uGQAriqa0JL0oQJnD/O9clRojhd +WKBY7r1i1sQRoFuvj5J4aoFPFoI0abp5nLkWnjm1noMqtwZt89WsTBZjEMT+/AsM +VXWIG1yDezS1FzxCa6NGO+Xyp1GSVZvSrIaJ+B53n/eCYJgoQNZUa4Y2krvax8Ag +8/k3fH5u794KFQQ3WbeHVoJ4mXI4RsQ= +=lY99 +-----END PGP PUBLIC KEY BLOCK----- diff --git a/res/SIGNATURES_README b/res/SIGNATURES_README index af94bfe..4891f05 100644 --- a/res/SIGNATURES_README +++ b/res/SIGNATURES_README @@ -1,8 +1,13 @@ This directory contains the hashes and signatures for zec-qt-wallet -Verify the hashes by running +Verify the hashes by running: sha256sum -c sha256sum-vX.Y.Z.txt -Verify signatures by runnnig -gpg --verify +Verify signatures: +1. First, import the public key (Available on github + at https://github.com/ZcashFoundation/zec-qt-wallet/blob/master/public_key.asc) +gpg --import public_key.asc + +2. Verify signature +gpg --verify From c0e950612d063f1a701e7fa70c56f66c844ba0ec Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Tue, 19 Feb 2019 15:06:51 -0800 Subject: [PATCH 09/12] #102 - Show import dialog first --- src/mainwindow.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4e71390..c064191 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -648,10 +648,6 @@ void MainWindow::doImport(QList* keys) { if (keys->isEmpty()) { delete keys; - - QMessageBox::information(this, - "Imported", tr("The keys were imported. It may take several minutes to rescan the blockchain. Until then, functionality may be limited"), - QMessageBox::Ok); ui->statusBar->showMessage(tr("Private key import rescan finished")); return; } @@ -784,7 +780,12 @@ void MainWindow::importPrivKey() { }); // Start the import. The function takes ownership of keys - doImport(keys); + QTimer::singleShot(1, [=]() {doImport(keys);}); + + // Show the dialog that keys will be imported. + QMessageBox::information(this, + "Imported", tr("The keys were imported. It may take several minutes to rescan the blockchain. Until then, functionality may be limited"), + QMessageBox::Ok); } } From 15cadb3a00c8e613543b99eee392fee7ed0f169e Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Tue, 19 Feb 2019 15:07:07 -0800 Subject: [PATCH 10/12] #106 sign hashes --- src/scripts/signbinaries.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/signbinaries.sh b/src/scripts/signbinaries.sh index cb6ead6..313bf97 100755 --- a/src/scripts/signbinaries.sh +++ b/src/scripts/signbinaries.sh @@ -12,7 +12,7 @@ echo "[Signing Binaries]" # sha256sum the binaries gsha256sum *$APP_VERSION* > ../release/signatures/sha256sum-v$APP_VERSION.txt -for i in $( ls *zec-qt-wallet-v$APP_VERSION*); do +for i in $( ls *zec-qt-wallet-v$APP_VERSION* sha256sum-v$APP_VERSION* ); do echo "Signing" $i gpg --batch --output ../release/signatures/$i.sig --detach-sig $i done From 115abcb871d3b382156bd49887c841d9579e6bbe Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Tue, 19 Feb 2019 15:31:08 -0800 Subject: [PATCH 11/12] 0.5.10 --- README.md | 6 +++--- src/scripts/dounifiedbuild.ps1 | 6 ++++-- src/scripts/signbinaries.sh | 23 ++++++++++++++++++++++- src/version.h | 2 +- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7697c85..28b2b4a 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,14 @@ Head over to the releases page and grab the latest installers or binary. https:/ If you are on Debian/Ubuntu, please download the `.deb` package and install it. ``` -sudo dpkg -i linux-deb-zec-qt-wallet-v0.5.9.deb +sudo dpkg -i linux-deb-zec-qt-wallet-v0.5.10.deb sudo apt install -f ``` Or you can download and run the binaries directly. ``` -tar -xvf zec-qt-wallet-v0.5.9.tar.gz -./zec-qt-wallet-v0.5.9/zec-qt-wallet +tar -xvf zec-qt-wallet-v0.5.10.tar.gz +./zec-qt-wallet-v0.5.10/zec-qt-wallet ``` ### Windows diff --git a/src/scripts/dounifiedbuild.ps1 b/src/scripts/dounifiedbuild.ps1 index 86dcf5f..e35066f 100644 --- a/src/scripts/dounifiedbuild.ps1 +++ b/src/scripts/dounifiedbuild.ps1 @@ -61,7 +61,9 @@ ssh $winserver "New-Item zqwbuild -itemtype directory" | Out-Null # Same while copying the built msi. A straight scp pull from windows to here doesn't work, # so we ssh to windows, and then scp push the file to here. $myhostname = (hostname) | Out-String -NoNewline -Remove-Item -Path /tmp/zqwbuild -Recurse -ErrorAction Ignore | Out-Null +# Powershell seems not to be able to remove this directory for some reason! +# Remove-Item -Path /tmp/zqwbuild -Recurse -ErrorAction Ignore | Out-Null +bash "rm -rf /tmp/zqwbuild" 2>&1 | Out-Null New-Item -Path /tmp/zqwbuild -itemtype directory | Out-Null Copy-Item src /tmp/zqwbuild/ -Recurse Copy-Item res /tmp/zqwbuild/ -Recurse @@ -89,5 +91,5 @@ if (! (Test-Path ./artifacts/linux-binaries-zec-qt-wallet-v$version.tar.gz) -or Write-Host "[OK]" Write-Host -NoNewline "Signing Binaries......" -APP_VERSION=$version bash src/scripts/signbinaries.sh +bash src/scripts/signbinaries.sh --version $version Write-Host "[OK]" diff --git a/src/scripts/signbinaries.sh b/src/scripts/signbinaries.sh index 313bf97..52c1409 100755 --- a/src/scripts/signbinaries.sh +++ b/src/scripts/signbinaries.sh @@ -1,5 +1,25 @@ #!/bin/bash +# Accept the variables as command line arguments as well +POSITIONAL=() +while [[ $# -gt 0 ]] +do +key="$1" + +case $key in + -v|--version) + APP_VERSION="$2" + shift # past argument + shift # past value + ;; + *) # unknown option + POSITIONAL+=("$1") # save it in an array for later + shift # past argument + ;; +esac +done +set -- "${POSITIONAL[@]}" # restore positional parameters + if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set"; exit 1; fi # Store the hash and signatures here @@ -10,13 +30,14 @@ cd artifacts echo "[Signing Binaries]" # sha256sum the binaries -gsha256sum *$APP_VERSION* > ../release/signatures/sha256sum-v$APP_VERSION.txt +gsha256sum *$APP_VERSION* > sha256sum-v$APP_VERSION.txt for i in $( ls *zec-qt-wallet-v$APP_VERSION* sha256sum-v$APP_VERSION* ); do echo "Signing" $i gpg --batch --output ../release/signatures/$i.sig --detach-sig $i done +mv sha256sum-v$APP_VERSION.txt ../release/signatures/ cp ../res/SIGNATURES_README ../release/signatures/README cd ../release/signatures diff --git a/src/version.h b/src/version.h index e6d4b6a..1a592b7 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define APP_VERSION "0.5.9" +#define APP_VERSION "0.5.10" From c8218ae5bd1a882d9929368593bbdcd906cff010 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Tue, 19 Feb 2019 16:13:48 -0800 Subject: [PATCH 12/12] sign properly --- src/scripts/signbinaries.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/scripts/signbinaries.sh b/src/scripts/signbinaries.sh index 52c1409..337b33d 100755 --- a/src/scripts/signbinaries.sh +++ b/src/scripts/signbinaries.sh @@ -29,6 +29,10 @@ mkdir -p release/signatures cd artifacts echo "[Signing Binaries]" +# Remove previous signatures/hashes +rm -f sha256sum-v$APP_VERSION.txt +rm -f signatures-v$APP_VERSION.tar.gz + # sha256sum the binaries gsha256sum *$APP_VERSION* > sha256sum-v$APP_VERSION.txt @@ -42,5 +46,5 @@ cp ../res/SIGNATURES_README ../release/signatures/README cd ../release/signatures tar -czf signatures-v$APP_VERSION.tar.gz * -cp signatures-v$APP_VERSION.tar.gz ../../artifacts +mv signatures-v$APP_VERSION.tar.gz ../../artifacts