diff --git a/data/staking/src/main/java/com/tangem/data/staking/store/DefaultYieldsBalancesStore.kt b/data/staking/src/main/java/com/tangem/data/staking/store/DefaultYieldsBalancesStore.kt index 52a301247f..2f28162955 100644 --- a/data/staking/src/main/java/com/tangem/data/staking/store/DefaultYieldsBalancesStore.kt +++ b/data/staking/src/main/java/com/tangem/data/staking/store/DefaultYieldsBalancesStore.kt @@ -15,7 +15,7 @@ import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.firstOrNull -import kotlinx.coroutines.flow.mapNotNull +import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch internal typealias WalletIdWithWrappers = Map> @@ -55,7 +55,7 @@ internal class DefaultYieldsBalancesStore( } override fun get(userWalletId: UserWalletId): Flow> { - return runtimeStore.get().mapNotNull { it[userWalletId] } + return runtimeStore.get().map { it[userWalletId].orEmpty() } } override suspend fun getSyncOrNull(userWalletId: UserWalletId, stakingId: StakingID): YieldBalance? { diff --git a/data/staking/src/test/kotlin/com/tangem/data/staking/store/YieldsBalancesStoreGetMethodTest.kt b/data/staking/src/test/kotlin/com/tangem/data/staking/store/YieldsBalancesStoreGetMethodTest.kt index 7900b655e1..226824ea91 100644 --- a/data/staking/src/test/kotlin/com/tangem/data/staking/store/YieldsBalancesStoreGetMethodTest.kt +++ b/data/staking/src/test/kotlin/com/tangem/data/staking/store/YieldsBalancesStoreGetMethodTest.kt @@ -32,7 +32,8 @@ internal class YieldsBalancesStoreGetMethodTest { val values = getEmittedValues(flow = actual) - Truth.assertThat(values).isEqualTo(emptyList>()) + val expected = listOf(emptySet()) + Truth.assertThat(values).isEqualTo(expected) } @Test @@ -43,7 +44,8 @@ internal class YieldsBalancesStoreGetMethodTest { val values = getEmittedValues(flow = actual) - Truth.assertThat(values).isEqualTo(emptyList>()) + val expected = listOf(emptySet()) + Truth.assertThat(values).isEqualTo(expected) } @Test