airgap-it / beacon-android-sdk

The beacon sdk allows Android developers of dApps and wallets on Tezos to implement the wallet interaction standard tzip-10.
https://walletbeacon.io
MIT License
10 stars 8 forks source link

Blockchain "tezos" could not be found. + StackOverflowError #5

Closed Deneath closed 2 years ago

Deneath commented 2 years ago

I have tried to connect to the following example app: https://andreasgassmann.github.io/apps/ I got an error:

java.lang.IllegalStateException: Blockchain "tezos" could not be found

After that I've tried to add tezos() blockchain to my BeaconWalletClient initialization like this:

BeaconWalletClient("Fearless Wallet", listOf(substrate(), tezos())) {
                addConnections(
                    P2P(p2pMatrix()),
                )
            }

and I've got a new error:


it.airgap.beaconsdk.core.exception.InternalException: Internal error
java.lang.StackOverflowError: stack size 8188KB

stack trace: https://www.toptal.com/developers/hastebin/enosejifog.http

jsamol commented 2 years ago

Thanks for reporting this! The issues were addressed and should be solved in the latest beta release 3.0.1-beta03.

Few things about Tezos not being found. Is it possible that the same app was ran and paired with an older example dApp that supported Tezos and, possibly, received a Tezos message that resulted in some Tezos structures being saved in the storage? I couldn't reproduce the said error with our demo app after fresh installation, but I noticed a similar behaviour after interacting with an example Tezos dApp and then disabling Tezos support and switching back to Substrate.

However, regardless of the reason, as of 3.0.1-beta03 it is now possible to configure BeaconWalletClient in a way it no longer fails when dealing with data belonging to an unsupported blockchain. You can set it by specifying the ignoreUnsupportedBlockchains flag value in the BeaconWalletClient builder method:

val walletClient = BeaconWalletClient("Fearless Wallet", listOf(substrate())) {
    // ...
    ignoreUnsupportedBlockchains = true
}

Please note that by default that flag is set to false. We want to keep it as a conscious decision whether to add support for missing blockchains or ignore them.