Skip to content

Commit 709d025

Browse files
committed
add E2E_BACKEND to override local electrum
1 parent a043222 commit 709d025

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ val keystoreProperties by lazy {
3737
}
3838

3939
val locales = listOf("en", "ar", "ca", "cs", "de", "el", "es", "fr", "it", "nl", "pl", "pt", "ru")
40+
val e2eBackendEnv = System.getenv("E2E_BACKEND") ?: "local"
4041

4142
android {
4243
namespace = "to.bitkit"
@@ -52,6 +53,7 @@ android {
5253
useSupportLibrary = true
5354
}
5455
buildConfigField("boolean", "E2E", System.getenv("E2E")?.toBoolean()?.toString() ?: "false")
56+
buildConfigField("String", "E2E_BACKEND", "\"$e2eBackendEnv\"")
5557
buildConfigField("boolean", "GEO", System.getenv("GEO")?.toBoolean()?.toString() ?: "true")
5658
buildConfigField("String", "LOCALES", "\"${locales.joinToString(",")}\"")
5759
}

app/src/main/java/to/bitkit/env/Env.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ internal object Env {
1717
val isDebug = BuildConfig.DEBUG
1818
const val isE2eTest = BuildConfig.E2E
1919
const val isGeoblockingEnabled = BuildConfig.GEO
20+
private val e2eBackend = BuildConfig.E2E_BACKEND.lowercase()
2021
val network = Network.valueOf(BuildConfig.NETWORK)
2122
val locales = BuildConfig.LOCALES.split(",")
2223
val walletSyncIntervalSecs = 10_uL // TODO review
@@ -98,7 +99,7 @@ internal object Env {
9899

99100
val electrumServerUrl: String
100101
get() {
101-
if (isE2eTest) return ElectrumServers.E2E
102+
if (isE2eTest && e2eBackend == "local") return ElectrumServers.E2E
102103
return when (network) {
103104
Network.REGTEST -> ElectrumServers.REGTEST
104105
Network.TESTNET -> ElectrumServers.TESTNET

0 commit comments

Comments
 (0)