[#161] Implement display of new address types
Co-authored-by: Honza <rychnovsky.honza@gmail.com>
This commit is contained in:
parent
c358e1b2c7
commit
88c7277048
|
@ -3,11 +3,10 @@ package cash.z.ecc.sdk.fixture
|
|||
import cash.z.ecc.sdk.model.WalletAddress
|
||||
|
||||
object WalletAddressFixture {
|
||||
// These fixture values are derived from the secret defined in PersistableWalletFixture
|
||||
|
||||
// TODO [#161]: Pending SDK support
|
||||
// TODO [#161]: https://github.com/zcash/secant-android-wallet/issues/161
|
||||
const val UNIFIED_ADDRESS_STRING = "Unified GitHub Issue #161"
|
||||
// These fixture values are derived from the secret defined in PersistableWalletFixture
|
||||
@Suppress("MaxLineLength")
|
||||
const val UNIFIED_ADDRESS_STRING = "utest1qwerty6tj6989fcf0r57aavfnypj0krtxnmz93ty7ujr7d0spdxnz97kfdcugq9ndglvyg7v89m78dparu33q0putwaf2kvnsypsh8juzmcdvnedjlrrwhel9ldr203p7wc922luxup"
|
||||
|
||||
@Suppress("MaxLineLength")
|
||||
const val SAPLING_ADDRESS_STRING = "zs1hf72k87gev2qnvg9228vn2xt97adfelju2hm2ap4xwrxkau5dz56mvkeseer3u8283wmy7skt4u"
|
||||
|
|
|
@ -13,18 +13,18 @@ data class WalletAddresses(
|
|||
|
||||
companion object {
|
||||
suspend fun new(synchronizer: Synchronizer): WalletAddresses {
|
||||
val unifiedAddress = WalletAddress.Unified.new(
|
||||
synchronizer.getUnifiedAddress(Account.DEFAULT)
|
||||
)
|
||||
val saplingAddress = WalletAddress.Sapling.new(
|
||||
synchronizer.getSaplingAddress(Account.DEFAULT)
|
||||
)
|
||||
|
||||
val transparentAddress = WalletAddress.Transparent.new(
|
||||
synchronizer.getTransparentAddress(Account.DEFAULT)
|
||||
)
|
||||
|
||||
// TODO [#161]: Pending SDK support, fix providing correct values for the unified
|
||||
// TODO [#161]: https://github.com/zcash/secant-android-wallet/issues/161
|
||||
return WalletAddresses(
|
||||
unified = WalletAddress.Unified.new("Unified GitHub Issue #161"),
|
||||
unified = unifiedAddress,
|
||||
sapling = saplingAddress,
|
||||
transparent = transparentAddress
|
||||
)
|
||||
|
|
|
@ -122,12 +122,14 @@ private fun ProfileContents(
|
|||
QrCode(data = walletAddress.address, DEFAULT_QR_CODE_SIZE, Modifier.align(Alignment.CenterHorizontally))
|
||||
Body(text = stringResource(id = R.string.wallet_address_unified), Modifier.align(Alignment.CenterHorizontally))
|
||||
// TODO [#163]: Ellipsize center of the string
|
||||
// TODO [#163]: https://github.com/zcash/secant-android-wallet/issues/163
|
||||
Text(
|
||||
text = walletAddress.address,
|
||||
style = MaterialTheme.typography.headlineLarge,
|
||||
color = MaterialTheme.colorScheme.onBackground,
|
||||
modifier = Modifier.align(Alignment.CenterHorizontally),
|
||||
overflow = TextOverflow.Ellipsis
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
maxLines = 1
|
||||
)
|
||||
PrimaryButton(onClick = onAddressDetails, text = stringResource(id = R.string.profile_see_address_details))
|
||||
if (isAddressBookEnabled) {
|
||||
|
|
|
@ -476,7 +476,7 @@ private fun homeScreenshots(resContext: Context, tag: String, composeTestRule: A
|
|||
|
||||
private fun profileScreenshots(resContext: Context, tag: String, composeTestRule: AndroidComposeTestRule<ActivityScenarioRule<MainActivity>, MainActivity>) {
|
||||
// Note: increased timeout limit to satisfy time needed for SDK initialization
|
||||
composeTestRule.waitUntil(2_000) { composeTestRule.activity.walletViewModel.addresses.value != null }
|
||||
composeTestRule.waitUntil(3_000) { composeTestRule.activity.walletViewModel.addresses.value != null }
|
||||
|
||||
composeTestRule.onNode(hasText(resContext.getString(R.string.profile_title))).also {
|
||||
it.assertExists()
|
||||
|
|
Loading…
Reference in New Issue