forked from Public/monero-gui
Merge pull request #3828
2bf0dd8Advanced: ReserveProof: Resolve review by selsta (reemuru)0f67580Advanced: ReserveProof: Add support for reserve proof (reemuru)
This commit is contained in:
@@ -844,6 +844,25 @@ Q_INVOKABLE QString Wallet::checkSpendProof(const QString &txid, const QString &
|
||||
return QString::fromStdString(result);
|
||||
}
|
||||
|
||||
Q_INVOKABLE QString Wallet::getReserveProof(bool all, quint32 account_index, quint64 amount, const QString &message) const
|
||||
{
|
||||
qDebug("Generating reserve proof");
|
||||
std::string result = m_walletImpl->getReserveProof(all, account_index, amount, message.toStdString());
|
||||
if (result.empty())
|
||||
result = "error|" + m_walletImpl->errorString();
|
||||
return QString::fromStdString(result);
|
||||
}
|
||||
|
||||
Q_INVOKABLE QString Wallet::checkReserveProof(const QString &address, const QString &message, const QString &signature) const
|
||||
{
|
||||
bool good;
|
||||
u_int64_t total;
|
||||
u_int64_t spent;
|
||||
bool success = m_walletImpl->checkReserveProof(address.toStdString(), message.toStdString(), signature.toStdString(), good, total, spent);
|
||||
std::string result = std::string(success ? "true" : "false") + "|" + std::string(good ? "true" : "false") + "|" + QString::number(total).toStdString() + "|" + QString::number(spent).toStdString();
|
||||
return QString::fromStdString(result);
|
||||
}
|
||||
|
||||
QString Wallet::signMessage(const QString &message, bool filename) const
|
||||
{
|
||||
if (filename) {
|
||||
|
||||
@@ -318,6 +318,8 @@ public:
|
||||
Q_INVOKABLE QString getSpendProof(const QString &txid, const QString &message) const;
|
||||
Q_INVOKABLE void getSpendProofAsync(const QString &txid, const QString &message, const QJSValue &callback);
|
||||
Q_INVOKABLE QString checkSpendProof(const QString &txid, const QString &message, const QString &signature) const;
|
||||
Q_INVOKABLE QString getReserveProof(bool all, quint32 account_index, quint64 amount, const QString &message) const;
|
||||
Q_INVOKABLE QString checkReserveProof(const QString &address, const QString &message, const QString &signature) const;
|
||||
// Rescan spent outputs
|
||||
Q_INVOKABLE bool rescanSpent();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user