From e4eab6380161d10e8970c8df337380fdf265604d Mon Sep 17 00:00:00 2001 From: Jayson Jacobs Date: Mon, 23 Dec 2019 17:36:03 -0700 Subject: [PATCH] cosmetic updates --- src/recurring.cpp | 96 +++++++++++++++++++++++------------------------ src/settings.cpp | 44 +++++++++++----------- src/turnstile.cpp | 66 ++++++++++++++++---------------- src/version.h | 2 +- 4 files changed, 104 insertions(+), 104 deletions(-) diff --git a/src/recurring.cpp b/src/recurring.cpp index e5009f67..2f320675 100644 --- a/src/recurring.cpp +++ b/src/recurring.cpp @@ -49,7 +49,7 @@ RecurringPaymentInfo RecurringPaymentInfo::fromJson(QJsonObject j) { QString RecurringPaymentInfo::getHash() const { auto val = getScheduleDescription() + fromAddr + toAddr; - return QString(QCryptographicHash::hash(val.toUtf8(), + return QString(QCryptographicHash::hash(val.toUtf8(), QCryptographicHash::Sha256).toHex()); } @@ -100,11 +100,11 @@ QDateTime RecurringPaymentInfo::getNextPayment() const { } return QDateTime::fromSecsSinceEpoch(0); -} +} /** * Counts the number of payments that haven't been started yet - */ + */ int RecurringPaymentInfo::getNumPendingPayments() const { int count = 0; for (auto item : payments) { @@ -116,7 +116,7 @@ int RecurringPaymentInfo::getNumPendingPayments() const { return count; } -// Returns a new Recurring payment info, created from the Tx. +// Returns a new Recurring payment info, created from the Tx. // The caller needs to take ownership of the returned object. RecurringPaymentInfo* Recurring::getNewRecurringFromTx(QWidget* parent, MainWindow*, Tx tx, RecurringPaymentInfo* rpi) { Ui_newRecurringDialog ui; @@ -171,24 +171,24 @@ RecurringPaymentInfo* Recurring::getNewRecurringFromTx(QWidget* parent, MainWind ui.txtDesc->setText(rpi->desc); ui.lblTo->setText(rpi->toAddr); ui.txtMemo->setPlainText(rpi->memo); - + ui.cmbCurrency->setCurrentText(rpi->currency); - ui.lblAmt->setText(rpi->getAmountPretty()); + ui.lblAmt->setText(rpi->getAmountPretty()); ui.lblFrom->setText(rpi->fromAddr); ui.txtNumPayments->setText(QString::number(rpi->payments.size())); ui.cmbSchedule->setCurrentIndex(rpi->schedule - 1); // indexes start from 0 } - + ui.txtDesc->setFocus(); if (d.exec() == QDialog::Accepted) { // Construct a new Object and return it auto numPayments = ui.txtNumPayments->text().toInt(); auto r = new RecurringPaymentInfo(numPayments); r->desc = ui.txtDesc->text(); - r->currency = ui.cmbCurrency->currentText(); + r->currency = ui.cmbCurrency->currentText(); r->schedule = (Schedule)ui.cmbSchedule->currentData().toInt(); r->startDate = QDateTime::currentDateTime(); - + updateInfoWithTx(r, tx); return r; } @@ -225,7 +225,7 @@ void Recurring::updateInfoWithTx(RecurringPaymentInfo* r, Tx tx) { /** * Given a schedule and an optional previous date, calculate the next payment date/ * If there is no previous date, it is assumed to be the current DateTime - */ + */ QDateTime Recurring::getNextPaymentDate(Schedule s, QDateTime start) { QDateTime nextDate = start; @@ -260,9 +260,9 @@ void Recurring::addRecurringInfo(const RecurringPaymentInfo& rpi) { if (payments.contains(rpi.getHash())) { payments.remove(rpi.getHash()); } - + payments.insert(rpi.getHash(), rpi); - + writeToStorage(); } @@ -271,9 +271,9 @@ void Recurring::removeRecurringInfo(QString hash) { qDebug() << "Hash not found:" << hash << " in " << payments.keys(); return; } - + payments.remove(hash); - + writeToStorage(); } @@ -303,7 +303,7 @@ void Recurring::writeToStorage() { arr.append(v.toJson()); } - QTextStream out(&file); + QTextStream out(&file); out << QJsonDocument(arr).toJson(); file.close(); @@ -313,7 +313,7 @@ void Recurring::writeToStorage() { * Lookup the recurring payment info with the given hash, and update * a payment made **/ -bool Recurring::updatePaymentItem(QString hash, int paymentNumber, +bool Recurring::updatePaymentItem(QString hash, int paymentNumber, QString txid, QString err, PaymentStatus status) { if (!payments.contains(hash)) { return false; @@ -334,12 +334,12 @@ bool Recurring::updatePaymentItem(QString hash, int paymentNumber, } Recurring* Recurring::getInstance() { - if (!instance) { - instance = new Recurring(); + if (!instance) { + instance = new Recurring(); instance->readFromStorage(); - } - - return instance; + } + + return instance; } // Singleton @@ -362,7 +362,7 @@ void Recurring::processPending(MainWindow* main) { QList pending; for (auto pi: rpi.payments) { - if (pi.status == PaymentStatus::NOT_STARTED && + if (pi.status == PaymentStatus::NOT_STARTED && pi.date <= QDateTime::currentDateTime()) { pending.append(pi); } @@ -385,7 +385,7 @@ void Recurring::processPending(MainWindow* main) { /** * Called when a particular RecurringPaymentInfo has more than one pending payment to be processed. * We will ask the user what he wants to do. - */ + */ void Recurring::processMultiplePending(RecurringPaymentInfo rpi, MainWindow* main) { Ui_RecurringPending ui; QDialog d(main); @@ -399,7 +399,7 @@ void Recurring::processMultiplePending(RecurringPaymentInfo rpi, MainWindow* mai // Mark all the outstanding ones as pending, so it shows in the table correctly. for (auto& pi: rpi.payments) { - if (pi.status == PaymentStatus::NOT_STARTED && + if (pi.status == PaymentStatus::NOT_STARTED && pi.date <= QDateTime::currentDateTime()) { pi.status = PaymentStatus::PENDING; } @@ -455,7 +455,7 @@ void Recurring::processMultiplePending(RecurringPaymentInfo rpi, MainWindow* mai } // Save the table column layout - s.setValue("recurringmultipaymentstablevgeom", ui.tblPending->horizontalHeader()->saveState()); + s.setValue("recurringmultipaymentstablevgeom", ui.tblPending->horizontalHeader()->saveState()); } void Recurring::executeRecurringPayment(MainWindow* main, RecurringPaymentInfo rpi, QList paymentNumbers) { @@ -465,13 +465,13 @@ void Recurring::executeRecurringPayment(MainWindow* main, RecurringPaymentInfo r // If there is no price, then fail the payment if (Settings::getInstance()->getZECPrice() == 0) { for (auto paymentNumber: paymentNumbers) { - updatePaymentItem(rpi.getHash(), paymentNumber, + updatePaymentItem(rpi.getHash(), paymentNumber, "", QObject::tr("No ARW price was available to convert from USD"), PaymentStatus::ERROR); } return; } - + // Translate it into ARW amt = rpi.amt / Settings::getInstance()->getZECPrice(); } @@ -480,7 +480,7 @@ void Recurring::executeRecurringPayment(MainWindow* main, RecurringPaymentInfo r Tx tx; tx.fromAddr = rpi.fromAddr; tx.fee = Settings::getMinerFee(); - + // If this is a multiple payment, we'll add up all the amounts if (paymentNumbers.size() > 1) amt *= paymentNumbers.size(); @@ -488,11 +488,11 @@ void Recurring::executeRecurringPayment(MainWindow* main, RecurringPaymentInfo r tx.toAddrs.append(ToFields { rpi.toAddr, amt, rpi.memo, rpi.memo.toUtf8().toHex() }); // To prevent some weird race conditions, we immediately mark the payment as paid. - // If something goes wrong, we'll get the error callback below, and the status will be + // If something goes wrong, we'll get the error callback below, and the status will be // updated. If it succeeds, we'll once again update the status with the txid for (int paymentNumber: paymentNumbers) { updatePaymentItem(rpi.getHash(), paymentNumber, "", "", PaymentStatus::COMPLETED); - } + } // Send it off to the RPC doSendTx(main, tx, [=] (QString txid, QString err) { @@ -500,7 +500,7 @@ void Recurring::executeRecurringPayment(MainWindow* main, RecurringPaymentInfo r // Success, update the rpi for (int paymentNumber: paymentNumbers) { updatePaymentItem(rpi.getHash(), paymentNumber, txid, "", PaymentStatus::COMPLETED); - } + } } else { // Errored out. Bummer. for (int paymentNumber: paymentNumbers) { @@ -512,12 +512,12 @@ void Recurring::executeRecurringPayment(MainWindow* main, RecurringPaymentInfo r /** * Execute a send Tx - */ + */ void Recurring::doSendTx(MainWindow* mainwindow, Tx tx, std::function cb) { mainwindow->getRPC()->executeTransaction(tx, [=] (QString opid) { mainwindow->ui->statusBar->showMessage(QObject::tr("Computing Recurring Tx: ") % opid); }, - [=] (QString /*opid*/, QString txid) { + [=] (QString /*opid*/, QString txid) { mainwindow->ui->statusBar->showMessage(Settings::txidStatusMessage + " " + txid); cb(txid, ""); }, @@ -525,12 +525,12 @@ void Recurring::doSendTx(MainWindow* mainwindow, Tx tx, std::functionui->statusBar->showMessage(QObject::tr(" Tx ") % opid % QObject::tr(" failed"), 15 * 1000); cb("", errStr); }); - + } /** * Show the list of configured recurring payments - */ + */ void Recurring::showRecurringDialog(MainWindow* parent) { // Make sure only 1 is showing at a time static bool isDialogOpen = false; @@ -540,7 +540,7 @@ void Recurring::showRecurringDialog(MainWindow* parent) { Ui_RecurringDialog rd; QDialog d(parent); - + rd.setupUi(&d); Settings::saveRestore(&d); @@ -577,7 +577,7 @@ void Recurring::showRecurringDialog(MainWindow* parent) { if (Settings::getInstance()->isTestnet()) { url = "https://explorer.testnet.z.cash/tx/" + txid; } else { - url = "https://explorer.zcha.in/transactions/" + txid; + url = "https://explorer.arrowchain.io/#/tx/" + txid; } QDesktopServices::openUrl(QUrl(url)); }); @@ -596,11 +596,11 @@ void Recurring::showRecurringDialog(MainWindow* parent) { // Restore the table column layout QSettings s; p.tableView->horizontalHeader()->restoreState(s.value("recurringpaymentstablevgeom").toByteArray()); - + pd.exec(); // Save the table column layout - s.setValue("recurringpaymentstablevgeom", p.tableView->horizontalHeader()->saveState()); + s.setValue("recurringpaymentstablevgeom", p.tableView->horizontalHeader()->saveState()); }; // View Button @@ -608,14 +608,14 @@ void Recurring::showRecurringDialog(MainWindow* parent) { auto selectedRows = rd.tableView->selectionModel()->selectedRows(); if (selectedRows.size() == 1) { auto rpi = Recurring::getInstance()->getAsList()[selectedRows[0].row()]; - showPayments(rpi); + showPayments(rpi); } }); // Double Click QObject::connect(rd.tableView, &QTableView::doubleClicked, [=] (auto index) { auto rpi = Recurring::getInstance()->getAsList()[index.row()]; - showPayments(rpi); + showPayments(rpi); }); // Delete button @@ -623,8 +623,8 @@ void Recurring::showRecurringDialog(MainWindow* parent) { auto selectedRows = rd.tableView->selectionModel()->selectedRows(); if (selectedRows.size() == 1) { auto rpi = Recurring::getInstance()->getAsList()[selectedRows[0].row()]; - if (QMessageBox::warning(&d, QObject::tr("Are you sure you want to delete the recurring payment?"), - QObject::tr("Are you sure you want to delete the recurring payment?") + "\n" + + if (QMessageBox::warning(&d, QObject::tr("Are you sure you want to delete the recurring payment?"), + QObject::tr("Are you sure you want to delete the recurring payment?") + "\n" + QObject::tr("All future payments will be cancelled."), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { Recurring::getInstance()->removeRecurringInfo(rpi.getHash()); @@ -644,10 +644,10 @@ void Recurring::showRecurringDialog(MainWindow* parent) { /** * Model for List of recurring payments - */ + */ RecurringListViewModel::RecurringListViewModel(QTableView* parent) { this->parent = parent; - headers << tr("Amount") << tr("Schedule") << tr("Payments Left") + headers << tr("Amount") << tr("Schedule") << tr("Payments Left") << tr("Next Payment") << tr("To"); } @@ -667,11 +667,11 @@ QVariant RecurringListViewModel::data(const QModelIndex &index, int role) const case 0: return rpi.getAmountPretty(); case 1: return tr("Every ") + schedule_desc(rpi.schedule); case 2: return QString::number(rpi.getNumPendingPayments()) + " of " + QString::number(rpi.payments.size()); - case 3: { + case 3: { auto n = rpi.getNextPayment(); if (n.toSecsSinceEpoch() == 0) return tr("None"); else return n; } - case 4: return rpi.toAddr; + case 4: return rpi.toAddr; } } @@ -749,4 +749,4 @@ QVariant RecurringPaymentsListViewModel::headerData(int section, Qt::Orientation } return QVariant(); -} +} diff --git a/src/settings.cpp b/src/settings.cpp index a7292afe..21390824 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -3,8 +3,8 @@ Settings* Settings::instance = nullptr; -Settings* Settings::init() { - if (instance == nullptr) +Settings* Settings::init() { + if (instance == nullptr) instance = new Settings(); return instance; @@ -15,13 +15,13 @@ Settings* Settings::getInstance() { } Config Settings::getSettings() { - // Load from the QT Settings. + // Load from the QT Settings. QSettings s; - + auto host = s.value("connection/host").toString(); auto port = s.value("connection/port").toString(); auto username = s.value("connection/rpcuser").toString(); - auto password = s.value("connection/rpcpassword").toString(); + auto password = s.value("connection/rpcpassword").toString(); return Config{host, port, username, password}; } @@ -64,21 +64,21 @@ bool Settings::isSaplingAddress(QString addr) { bool Settings::isSproutAddress(QString addr) { if (!isValidAddress(addr)) return false; - + return isZAddress(addr) && !isSaplingAddress(addr); } bool Settings::isZAddress(QString addr) { if (!isValidAddress(addr)) return false; - + return addr.startsWith("as"); } bool Settings::isTAddress(QString addr) { if (!isValidAddress(addr)) return false; - + return addr.startsWith("ar"); } @@ -111,8 +111,8 @@ bool Settings::isSaplingActive() { (!isTestnet() && getBlockNumber() > 419200); } -double Settings::getZECPrice() { - return zecPrice; +double Settings::getZECPrice() { + return zecPrice; } bool Settings::getAutoShield() { @@ -125,7 +125,7 @@ void Settings::setAutoShield(bool allow) { } bool Settings::getAllowCustomFees() { - // Load from the QT Settings. + // Load from the QT Settings. return QSettings().value("options/customfees", false).toBool(); } @@ -134,7 +134,7 @@ void Settings::setAllowCustomFees(bool allow) { } bool Settings::getSaveZtxs() { - // Load from the QT Settings. + // Load from the QT Settings. return QSettings().value("options/savesenttx", true).toBool(); } @@ -165,7 +165,7 @@ void Settings::openAddressInExplorer(QString address) { if (Settings::getInstance()->isTestnet()) { url = "https://explorer.testnet.z.cash/address/" + address; } else { - url = "https://explorer.zcha.in/accounts/" + address; + url = "https://explorer.arrowchain.io/#/address/" + address; } QDesktopServices::openUrl(QUrl(url)); } @@ -176,7 +176,7 @@ void Settings::openTxInExplorer(QString txid) { url = "https://explorer.testnet.z.cash/tx/" + txid; } else { - url = "https://explorer.zcha.in/transactions/" + txid; + url = "https://explorer.arrowchain.io/#/tx/" + txid; } QDesktopServices::openUrl(QUrl(url)); } @@ -237,7 +237,7 @@ bool Settings::addToZcashConf(QString confLocation, QString line) { QFile file(confLocation); if (!file.open(QIODevice::ReadWrite | QIODevice::Append)) return false; - + QTextStream out(&file); out << line << "\n"; @@ -252,9 +252,9 @@ bool Settings::removeFromZcashConf(QString confLocation, QString option) { // To remove an option, we'll create a new file, and copy over everything but the option. QFile file(confLocation); - if (!file.open(QIODevice::ReadOnly)) + if (!file.open(QIODevice::ReadOnly)) return false; - + QList lines; QTextStream in(&file); while (!in.atEnd()) { @@ -264,9 +264,9 @@ bool Settings::removeFromZcashConf(QString confLocation, QString option) { if (name != option) { lines.append(line); } - } + } file.close(); - + QFile newfile(confLocation); if (!newfile.open(QIODevice::ReadWrite | QIODevice::Truncate)) return false; @@ -304,13 +304,13 @@ bool Settings::isValidAddress(QString addr) { QRegExp ztsexp("^ztestsapling[a-z0-9]{76}", Qt::CaseInsensitive); QRegExp texp("^a[a-z0-9]{34}$", Qt::CaseInsensitive); - return zcexp.exactMatch(addr) || texp.exactMatch(addr) || + return zcexp.exactMatch(addr) || texp.exactMatch(addr) || ztsexp.exactMatch(addr) || zsexp.exactMatch(addr); } // Get a pretty string representation of this Payment URI QString Settings::paymentURIPretty(PaymentURI uri) { - return QString() + "Payment Request\n" + "Pay: " + uri.addr + "\nAmount: " + getZECDisplayFormat(uri.amt.toDouble()) + return QString() + "Payment Request\n" + "Pay: " + uri.addr + "\nAmount: " + getZECDisplayFormat(uri.amt.toDouble()) + "\nMemo:" + QUrl::fromPercentEncoding(uri.memo.toUtf8()); } @@ -324,7 +324,7 @@ PaymentURI Settings::parseURI(QString uri) { } uri = uri.right(uri.length() - QString("arrow:").length()); - + QRegExp re("([a-zA-Z0-9]+)"); int pos; if ( (pos = re.indexIn(uri)) == -1 ) { diff --git a/src/turnstile.cpp b/src/turnstile.cpp index f7625dc7..e2f2f97a 100644 --- a/src/turnstile.cpp +++ b/src/turnstile.cpp @@ -16,7 +16,7 @@ Turnstile::Turnstile(RPC* _rpc, MainWindow* mainwindow) { void printPlan(QList plan) { for (auto item : plan) { - //qDebug() << item.fromAddr << item.intTAddr + //qDebug() << item.fromAddr << item.intTAddr // << item.destAddr << item.amount << item.blockNumber << item.status; } } @@ -41,13 +41,13 @@ void Turnstile::removeFile() { // Data stream write/read methods for migration items QDataStream &operator<<(QDataStream& ds, const TurnstileMigrationItem& item) { - return ds << QString("v1") << item.fromAddr << item.intTAddr + return ds << QString("v1") << item.fromAddr << item.intTAddr << item.destAddr << item.amount << item.blockNumber << item.status; } QDataStream &operator>>(QDataStream& ds, TurnstileMigrationItem& item) { QString version; - return ds >> version >> item.fromAddr >> item.intTAddr + return ds >> version >> item.fromAddr >> item.intTAddr >> item.destAddr >> item.amount >> item.blockNumber >> item.status; } @@ -64,20 +64,20 @@ void Turnstile::writeMigrationPlan(QList plan) { QList Turnstile::readMigrationPlan() { QFile file(writeableFile()); - + QList plan; if (!file.exists()) return plan; file.open(QIODevice::ReadOnly); QDataStream in(&file); // read the data serialized from the file - in >> plan; + in >> plan; file.close(); // Sort to see when the next step is. std::sort(plan.begin(), plan.end(), [&] (auto a, auto b) { return a.blockNumber < b.blockNumber; - }); + }); return plan; } @@ -104,21 +104,21 @@ void Turnstile::planMigration(QString zaddr, QString destAddr, int numsplits, in // Assign the amounts to the addresses. QList migItems; - + for (int i=0; i < splits.size(); i++) { auto tAddr = newAddrs->values()[i].get(); auto item = TurnstileMigrationItem { zaddr, QString::fromStdString(tAddr), destAddr, - blockNumbers[i], splits[i], + blockNumbers[i], splits[i], TurnstileMigrationItemStatus::NotStarted }; migItems.push_back(item); } - // The first migration is shifted to the current block, so the user sees something + // The first migration is shifted to the current block, so the user sees something // happening immediately if (migItems.empty()) { // Show error and abort - QMessageBox::warning(mainwindow, - QObject::tr("Locked funds"), + QMessageBox::warning(mainwindow, + QObject::tr("Locked funds"), QObject::tr("Could not initiate migration.\nYou either have unconfirmed funds or the balance is too low for an automatic migration.")); return; } @@ -127,7 +127,7 @@ void Turnstile::planMigration(QString zaddr, QString destAddr, int numsplits, in std::sort(migItems.begin(), migItems.end(), [&] (auto a, auto b) { return a.blockNumber < b.blockNumber; - }); + }); writeMigrationPlan(migItems); rpc->refresh(true); // Force refresh, to start the migration immediately @@ -155,7 +155,7 @@ QList Turnstile::splitAmount(double amount, int parts) { if (amount < minMigrationAmount) return amounts; - + fillAmounts(amounts, amount, parts); //qDebug() << amounts; @@ -164,7 +164,7 @@ QList Turnstile::splitAmount(double amount, int parts) { for (auto a : amounts) { sumofparts += a; } - + // Add the Tx fees sumofparts += amounts.size() * Settings::getMinerFee(); @@ -181,7 +181,7 @@ void Turnstile::fillAmounts(QList& amounts, double amount, int count) { } // Get a random amount off the total amount and call recursively. - // Multiply by hundred, because we'll operate on 0.01 ZEC minimum. We'll divide by 100 later on + // Multiply by hundred, because we'll operate on 0.01 ZEC minimum. We'll divide by 100 later on // in this function. double curAmount = std::rand() % (int)std::floor(amount * 100); @@ -205,7 +205,7 @@ QList::Iterator Turnstile::getNextStep(QList& plan) { // Get to the next unexecuted step auto fnIsEligibleItem = [&] (auto item) { - return item.status == TurnstileMigrationItemStatus::NotStarted || + return item.status == TurnstileMigrationItemStatus::NotStarted || item.status == TurnstileMigrationItemStatus::SentToT; }; @@ -225,16 +225,16 @@ ProgressReport Turnstile::getPlanProgress() { auto nextStep = getNextStep(plan); auto step = std::distance(plan.begin(), nextStep) * 2; // 2 steps per item - if (nextStep != plan.end() && + if (nextStep != plan.end() && nextStep->status == TurnstileMigrationItemStatus::SentToT) step++; - + auto total = plan.size(); auto nextBlock = nextStep == plan.end() ? 0 : nextStep->blockNumber; bool hasErrors = std::find_if(plan.begin(), plan.end(), [=] (auto i) { - return i.status == TurnstileMigrationItemStatus::NotEnoughBalance || + return i.status == TurnstileMigrationItemStatus::NotEnoughBalance || i.status == TurnstileMigrationItemStatus::UnknownError; }) != plan.end(); @@ -260,7 +260,7 @@ void Turnstile::executeMigrationStep() { // Get to the next unexecuted step auto fnIsEligibleItem = [&] (auto item) { - return item.status == TurnstileMigrationItemStatus::NotStarted || + return item.status == TurnstileMigrationItemStatus::NotStarted || item.status == TurnstileMigrationItemStatus::SentToT; }; @@ -275,10 +275,10 @@ void Turnstile::executeMigrationStep() { // Find the next step auto nextStep = std::find_if(plan.begin(), plan.end(), fnIsEligibleItem); - if (nextStep == plan.end()) - return; // Nothing to do - - if (nextStep->blockNumber > Settings::getInstance()->getBlockNumber()) + if (nextStep == plan.end()) + return; // Nothing to do + + if (nextStep->blockNumber > Settings::getInstance()->getBlockNumber()) return; // Is this the last step for this address? @@ -320,7 +320,7 @@ void Turnstile::executeMigrationStep() { writeMigrationPlan(plan); }); } else if (nextStep->status == TurnstileMigrationItemStatus::SentToT) { - // First thing to do is check to see if the funds are confirmed. + // First thing to do is check to see if the funds are confirmed. // We'll check both the original sprout address and the intermediate t-addr for safety. if (fnHasUnconfirmed(nextStep->intTAddr) || fnHasUnconfirmed(nextStep->fromAddr)) { //qDebug() << QString("unconfirmed, waiting"); @@ -328,7 +328,7 @@ void Turnstile::executeMigrationStep() { } // Sometimes, we check too quickly, and the unspent UTXO is not updated yet, so we'll - // double check to see if there is enough balance. + // double check to see if there is enough balance. if (!rpc->getAllBalances()->keys().contains(nextStep->intTAddr)) { //qDebug() << QString("The intermediate t-address doesn't have balance, even though it seems to be confirmed"); return; @@ -344,7 +344,7 @@ void Turnstile::executeMigrationStep() { writeMigrationPlan(plan); return; } - + QList to = { ToFields{ nextStep->destAddr, sendAmt, "", "" } }; // Create the Tx @@ -363,7 +363,7 @@ void Turnstile::doSendTx(Tx tx, std::function cb) { rpc->executeTransaction(tx, [=] (QString opid) { mainwindow->ui->statusBar->showMessage(QObject::tr("Computing Tx: ") % opid); }, - [=] (QString /*opid*/, QString txid) { + [=] (QString /*opid*/, QString txid) { mainwindow->ui->statusBar->showMessage(Settings::txidStatusMessage + " " + txid); cb(); }, @@ -371,11 +371,11 @@ void Turnstile::doSendTx(Tx tx, std::function cb) { mainwindow->ui->statusBar->showMessage(QObject::tr(" Tx ") % opid % QObject::tr(" failed"), 15 * 1000); if (!opid.isEmpty()) - errStr = QObject::tr("The transaction with id ") % opid % QObject::tr(" failed. The error was") + ":\n\n" + errStr; + errStr = QObject::tr("The transaction with id ") % opid % QObject::tr(" failed. The error was") + ":\n\n" + errStr; - QMessageBox::critical(mainwindow, QObject::tr("Transaction Error"), errStr, QMessageBox::Ok); + QMessageBox::critical(mainwindow, QObject::tr("Transaction Error"), errStr, QMessageBox::Ok); }); - + } @@ -411,7 +411,7 @@ void Turnstile::showZcashdMigration(MainWindow* parent) { if (Settings::getInstance()->isTestnet()) { url = "https://explorer.testnet.z.cash/tx/" + txid; } else { - url = "https://explorer.zcha.in/transactions/" + txid; + url = "https://explorer.arrowchain.io/#/tx/" + txid; } QDesktopServices::openUrl(QUrl(url)); }); @@ -461,7 +461,7 @@ QVariant MigrationTxns::data(const QModelIndex &index, int role) const { } } return QVariant(); -} +} QVariant MigrationTxns::headerData(int section, Qt::Orientation orientation, int role) const { diff --git a/src/version.h b/src/version.h index 916abdf1..e3c25cbf 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define APP_VERSION "0.1.5" +#define APP_VERSION "0.1.7"