Updated on 2026-08-14

This commit is contained in:
Tangem 2025-05-20 15:13:47 +04:00
parent 33b7a53905
commit c5560c3c6a
101 changed files with 274 additions and 272 deletions

View file

@ -7,7 +7,10 @@ import com.tangem.domain.qrscanning.models.SourceType
import com.tangem.domain.qrscanning.repository.QrScanningEventsRepository
import com.tangem.domain.tokens.model.CryptoCurrency
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.yield
import java.math.BigDecimal
import java.net.URLDecoder
@ -87,7 +90,7 @@ internal class DefaultQrScanningEventsRepository : QrScanningEventsRepository {
}
private fun stripSchema(raw: String, currency: CryptoCurrency): String {
val qrSchemas = Blockchain.fromId(currency.network.id.value).getShareScheme()
val qrSchemas = Blockchain.fromId(currency.network.rawId).getShareScheme()
// The most specific (i.e. the most lengthy) prefixes always come first
qrSchemas

View file

@ -76,7 +76,7 @@ internal class DefaultQrScanningEventsRepositoryTest {
@Test
fun testBip021() {
every { network.id } returns Network.ID(Blockchain.Bitcoin.id)
every { network.rawId } returns Blockchain.Bitcoin.id
positiveCase(
"$schema1:$address1",
QrResult(address = address1),
@ -126,7 +126,7 @@ internal class DefaultQrScanningEventsRepositoryTest {
@Test
fun testErc681Coin() {
every { network.id } returns Network.ID(Blockchain.Ethereum.id)
every { network.rawId } returns Blockchain.Ethereum.id
positiveCase(
address2,
QrResult(address = address2),
@ -181,7 +181,7 @@ internal class DefaultQrScanningEventsRepositoryTest {
@Test
fun testErc681Token() {
every { network.id } returns Network.ID(Blockchain.Ethereum.id)
every { network.rawId } returns Blockchain.Ethereum.id
positiveCase(
address2,
QrResult(address = address2),