Skip to content

Commit

Permalink
Fix duplicate transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
ealymbaev committed Oct 1, 2024
1 parent 48d5142 commit 04752d8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ extension EvmTransactionsAdapter: ITransactionsAdapter {
}

func transactionsSingle(from: TransactionRecord?, token: MarketKit.Token?, filter: TransactionTypeFilter, address: String?, limit: Int) -> Single<[TransactionRecord]> {
evmKit.transactionsSingle(tagQueries: [tagQuery(token: token, filter: filter, address: address?.lowercased())], fromHash: from.flatMap { Data(hex: $0.transactionHash) }, limit: limit)
evmKit.transactionsSingle(tagQueries: [tagQuery(token: token, filter: filter, address: address?.lowercased())], fromHash: from.flatMap { $0.transactionHash.hs.hexData }, limit: limit)
.map { [weak self] transactions -> [TransactionRecord] in
transactions.compactMap { self?.transactionConverter.transactionRecord(fromTransaction: $0) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ extension TronTransactionsAdapter: ITransactionsAdapter {

func transactionsSingle(from: TransactionRecord?, token: MarketKit.Token?, filter: TransactionTypeFilter, address: String?, limit: Int) -> Single<[TransactionRecord]> {
let address = address.flatMap { try? TronKit.Address(address: $0) }?.hex
let transactions = tronKit.transactions(tagQueries: [tagQuery(token: token, filter: filter, address: address)], fromHash: from.flatMap { Data(hex: $0.transactionHash) }, limit: limit)
let transactions = tronKit.transactions(tagQueries: [tagQuery(token: token, filter: filter, address: address)], fromHash: from.flatMap { $0.transactionHash.hs.hexData }, limit: limit)

return Single.just(transactions.compactMap { transactionConverter.transactionRecord(fromTransaction: $0) })
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ enum SendEvmConfirmationModule {
}

static func resendViewController(adapter: ITransactionsAdapter, type: ResendTransactionType, transactionHash: String) throws -> UIViewController {
guard let adapter = adapter as? EvmTransactionsAdapter, let fullTransaction = adapter.evmKit.transaction(hash: Data(hex: transactionHash.hs.stripHexPrefix())) else {
guard let adapter = adapter as? EvmTransactionsAdapter, let hash = transactionHash.hs.hexData, let fullTransaction = adapter.evmKit.transaction(hash: hash) else {
throw CreateModuleError.wrongTransaction
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BigInt
import Foundation

private let max256ByteNumber = BigUInt(Data(hex: "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))
private let max256ByteNumber = BigUInt("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff".hs.hexData!)

extension Decimal {
init?(bigUInt: BigUInt, decimals: Int) {
Expand Down

0 comments on commit 04752d8

Please sign in to comment.