Skip to content

Commit 8c9f1f7

Browse files
authored
Merge pull request #69 from horizontalsystems/gas-limit
Enhancements
2 parents 1f94e94 + db6707f commit 8c9f1f7

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

erc20kit/src/main/java/io/horizontalsystems/erc20kit/core/Erc20DatabaseManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import java.io.File
99
internal object Erc20DatabaseManager {
1010

1111
fun getErc20Database(context: Context, contractAddress: String): Erc20KitDatabase {
12-
val databaseName = "erc20-$contractAddress"
12+
val databaseName = "Erc20-$contractAddress"
1313
return Erc20KitDatabase.getInstance(context, databaseName).also { addDatabasePath(context, it) }
1414
}
1515

erc20kit/src/main/java/io/horizontalsystems/erc20kit/core/Erc20Kit.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ class Erc20Kit(private val ethereumKit: EthereumKit,
1818
private val balanceManager: IBalanceManager,
1919
private val state: KitState = KitState()) : ITransactionManagerListener, IBalanceManagerListener {
2020

21-
private val gasLimit: Long = 100_000
21+
private val gasLimit: Long = 150_000
22+
private val estimateGasLimit: Long = 100_000
23+
2224
private val disposables = CompositeDisposable()
2325

2426
sealed class SyncState {
@@ -57,7 +59,7 @@ class Erc20Kit(private val ethereumKit: EthereumKit,
5759
get() = state.balance
5860

5961
fun fee(gasPrice: Long): BigDecimal {
60-
return BigDecimal(gasPrice).multiply(gasLimit.toBigDecimal())
62+
return BigDecimal(gasPrice).multiply(estimateGasLimit.toBigDecimal())
6163
}
6264

6365
fun send(to: String, value: String, gasPrice: Long): Single<TransactionInfo> {

ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/core/EthereumDatabaseManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import java.io.File
1010
internal object EthereumDatabaseManager {
1111

1212
fun getEthereumApiDatabase(context: Context, walletId: String, networkType: EthereumKit.NetworkType): ApiDatabase {
13-
val databaseName = "api-$walletId-${networkType.name}"
13+
val databaseName = "Ethereum-$walletId-${networkType.name}-api"
1414
return ApiDatabase.getInstance(context, databaseName).also { addDatabasePath(context, it) }
1515
}
1616

1717
fun getEthereumSpvDatabase(context: Context, walletId: String, networkType: EthereumKit.NetworkType): SPVDatabase {
18-
val databaseName = "spv-$walletId-${networkType.name}"
18+
val databaseName = "Ethereum-$walletId-${networkType.name}-spv"
1919
return SPVDatabase.getInstance(context, databaseName).also { addDatabasePath(context, it) }
2020
}
2121

0 commit comments

Comments
 (0)