From 6ae449ab2844bdb125af5bcad6e7203dbfaa053f Mon Sep 17 00:00:00 2001 From: abdrasulov Date: Tue, 2 Apr 2024 15:47:03 +0600 Subject: [PATCH] Fix transactions query when searching with fromHash --- .../ethereumkit/core/storage/TransactionStorage.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/core/storage/TransactionStorage.kt b/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/core/storage/TransactionStorage.kt index a07adb29..90de942f 100644 --- a/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/core/storage/TransactionStorage.kt +++ b/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/core/storage/TransactionStorage.kt @@ -2,6 +2,7 @@ package io.horizontalsystems.ethereumkit.core.storage import androidx.sqlite.db.SimpleSQLiteQuery import io.horizontalsystems.ethereumkit.core.ITransactionStorage +import io.horizontalsystems.ethereumkit.core.toRawHexString import io.horizontalsystems.ethereumkit.models.Address import io.horizontalsystems.ethereumkit.models.InternalTransaction import io.horizontalsystems.ethereumkit.models.Transaction @@ -43,8 +44,8 @@ class TransactionStorage(database: TransactionDatabase) : ITransactionStorage { ) OR ( tx.timestamp = ${fromTransaction.timestamp} AND - tx.transactionIndex IS $transactionIndex AND - HEX(tx.hash) < "${fromTransaction.hashString}" + tx.transactionIndex = $transactionIndex AND + HEX(tx.hash) < "${fromTransaction.hash.toRawHexString().uppercase()}" ) ) """