@@ -112,17 +112,17 @@ std::vector<uint8_t> Ark::Crypto::Transactions::Transaction::toBytes(
112
112
std::begin (senderKeyBytes),
113
113
std::end (senderKeyBytes));
114
114
115
- const auto skipRecipientId =
115
+ const auto skiprecipient =
116
116
type == defaults::TransactionTypes::SecondSignatureRegistration
117
117
|| type ==defaults::TransactionTypes::MultiSignatureRegistration;
118
118
119
- if (!this ->recipientId .empty () && !skipRecipientId ) {
120
- std::vector<std::uint8_t > recipientIdBytes = Address::bytesFromBase58Check (
121
- this ->recipientId .c_str ());
119
+ if (!this ->recipient .empty () && !skiprecipient ) {
120
+ std::vector<std::uint8_t > recipientBytes = Address::bytesFromBase58Check (
121
+ this ->recipient .c_str ());
122
122
bytes.insert (
123
123
std::end (bytes),
124
- std::begin (recipientIdBytes ),
125
- std::end (recipientIdBytes ));
124
+ std::begin (recipientBytes ),
125
+ std::end (recipientBytes ));
126
126
} else {
127
127
std::vector<uint8_t > filler (21 , 0 );
128
128
bytes.insert (
@@ -301,7 +301,7 @@ std::map<std::string, std::string> Ark::Crypto::Transactions::Transaction::toArr
301
301
{ " fee" , fee },
302
302
{ " id" , this ->id },
303
303
{ " network" , network },
304
- { " recipientId " , this ->recipientId },
304
+ { " recipient " , this ->recipient },
305
305
{ " secondSignature" , this ->secondSignature },
306
306
{ " senderPublicKey" , this ->senderPublicKey },
307
307
{ " signature" , this ->signature },
@@ -323,7 +323,8 @@ std::string Ark::Crypto::Transactions::Transaction::toJson() {
323
323
DynamicJsonDocument doc (docCapacity);
324
324
325
325
// Amount
326
- doc[" amount" ] = strtoull (txArray[" amount" ].c_str (), nullptr , 10 );
326
+ // >= Core v.2.5 'amount' json is string-type
327
+ doc[" amount" ] = txArray[" amount" ];
327
328
328
329
// Asset
329
330
if (this ->type == 0 ) {
@@ -365,7 +366,8 @@ std::string Ark::Crypto::Transactions::Transaction::toJson() {
365
366
};
366
367
367
368
// Fee
368
- doc[" fee" ] = strtoull (txArray[" fee" ].c_str (), nullptr , 10 );
369
+ // >= Core v.2.5 'amount' json is string-type
370
+ doc[" fee" ] = txArray[" fee" ];
369
371
370
372
// Id
371
373
doc[" id" ] = txArray[" id" ];
@@ -375,8 +377,8 @@ std::string Ark::Crypto::Transactions::Transaction::toJson() {
375
377
doc[" network" ] = atoi (txArray[" network" ].c_str ());
376
378
};
377
379
378
- // RecipientId
379
- doc[" recipientId " ] = txArray[" recipientId " ];
380
+ // Recipient
381
+ doc[" recipient " ] = txArray[" recipient " ];
380
382
381
383
// SecondSignature
382
384
if (std::strlen (txArray[" secondSignature" ].c_str ()) > 0 ) {
0 commit comments