Remove machine fingerprint from receiveAt

This commit is contained in:
Zach Fox 2017-11-08 17:14:14 -08:00
parent 38fde43009
commit 19b7c6e025
3 changed files with 4 additions and 12 deletions

View file

@ -90,7 +90,7 @@ void Ledger::buy(const QString& hfc_key, int cost, const QString& asset_id, cons
signedSend("transaction", transactionString, hfc_key, "buy", "buySuccess", "buyFailure", controlled_failure);
}
bool Ledger::receiveAt(const QString& hfc_key, const QString& old_key, const QString& machine_fingerprint) {
bool Ledger::receiveAt(const QString& hfc_key, const QString& old_key) {
auto accountManager = DependencyManager::get<AccountManager>();
if (!accountManager->isLoggedIn()) {
qCWarning(commerce) << "Cannot set receiveAt when not logged in.";
@ -99,13 +99,7 @@ bool Ledger::receiveAt(const QString& hfc_key, const QString& old_key, const QSt
return false; // We know right away that we will fail, so tell the caller.
}
QJsonObject transaction;
transaction["public_key"] = hfc_key;
transaction["machine_fingerprint"] = machine_fingerprint;
QJsonDocument transactionDoc{ transaction };
auto transactionString = transactionDoc.toJson(QJsonDocument::Compact);
signedSend("transaction", transactionString, old_key, "receive_at", "receiveAtSuccess", "receiveAtFailure");
signedSend("public_key", hfc_key.toUtf8(), old_key, "receive_at", "receiveAtSuccess", "receiveAtFailure");
return true; // Note that there may still be an asynchronous signal of failure that callers might be interested in.
}

View file

@ -26,7 +26,7 @@ class Ledger : public QObject, public Dependency {
public:
void buy(const QString& hfc_key, int cost, const QString& asset_id, const QString& inventory_key, const bool controlled_failure = false);
bool receiveAt(const QString& hfc_key, const QString& old_key, const QString& machine_fingerprint);
bool receiveAt(const QString& hfc_key, const QString& old_key);
void balance(const QStringList& keys);
void inventory(const QStringList& keys);
void history(const QStringList& keys);

View file

@ -16,7 +16,6 @@
#include "ui/ImageProvider.h"
#include "scripting/HMDScriptingInterface.h"
#include <FingerprintUtils.h>
#include <PathUtils.h>
#include <OffscreenUi.h>
#include <AccountManager.h>
@ -542,8 +541,7 @@ bool Wallet::generateKeyPair() {
// 2. It is maximally private, and we can step back from that later if desired.
// 3. It maximally exercises all the machinery, so we are most likely to surface issues now.
auto ledger = DependencyManager::get<Ledger>();
QString machineFingerprint = uuidStringWithoutCurlyBraces(FingerprintUtils::getMachineFingerprint());
return ledger->receiveAt(key, oldKey, machineFingerprint);
return ledger->receiveAt(key, oldKey);
}
QStringList Wallet::listPublicKeys() {