Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gh 1994/show all steps #2000

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ android {
defaultConfig {
applicationId "io.gnosis.safe"
versionCode getInt("APP_VERSION_CODE", 703)
versionName getKey("APP_VERSION_NAME", "3.8.0")
versionName getKey("APP_VERSION_NAME", "3.9.0")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

// Infura API key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ class SendAssetReviewViewModel
SendAssetReviewState(
ViewAction.NavigateTo(
SendAssetReviewFragmentDirections.actionSendAssetReviewFragmentToSendAssetSuccessFragment(
activeSafe.chain,
safeTxHash,
amountString,
selectedAsset.symbol
chain = activeSafe.chain,
txId = safeTxHash, // to get non cached updates later we need the txId not the hash
amount = amountString,
token = selectedAsset.symbol
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class OwnerListViewModel
.sortedBy { it.name }
val acceptedOwners = owners.filter { localOwner ->
safe.signingOwners.any {
localOwner.address == it
localOwner.address == it && localOwner.type != Owner.Type.LEDGER_NANO_X
}
}
val balances = rpcClient.getBalances(acceptedOwners.map { it.address })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class TransactionDetailsFragment : BaseViewBindingFragment<FragmentTransactionDe
Navigation.findNavController(root).navigateUp()
}
refresh.setOnRefreshListener {
viewModel.loadDetails(txId)
viewModel.loadDetails(viewModel.txDetails?.txId ?: txId)
}
}

Expand Down Expand Up @@ -130,7 +130,7 @@ class TransactionDetailsFragment : BaseViewBindingFragment<FragmentTransactionDe
viewModel.resumeFlow(ownerSelected()!!, ownerSigned())
resetOwnerData()
} else {
viewModel.loadDetails(txId)
viewModel.loadDetails(viewModel.txDetails?.txId ?: txId)
}
}

Expand Down Expand Up @@ -456,7 +456,7 @@ class TransactionDetailsFragment : BaseViewBindingFragment<FragmentTransactionDe
TransactionStatus.SUCCESS -> R.color.success
TransactionStatus.CANCELLED -> R.color.label_secondary
TransactionStatus.FAILED -> R.color.error
TransactionStatus.PENDING -> R.color.label_secondary
TransactionStatus.PENDING -> R.color.warning
}

@StringRes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.gnosis.safe.ui.transactions.details

import androidx.annotation.VisibleForTesting
import io.gnosis.data.models.AddressInfo
import io.gnosis.data.models.Owner
import io.gnosis.data.models.Safe
import io.gnosis.data.models.TransactionLocal
Expand Down Expand Up @@ -135,7 +136,8 @@ class TransactionDetailsViewModel
executionInfo: DetailedExecutionInfo.MultisigExecutionDetails,
localOwners: List<Owner>
): Boolean {
return localOwners.isNotEmpty() && executionInfo.confirmations.size == executionInfo.confirmationsRequired
val ownersThatCanExecute = localOwners.filter { it.type != Owner.Type.LEDGER_NANO_X && executionInfo.signers.contains(AddressInfo(it.address))}
return ownersThatCanExecute.isNotEmpty() && executionInfo.confirmations.size == executionInfo.confirmationsRequired
}

@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ class TxConfirmationsView @JvmOverloads constructor(
TransactionStatus.FAILED -> {
addExecutionStep(TxExecutionStep.Type.FAILED)
}
TransactionStatus.PENDING -> {
addExecutionStep(TxExecutionStep.Type.PENDING)
}
}
}

Expand Down Expand Up @@ -241,7 +244,8 @@ class TxConfirmationsView @JvmOverloads constructor(
EXECUTE_WAITING,
EXECUTE_READY,
EXECUTE_DONE,
REJECTION_CREATED
REJECTION_CREATED,
PENDING
}

