diff --git a/src/CryptoNoteWrapper/WalletGreenWorker.cpp b/src/CryptoNoteWrapper/WalletGreenWorker.cpp index 5c1da4a..eeff391 100644 --- a/src/CryptoNoteWrapper/WalletGreenWorker.cpp +++ b/src/CryptoNoteWrapper/WalletGreenWorker.cpp @@ -44,6 +44,8 @@ #include "Wallet/WalletGreen.h" #include "Wallet/WalletErrors.h" +using namespace Qwertycoin; + namespace WalletGui { namespace { @@ -256,7 +258,7 @@ IWalletAdapter::WalletInitStatus WalletGreenWorker::createWithKeys(const QString int errorCode = 0; try { m_wallet->initializeWithViewKey(std::string(_walletPath.toLocal8Bit().data()), "", _accountKeys.viewKeys.secretKey); - if (std::memcmp(&_accountKeys.spendKeys.secretKey, &CryptoNote::NULL_SECRET_KEY, sizeof(Crypto::SecretKey)) == 0) { + if (std::memcmp(&_accountKeys.spendKeys.secretKey, &NULL_SECRET_KEY, sizeof(Crypto::SecretKey)) == 0) { m_wallet->createAddress(_accountKeys.spendKeys.publicKey); } else { m_wallet->createAddress(_accountKeys.spendKeys.secretKey); @@ -295,7 +297,7 @@ IWalletAdapter::WalletInitStatus WalletGreenWorker::createWithKeysAndTimestamp(c int errorCode = 0; try { m_wallet->initializeWithViewKeyAndTimestamp(std::string(_walletPath.toLocal8Bit().data()), "", _accountKeys.viewKeys.secretKey, _creationTimestamp); - if (std::memcmp(&_accountKeys.spendKeys.secretKey, &CryptoNote::NULL_SECRET_KEY, sizeof(Crypto::SecretKey)) == 0) { + if (std::memcmp(&_accountKeys.spendKeys.secretKey, &NULL_SECRET_KEY, sizeof(Crypto::SecretKey)) == 0) { m_wallet->createAddress(_accountKeys.spendKeys.publicKey); } else { m_wallet->createAddressWithTimestamp(_accountKeys.spendKeys.secretKey, _creationTimestamp); @@ -597,12 +599,12 @@ Crypto::SecretKey WalletGreenWorker::getTransactionSecretKey(quintptr _transacti if (_transaction.secretKey) { txKey = _transaction.secretKey.get(); } else { - txKey = CryptoNote::NULL_SECRET_KEY; + txKey = NULL_SECRET_KEY; } // txKey = _transaction.secretKey; } catch (const std::exception& _error) { WalletLogger::critical(tr("[Wallet] Get transaction key error: %1").arg(_error.what())); - txKey = CryptoNote::NULL_SECRET_KEY; + txKey = NULL_SECRET_KEY; } }); @@ -710,7 +712,7 @@ IWalletAdapter::SendTransactionStatus WalletGreenWorker::sendTransaction(const C SemaphoreLocker locker(m_walletSemaphore); int errorCode = 0; quintptr newTransactionId = CryptoNote::WALLET_INVALID_TRANSACTION_ID; - Crypto::SecretKey newTransactionKey = CryptoNote::NULL_SECRET_KEY; + Crypto::SecretKey newTransactionKey = NULL_SECRET_KEY; WalletLogger::debug(tr("[Wallet] Sending transaction...")); m_dispatcher->remoteSpawn([this, &_transactionParameters, &errorCode, &newTransactionId, &newTransactionKey]() { SemaphoreUnlocker unlocker(m_walletSemaphore); @@ -790,7 +792,7 @@ QString WalletGreenWorker::getBalanceProof(quint64& _amount, QString& _message) Crypto::SecretKey viewSecretKey = accountKeys.viewKeys.secretKey; - if (accountKeys.spendKeys.secretKey == CryptoNote::NULL_SECRET_KEY) { + if (accountKeys.spendKeys.secretKey == NULL_SECRET_KEY) { throw std::runtime_error("Reserve proof can only be generated by a full wallet"); } diff --git a/src/Gui/Common/KeyDialog.cpp b/src/Gui/Common/KeyDialog.cpp index 6df4b59..5c27a15 100644 --- a/src/Gui/Common/KeyDialog.cpp +++ b/src/Gui/Common/KeyDialog.cpp @@ -29,6 +29,8 @@ #include "Style/Style.h" #include "ui_KeyDialog.h" +using namespace Qwertycoin; + namespace WalletGui { namespace { @@ -60,7 +62,7 @@ bool isTrackingKeys(const QByteArray& _array) { } AccountKeys accountKeys = convertByteArrayToAccountKeys(_array); - return (std::memcmp(&accountKeys.spendKeys.secretKey, &CryptoNote::NULL_SECRET_KEY, sizeof(Crypto::SecretKey)) == 0); + return (std::memcmp(&accountKeys.spendKeys.secretKey, &NULL_SECRET_KEY, sizeof(Crypto::SecretKey)) == 0); } } @@ -216,7 +218,7 @@ void KeyDialog::keyChanged() { accountKeys = convertByteArrayToAccountKeys(_array); } - m_isTracking = (std::memcmp(&accountKeys.spendKeys.secretKey, &CryptoNote::NULL_SECRET_KEY, sizeof(Crypto::SecretKey)) == 0); + m_isTracking = (std::memcmp(&accountKeys.spendKeys.secretKey, &NULL_SECRET_KEY, sizeof(Crypto::SecretKey)) == 0); setWindowTitle(m_isTracking ? tr("Import tracking key") : tr("Import key")); if (m_isTracking) { diff --git a/src/Gui/Common/TransactionDetailsDialog.cpp b/src/Gui/Common/TransactionDetailsDialog.cpp index 15fab9c..e653ce6 100644 --- a/src/Gui/Common/TransactionDetailsDialog.cpp +++ b/src/Gui/Common/TransactionDetailsDialog.cpp @@ -38,6 +38,8 @@ Q_DECLARE_METATYPE(QList) +using namespace Qwertycoin; + namespace WalletGui { namespace { @@ -164,7 +166,7 @@ TransactionDetailsDialog::TransactionDetailsDialog(ICryptoNoteAdapter* _cryptoNo Crypto::SecretKey tx_key = m_cryptoNoteAdapter->getNodeAdapter()->getWalletAdapter()->getTransactionSecretKey(static_cast(m_index.row())); QString transactionKey; - if (tx_key != CryptoNote::NULL_SECRET_KEY) { + if (tx_key != NULL_SECRET_KEY) { transactionKey = QString::fromStdString(Common::podToHex(tx_key)); } else { transactionKey = QString("(n/a)"); @@ -211,7 +213,7 @@ QString TransactionDetailsDialog::getTxProof(const QModelIndex& _index) const { Crypto::SecretKey txKey = m_cryptoNoteAdapter->getNodeAdapter()->getWalletAdapter()->getTransactionSecretKey(static_cast(m_index.row())); QString address_str = QString::fromStdString(transfer.address); CryptoNote::AccountPublicAddress addr; - if (m_cryptoNoteAdapter->parseAccountAddressString(address_str, addr) && transfer.amount > 0 && txKey != CryptoNote::NULL_SECRET_KEY) { + if (m_cryptoNoteAdapter->parseAccountAddressString(address_str, addr) && transfer.amount > 0 && txKey != NULL_SECRET_KEY) { proof = m_cryptoNoteAdapter->getTxProof(txHash, addr, txKey); } return proof; diff --git a/src/Models/TransfersModel.cpp b/src/Models/TransfersModel.cpp index 18466d0..d45de43 100644 --- a/src/Models/TransfersModel.cpp +++ b/src/Models/TransfersModel.cpp @@ -33,6 +33,8 @@ Q_DECLARE_METATYPE(QList) +using namespace Qwertycoin; + namespace WalletGui { namespace { @@ -153,7 +155,7 @@ QVariant TransfersModel::getDecorationRole(const QModelIndex& _index) const { Crypto::SecretKey txKey = m_cryptoNoteAdapter->getNodeAdapter()->getWalletAdapter()->getTransactionSecretKey(static_cast(m_transactionIndex.row())); QString address_str = QString::fromStdString(transfer.address); CryptoNote::AccountPublicAddress addr; - if (m_cryptoNoteAdapter->parseAccountAddressString(address_str, addr) && transfer.amount > 0 && txKey != CryptoNote::NULL_SECRET_KEY) { + if (m_cryptoNoteAdapter->parseAccountAddressString(address_str, addr) && transfer.amount > 0 && txKey != NULL_SECRET_KEY) { painter.drawPixmap(7,12, icon.width(), icon.height(), icon); } return pixmap;