Skip to content

Commit

Permalink
Adjust service endpoints to use staging instead of dev (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmeissner authored Jul 17, 2018
1 parent a9cd859 commit 47b95ed
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 82 deletions.
8 changes: 7 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ android {
versionName getKey("APP_VERSION_NAME", "0.4.2-alpha")
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

// Contracts
buildConfigField javaTypes.STRING, "SAFE_MASTER_COPY_ADDRESS", asString(getKey("SAFE_MASTER_COPY_ADDRESS", "0x44e7f5855a77fe1793a96be8a1c9c3eaf47e9d09"))
buildConfigField javaTypes.STRING, "MULTI_SEND_ADDRESS", asString(getKey("MULTI_SEND_ADDRESS", "0x2c155fd04682979fd15c67fb65dfab9345605761"))
buildConfigField javaTypes.STRING, "BLOCKCHAIN_NET_URL", asString(getKey("BLOCKCHAIN_NET_URL", "https://rinkeby.infura.io"))
// API keys
buildConfigField javaTypes.STRING, "INFURA_API_KEY", asString(getKey("INFURA_API_KEY", ""))
// Services
buildConfigField javaTypes.STRING, "BLOCKCHAIN_NET_URL", asString(getKey("BLOCKCHAIN_NET_URL", "https://rinkeby.infura.io"))
buildConfigField javaTypes.STRING, "RELAY_SERVICE_URL", asString(getKey("RELAY_SERVICE_URL", "https://safe-relay.staging.gnosisdev.com/api/"))
buildConfigField javaTypes.STRING, "NOTIFICATION_SERVICE_URL", asString(getKey("NOTIFICATION_SERVICE_URL", "https://safe-notification.staging.gnosisdev.com/api/"))
buildConfigField javaTypes.STRING, "VERIFIED_TOKEN_SERVICE_URL", asString(getKey("VERIFIED_TOKEN_SERVICE_URL", "https://gist.githubusercontent.com/rmeissner/98911fcf74b0ea9731e2dae2441c97a4/raw/"))

vectorDrawables.useSupportLibrary = true
multiDexEnabled true
Expand Down
Binary file added app/src/internal/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/internal/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/internal/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/src/internal/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Gnosis Safe - Internal</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import retrofit2.http.Body
import retrofit2.http.POST

interface PushServiceApi {
companion object {
const val BASE_URL = "https://safe-notification.dev.gnosisdev.com/api/"
}

@POST("v1/auth/")
fun auth(@Body pushServiceAuth: PushServiceAuth): Completable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import retrofit2.http.*


interface RelayServiceApi {
companion object {
const val BASE_URL = "https://safe-relay.dev.gnosisdev.com/api/"
}

@POST("v1/safes/{address}/transactions/")
fun execute(@Path("address") address: String, @Body params: ExecuteParams): Single<RelayExecution>

Expand Down
47 changes: 0 additions & 47 deletions app/src/main/java/pm/gnosis/heimdall/data/remote/TxExecutorApi.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import pm.gnosis.heimdall.data.remote.models.tokens.VerifiedTokenJson
import retrofit2.http.GET

interface VerifiedTokensServiceApi {
companion object {
const val BASE_URL = "https://gist.githubusercontent.com/rmeissner/98911fcf74b0ea9731e2dae2441c97a4/raw/"
}

@GET("verified_rinkeby_tokens.json")
fun loadVerifiedTokenList(): Single<List<VerifiedTokenJson>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import pm.gnosis.heimdall.data.adapters.*
import pm.gnosis.heimdall.data.db.ApplicationDb
import pm.gnosis.heimdall.data.remote.PushServiceApi
import pm.gnosis.heimdall.data.remote.RelayServiceApi
import pm.gnosis.heimdall.data.remote.TxExecutorApi
import pm.gnosis.heimdall.data.remote.VerifiedTokensServiceApi
import pm.gnosis.heimdall.di.ApplicationContext
import pm.gnosis.mnemonic.Bip39
Expand Down Expand Up @@ -102,24 +101,12 @@ class ApplicationModule(private val application: Application) {
.build()
.create(RetrofitEthereumRpcApi::class.java)

@Provides
@Singleton
fun providesTxExecutorApi(moshi: Moshi, client: OkHttpClient): TxExecutorApi =
Retrofit.Builder()
// Increase timeout since our server goes to sleeps
.client(client.newBuilder().readTimeout(30, TimeUnit.SECONDS).build())
.baseUrl(TxExecutorApi.BASE_URL)
.addConverterFactory(MoshiConverterFactory.create(moshi))
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
.build()
.create(TxExecutorApi::class.java)

@Provides
@Singleton
fun providesPushServiceApi(moshi: Moshi, client: OkHttpClient): PushServiceApi =
Retrofit.Builder()
.client(client)
.baseUrl(PushServiceApi.BASE_URL)
.baseUrl(BuildConfig.NOTIFICATION_SERVICE_URL)
.addConverterFactory(MoshiConverterFactory.create(moshi))
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
.build()
Expand All @@ -130,7 +117,7 @@ class ApplicationModule(private val application: Application) {
fun providesRelayServiceApi(moshi: Moshi, client: OkHttpClient): RelayServiceApi =
Retrofit.Builder()
.client(client)
.baseUrl(RelayServiceApi.BASE_URL)
.baseUrl(BuildConfig.RELAY_SERVICE_URL)
.addConverterFactory(MoshiConverterFactory.create(moshi))
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
.build()
Expand All @@ -141,7 +128,7 @@ class ApplicationModule(private val application: Application) {
fun providesVerifiedTokensServiceApi(moshi: Moshi, client: OkHttpClient): VerifiedTokensServiceApi =
Retrofit.Builder()
.client(client)
.baseUrl(VerifiedTokensServiceApi.BASE_URL)
.baseUrl(BuildConfig.VERIFIED_TOKEN_SERVICE_URL)
.addConverterFactory(MoshiConverterFactory.create(moshi))
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class ConfirmTransactionActivity : ViewModelActivity<ConfirmTransactionContract>
errorSnackbar(layout_confirm_transaction_transaction_info, throwable)
val errorMsgId = (throwable as? ConfirmTransactionContract.InvalidTransactionException)?.messageId ?: R.string.error_loading_transaction
layout_confirm_transaction_loading_error_message.text = getString(errorMsgId)
layout_confirm_transaction_loading_error_group.visible(true)
layout_confirm_transaction_loading_error_group.visible(transactionInfoViewHolder == null)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ class DefaultSubmitTransactionHelper @Inject constructor(
emit = {
it.map {
ViewUpdate.Estimate(
Wei(
(it.txGas + it.dataGas + BigInteger.valueOf(32000)) * it.gasPrice
), it.balance
Wei(it.gasCosts()), it.balance
)
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class DefaultSubmitTransactionHelperTest {
.willReturn(Single.just(info))
retryEvents.onNext(Unit)

updates += { it == DataResult(SubmitTransactionHelper.ViewUpdate.Estimate(Wei(BigInteger.valueOf(32010)), Wei.ether("23"))) }
updates += { it == DataResult(SubmitTransactionHelper.ViewUpdate.Estimate(Wei(BigInteger.valueOf(10)), Wei.ether("23"))) }
testObserver.assertUpdates(updates)

/*
Expand Down Expand Up @@ -407,7 +407,7 @@ class DefaultSubmitTransactionHelperTest {
val updates = mutableListOf<((Result<SubmitTransactionHelper.ViewUpdate>) -> Boolean)>({
((it as? DataResult)?.data as? SubmitTransactionHelper.ViewUpdate.TransactionInfo)?.viewHolder == transactionViewHolder
})
updates += { it == DataResult(SubmitTransactionHelper.ViewUpdate.Estimate(Wei(BigInteger.valueOf(32010)), Wei.ether("23"))) }
updates += { it == DataResult(SubmitTransactionHelper.ViewUpdate.Estimate(Wei(BigInteger.valueOf(10)), Wei.ether("23"))) }
testObserver.assertUpdates(updates)

signatureSubject.onNext(emptyMap())
Expand Down

0 comments on commit 47b95ed

Please sign in to comment.