private val binding by lazy { ViewTxConfirmationsExecutionStepBinding.inflate(LayoutInflater.from(context), this) }
Expand Down Expand Up @@ -297,6 +301,11 @@ class TxConfirmationsView @JvmOverloads constructor(
stepTitle.text = resources.getString(R.string.tx_confirmations_rejection_created)
stepTitle.setTextColor(ContextCompat.getColor(context, R.color.error))
}
Type.PENDING -> {
stepIcon.setImageResource(R.drawable.ic_tx_confirmations_execute_ready_16dp)
stepTitle.text = resources.getString(R.string.tx_confirmations_pending)
stepTitle.setTextColor(ContextCompat.getColor(context, R.color.primary))
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ class TxReviewViewModel
rpcClient.getBalances(acceptedOwners.map { it.address })
}.onSuccess {
executionKey = acceptedOwners
.filter {
it.type != Owner.Type.LEDGER_NANO_X
}
.mapIndexed { index, owner ->
owner to it[index]
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@
<string name="tx_confirmations_execute_waiting">Execute (%1$d more confirmation needed)</string>
<string name="tx_confirmations_executed">Executed</string>
<string name="tx_confirmations_rejection_created">On-chain rejection created</string>
<string name="tx_confirmations_pending">Pending</string>

<string name="signing_owner_add_key">Add owner key</string>
<string name="signing_owner_import_existing_title">Import existing owner key</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ class TransactionDetailsViewModelTest {
txDetails = transactionDetails.toTransactionDetailsViewData(
safes = emptyList(),
canSign = false,
canExecute = true,
canExecute = false,
nextInLine = false,
hasOwnerKey = false,
owners = listOf(owner)
Expand Down
6 changes: 3 additions & 3 deletions data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
buildTypes {

debug {
buildConfigField ("String", "CLIENT_GATEWAY_URL", '"https://safe-client-nest.staging.5afe.dev/"')
buildConfigField ("String", "CLIENT_GATEWAY_URL", '"https://safe-client.staging.5afe.dev/"')
buildConfigField (javaTypes.INT, "CHAIN_ID", "5")
buildConfigField (javaTypes.STRING, "CHAIN_TEXT_COLOR", asString("#ffffff"))
buildConfigField (javaTypes.STRING, "CHAIN_BACKGROUND_COLOR", asString("#4D99EB"))
Expand All @@ -49,7 +49,7 @@ android {
}

profile {
buildConfigField javaTypes.STRING, "CLIENT_GATEWAY_URL", asString(getKey("CLIENT_GATEWAY_URL", "https://safe-client-nest.staging.5afe.dev/"))
buildConfigField javaTypes.STRING, "CLIENT_GATEWAY_URL", asString(getKey("CLIENT_GATEWAY_URL", "https://safe-client.staging.5afe.dev/"))
buildConfigField (javaTypes.INT, "CHAIN_ID", "5")
buildConfigField (javaTypes.STRING, "CHAIN_TEXT_COLOR", asString("#ffffff"))
buildConfigField (javaTypes.STRING, "CHAIN_BACKGROUND_COLOR", asString("#4D99EB"))
Expand All @@ -71,7 +71,7 @@ android {
}

internal {
buildConfigField javaTypes.STRING, "CLIENT_GATEWAY_URL", asString(getKey("CLIENT_GATEWAY_URL", "https://safe-client-nest.staging.5afe.dev/"))
buildConfigField javaTypes.STRING, "CLIENT_GATEWAY_URL", asString(getKey("CLIENT_GATEWAY_URL", "https://safe-client.staging.5afe.dev/"))
buildConfigField (javaTypes.INT, "CHAIN_ID", "5")
buildConfigField (javaTypes.STRING, "CHAIN_TEXT_COLOR", asString("#ffffff"))
buildConfigField (javaTypes.STRING, "CHAIN_BACKGROUND_COLOR", asString("#4D99EB"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import java.util.*

@JsonClass(generateAdapter = true)
data class TransactionDetails(
@Json(name = "txId")
val txId: String? = null,
@Json(name = "txHash")
val txHash: String? = null,
@Json(name = "txStatus")
Expand Down