Updated on 2026-08-14
This commit is contained in:
parent
db6157cae4
commit
99f62f79ee
35 changed files with 128 additions and 109 deletions
|
|
@ -19,6 +19,7 @@ dependencies {
|
|||
implementation(projects.domain.tokens.models)
|
||||
|
||||
implementation(projects.core.ui)
|
||||
implementation(projects.libs.blockchainSdk)
|
||||
|
||||
/** SdK */
|
||||
implementation(tangemDeps.blockchain)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.tangem.data.qrscanning.repository
|
||||
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
import com.tangem.blockchainsdk.utils.toBlockchain
|
||||
import com.tangem.core.ui.utils.parseBigDecimalOrNull
|
||||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import com.tangem.domain.qrscanning.models.QrResult
|
||||
|
|
@ -90,7 +90,7 @@ internal class DefaultQrScanningEventsRepository : QrScanningEventsRepository {
|
|||
}
|
||||
|
||||
private fun stripSchema(raw: String, currency: CryptoCurrency): String {
|
||||
val qrSchemas = Blockchain.fromId(currency.network.rawId).getShareScheme()
|
||||
val qrSchemas = currency.network.toBlockchain().getShareScheme()
|
||||
|
||||
// The most specific (i.e. the most lengthy) prefixes always come first
|
||||
qrSchemas
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ internal class DefaultQrScanningEventsRepositoryTest {
|
|||
|
||||
@Test
|
||||
fun testBip021() {
|
||||
every { network.rawId } returns Blockchain.Bitcoin.id
|
||||
every { network.id.rawId.value } returns Blockchain.Bitcoin.id
|
||||
positiveCase(
|
||||
"$schema1:$address1",
|
||||
QrResult(address = address1),
|
||||
|
|
@ -126,7 +126,7 @@ internal class DefaultQrScanningEventsRepositoryTest {
|
|||
|
||||
@Test
|
||||
fun testErc681Coin() {
|
||||
every { network.rawId } returns Blockchain.Ethereum.id
|
||||
every { network.id.rawId.value } returns Blockchain.Ethereum.id
|
||||
positiveCase(
|
||||
address2,
|
||||
QrResult(address = address2),
|
||||
|
|
@ -181,7 +181,7 @@ internal class DefaultQrScanningEventsRepositoryTest {
|
|||
|
||||
@Test
|
||||
fun testErc681Token() {
|
||||
every { network.rawId } returns Blockchain.Ethereum.id
|
||||
every { network.id.rawId.value } returns Blockchain.Ethereum.id
|
||||
positiveCase(
|
||||
address2,
|
||||
QrResult(address = address2),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue