CAKE-297 | fixed addressIndex

OleksandrSobol committed May 12, 2021 at 19:34 UTC 8567f20809d73fd10204a9755c2ae3c2970df0dc
2 files changed +6 -6
lib/monero/monero_transaction_info.dart
+3 -3
@@ -21,7 +21,7 @@ class MoneroTransactionInfo extends TransactionInfo {
21 isPending = parseBoolFromString(map['isPending'] as String),
22 amount = map['amount'] as int,
23 accountIndex = int.parse(map['accountIndex'] as String),
24 - addressIndex = map['addressIndex'] as List<int>,
24 + addressIndex = map['addressIndex'] as int,
25 key = getTxKey((map['hash'] ?? '') as String),
26 fee = map['fee'] as int ?? 0;
27
@@ -34,7 +34,7 @@ class MoneroTransactionInfo extends TransactionInfo {
34 isPending = row.isPending != 0,
35 amount = row.getAmount(),
36 accountIndex = row.subaddrAccount,
37 - addressIndex = row.getSubaddrIndex(),
37 + addressIndex = row.subaddrIndex,
38 key = getTxKey(row.getHash()),
39 fee = row.fee;
40
@@ -46,7 +46,7 @@ class MoneroTransactionInfo extends TransactionInfo {
46 final bool isPending;
47 final int amount;
48 final int fee;
49 - final List<int> addressIndex;
49 + final int addressIndex;
50 String recipientAddress;
51 String key;
52
lib/view_model/transaction_details_view_model.dart
+3 -3
@@ -66,9 +66,9 @@ abstract class TransactionDetailsViewModelBase with Store {
66 final accountIndex = tx.accountIndex;
67 final addressIndex = tx.addressIndex;
68 final _wallet = wallet as MoneroWallet;
69 -
70 - for (var index in addressIndex) {
71 - final address = _wallet.getTransactionAddress(accountIndex, index);
69 + final address =
70 + _wallet.getTransactionAddress(accountIndex, addressIndex);
71 + if (address?.isNotEmpty ?? false) {
72 _items.add(
73 StandartListItem(
74 title: S.current.transaction_details_recipient_address,