TransactionInfo: add isCoinbase and description

This commit is contained in:
selsta 2021-06-18 03:34:47 +02:00
parent b970cad48b
commit 57c205206c
No known key found for this signature in database
GPG key ID: 2EA0A99A8B07AE5E
2 changed files with 17 additions and 0 deletions

View file

@ -47,6 +47,10 @@ bool TransactionInfo::isFailed() const
return m_failed;
}
bool TransactionInfo::isCoinbase() const
{
return m_coinbase;
}
double TransactionInfo::amount() const
{
@ -126,6 +130,11 @@ QString TransactionInfo::paymentId() const
return m_paymentId;
}
QString TransactionInfo::description() const
{
return m_description;
}
QString TransactionInfo::destinations_formatted() const
{
QString destinations;
@ -144,10 +153,12 @@ TransactionInfo::TransactionInfo(const Monero::TransactionInfo *pimpl, QObject *
, m_confirmations(pimpl->confirmations())
, m_direction(static_cast<Direction>(pimpl->direction()))
, m_failed(pimpl->isFailed())
, m_coinbase(pimpl->isCoinbase())
, m_fee(pimpl->fee())
, m_hash(QString::fromStdString(pimpl->hash()))
, m_label(QString::fromStdString(pimpl->label()))
, m_paymentId(QString::fromStdString(pimpl->paymentId()))
, m_description(QString::fromStdString(pimpl->description()))
, m_pending(pimpl->isPending())
, m_subaddrAccount(pimpl->subaddrAccount())
, m_timestamp(QDateTime::fromTime_t(pimpl->timestamp()))

View file

@ -42,6 +42,7 @@ class TransactionInfo : public QObject
Q_PROPERTY(Direction direction READ direction)
Q_PROPERTY(bool isPending READ isPending)
Q_PROPERTY(bool isFailed READ isFailed)
Q_PROPERTY(bool isCoinbase READ isCoinbase)
Q_PROPERTY(double amount READ amount)
Q_PROPERTY(quint64 atomicAmount READ atomicAmount)
Q_PROPERTY(QString displayAmount READ displayAmount)
@ -57,6 +58,7 @@ class TransactionInfo : public QObject
Q_PROPERTY(QString date READ date)
Q_PROPERTY(QString time READ time)
Q_PROPERTY(QString paymentId READ paymentId)
Q_PROPERTY(QString description READ description)
Q_PROPERTY(QString destinations_formatted READ destinations_formatted)
public:
@ -71,6 +73,7 @@ public:
Direction direction() const;
bool isPending() const;
bool isFailed() const;
bool isCoinbase() const;
double amount() const;
quint64 atomicAmount() const;
QString displayAmount() const;
@ -87,6 +90,7 @@ public:
QString date() const;
QString time() const;
QString paymentId() const;
QString description() const;
//! only applicable for output transactions
//! used in tx details popup
QString destinations_formatted() const;
@ -104,7 +108,9 @@ private:
QString m_hash;
QString m_label;
QString m_paymentId;
QString m_description;
bool m_pending;
bool m_coinbase;
quint32 m_subaddrAccount;
QSet<quint32> m_subaddrIndex;
QDateTime m_timestamp;