Updated on 2026-08-14
This commit is contained in:
parent
ff60ddae9f
commit
be43a77a08
9 changed files with 85 additions and 93 deletions
|
|
@ -19,6 +19,7 @@ dependencies {
|
|||
implementation(projects.domain.models)
|
||||
implementation(projects.domain.staking.models)
|
||||
implementation(projects.domain.tokens.models)
|
||||
implementation(projects.domain.txhistory.models)
|
||||
implementation(projects.domain.wallets)
|
||||
implementation(projects.domain.wallets.models)
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,64 @@
|
|||
package com.tangem.common.test.domain.walletmanager
|
||||
|
||||
import com.tangem.domain.txhistory.models.TxHistoryItem
|
||||
import com.tangem.domain.walletmanager.model.Address
|
||||
import com.tangem.domain.walletmanager.model.CryptoCurrencyAmount
|
||||
import com.tangem.domain.walletmanager.model.CryptoCurrencyTransaction
|
||||
import com.tangem.domain.walletmanager.model.UpdateWalletManagerResult
|
||||
import java.math.BigDecimal
|
||||
|
||||
/**
|
||||
[REDACTED_AUTHOR]
|
||||
*/
|
||||
class MockUpdateWalletManagerResultFactory {
|
||||
|
||||
fun createUnreachable(): UpdateWalletManagerResult {
|
||||
return UpdateWalletManagerResult.Unreachable(selectedAddress = null, addresses = null)
|
||||
}
|
||||
|
||||
fun createUnreachableWithAddress(): UpdateWalletManagerResult {
|
||||
return UpdateWalletManagerResult.Unreachable(
|
||||
selectedAddress = "0x1",
|
||||
addresses = setOf(Address(value = "0x1", type = Address.Type.Primary)),
|
||||
)
|
||||
}
|
||||
|
||||
fun createNoAccount(): UpdateWalletManagerResult {
|
||||
return UpdateWalletManagerResult.NoAccount(
|
||||
selectedAddress = "0x1",
|
||||
addresses = setOf(Address(value = "0x1", type = Address.Type.Primary)),
|
||||
amountToCreateAccount = BigDecimal.ZERO,
|
||||
errorMessage = "",
|
||||
)
|
||||
}
|
||||
|
||||
fun createVerified(): UpdateWalletManagerResult {
|
||||
return UpdateWalletManagerResult.Verified(
|
||||
selectedAddress = "0x1",
|
||||
addresses = setOf(Address(value = "0x1", type = Address.Type.Primary)),
|
||||
currenciesAmounts = setOf(
|
||||
CryptoCurrencyAmount.Coin(value = BigDecimal.ONE),
|
||||
),
|
||||
currentTransactions = setOf(
|
||||
CryptoCurrencyTransaction.Coin(txHistoryItem),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
private companion object {
|
||||
|
||||
val txHistoryItem = TxHistoryItem(
|
||||
txHash = "erroribus",
|
||||
timestampInMillis = 2771,
|
||||
isOutgoing = false,
|
||||
destinationType = TxHistoryItem.DestinationType.Single(
|
||||
addressType = TxHistoryItem.AddressType.User(address = "0x1"),
|
||||
),
|
||||
sourceType = TxHistoryItem.SourceType.Single(address = "0x2"),
|
||||
interactionAddressType = null,
|
||||
status = TxHistoryItem.TransactionStatus.Confirmed,
|
||||
type = TxHistoryItem.TransactionType.Transfer,
|
||||
amount = BigDecimal.ONE,
|
||||
)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue