mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-29 16:24:22 +00:00
qt: add message field to SendCoinsRecipient
Also update URI parsing to fill in this field. Note that the message is not currently used in any way with the client. It should be stored with the transaction.
This commit is contained in:
parent
82095923bb
commit
03535acd05
@ -112,6 +112,11 @@ bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
|
|||||||
rv.label = i->second;
|
rv.label = i->second;
|
||||||
fShouldReturnFalse = false;
|
fShouldReturnFalse = false;
|
||||||
}
|
}
|
||||||
|
if (i->first == "message")
|
||||||
|
{
|
||||||
|
rv.message = i->second;
|
||||||
|
fShouldReturnFalse = false;
|
||||||
|
}
|
||||||
else if (i->first == "amount")
|
else if (i->first == "amount")
|
||||||
{
|
{
|
||||||
if(!i->second.isEmpty())
|
if(!i->second.isEmpty())
|
||||||
|
@ -50,9 +50,8 @@ void URITests::uriTests()
|
|||||||
QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W"));
|
QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W"));
|
||||||
QVERIFY(rv.label == QString());
|
QVERIFY(rv.label == QString());
|
||||||
|
|
||||||
// We currently don't implement the message parameter (ok, yea, we break spec...)
|
|
||||||
uri.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?req-message=Wikipedia Example Address"));
|
uri.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?req-message=Wikipedia Example Address"));
|
||||||
QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));
|
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
|
||||||
|
|
||||||
uri.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=1,000&label=Wikipedia Example"));
|
uri.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=1,000&label=Wikipedia Example"));
|
||||||
QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));
|
QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));
|
||||||
|
@ -21,11 +21,14 @@ QT_END_NAMESPACE
|
|||||||
class SendCoinsRecipient
|
class SendCoinsRecipient
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SendCoinsRecipient() : amount(0) { }
|
explicit SendCoinsRecipient() : amount(0) { }
|
||||||
|
explicit SendCoinsRecipient(const QString &addr, const QString &label, quint64 amount, const QString &message):
|
||||||
|
address(addr), label(label), amount(amount), message(message) {}
|
||||||
|
|
||||||
QString address;
|
QString address;
|
||||||
QString label;
|
QString label;
|
||||||
qint64 amount;
|
qint64 amount;
|
||||||
|
QString message;
|
||||||
|
|
||||||
// If from a payment request, paymentRequest.IsInitialized() will be true
|
// If from a payment request, paymentRequest.IsInitialized() will be true
|
||||||
PaymentRequestPlus paymentRequest;
|
PaymentRequestPlus paymentRequest;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user