Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
IOS-7571: Fix duplicate entries in tx history (#793)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Fedorov <[email protected]>
  • Loading branch information
m3g0byt3 authored Aug 8, 2024
1 parent 3589f57 commit d255513
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ extension AlgorandTransactionHistoryProvider: TransactionHistoryProvider {
}

var description: String {
return "nextToken: \(page?.next ?? "-")"
return objectDescription(
self,
userInfo: [
"nextToken": page?.next ?? "-",
]
)
}

func reset() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,11 @@ private extension EthereumTransactionHistoryMapper {
) -> [TransactionRecord] {
let hash = transaction.txid
let fee = Fee(Amount(with: blockchain, value: feeValue / blockchain.decimalValue))
let index = transactionIndicesCounter[hash, default: 0]
transactionIndicesCounter[hash] = index + 1

return transactionInfos.map { transactionInfo in
let index = transactionIndicesCounter[hash, default: 0]
transactionIndicesCounter[hash] = index + 1

return TransactionRecord(
hash: hash,
index: index,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ extension EthereumTransactionHistoryProvider: TransactionHistoryProvider {
}

var description: String {
return "number: \(String(describing: page?.number)); \(totalPages); \(totalRecordsCount)"
return objectDescription(
self,
userInfo: [
"pageNumber": String(describing: page?.number),
"totalPages": totalPages,
"totalRecordsCount": totalRecordsCount,
]
)
}

func reset() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ final class TronTransactionHistoryMapper {
let type = transactionType(transaction, amountType: amountType)
let tokenTransfers = tokenTransfers(transaction)

let index = transactionIndicesCounter[hash, default: 0]
transactionIndicesCounter[hash] = index + 1

return transactionInfos.map { transactionInfo in
let index = transactionIndicesCounter[hash, default: 0]
transactionIndicesCounter[hash] = index + 1

return TransactionRecord(
hash: hash,
index: index,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ extension UTXOTransactionHistoryProvider: TransactionHistoryProvider {
}

var description: String {
return "number: \(String(describing: page?.number)); \(totalPages); \(totalRecordsCount)"
return objectDescription(
self,
userInfo: [
"pageNumber": String(describing: page?.number),
"totalPages": totalPages,
"totalRecordsCount": totalRecordsCount,
]
)
}

func reset() {
Expand Down

0 comments on commit d255513

Please sign in to comment.