kinecosystem/kin-android

Error using getBalanceSync() in compatibility mode

Closed this issue · 1 comments

kinAccount.getBalanceSync().value((0)) creates the following error:

org.kin.sdk.base.network.services.KinService$FatalError$PermanentlyUnavailable
    at org.kin.sdk.base.network.services.KinServiceImpl$createAccount$1$1.invoke(KinService.kt:217)
    at org.kin.sdk.base.network.services.KinServiceImpl$createAccount$1$1.invoke(KinService.kt:184)
    at org.kin.sdk.base.network.api.rest.DefaultHorizonKinAccountCreationApi.createAccount(DefaultHorizonKinAccountCreationApi.kt:27)
    at org.kin.sdk.base.network.services.KinServiceImpl$createAccount$1.invoke(KinService.kt:194)
    at org.kin.sdk.base.network.services.KinServiceImpl$createAccount$1.invoke(KinService.kt:184)
    at org.kin.sdk.base.tools.ExtensionsKt$queueWork$1$1.invoke(Extensions.kt:10)
    at org.kin.sdk.base.tools.ExtensionsKt$queueWork$1$1.invoke(Unknown Source:2)
    at org.kin.sdk.base.tools.NetworkOperationsHandlerImpl.runOperation(NetworkOperationsHandler.kt:230)
    at org.kin.sdk.base.tools.NetworkOperationsHandlerImpl.access$runOperation(NetworkOperationsHandler.kt:173)
    at org.kin.sdk.base.tools.NetworkOperationsHandlerImpl$schedule$1$1.run(NetworkOperationsHandler.kt:218)
kin.sdk.exception.OperationFailedException: org.kin.sdk.base.network.services.KinService$FatalError$PermanentlyUnavailable
    at kin.sdk.internal.KinAccountImpl.exceptionCorrectionIfNecessary(KinAccountImpl.kt:154)
    at kin.sdk.internal.KinAccountImpl.getBalanceSync(KinAccountImpl.kt:102)
    at io.peerbet.peerbet.KinWalletModule.getKinBalance(KinWalletModule.java:167)
Caused by: org.kin.sdk.base.network.services.KinService$FatalError$PermanentlyUnavailable
    at org.kin.sdk.base.network.services.KinServiceImpl$createAccount$1$1.invoke(KinService.kt:217)
    at org.kin.sdk.base.network.services.KinServiceImpl$createAccount$1$1.invoke(KinService.kt:184)
    at org.kin.sdk.base.network.api.rest.DefaultHorizonKinAccountCreationApi.createAccount(DefaultHorizonKinAccountCreationApi.kt:27)
    at org.kin.sdk.base.network.services.KinServiceImpl$createAccount$1.invoke(KinService.kt:194)
    at org.kin.sdk.base.network.services.KinServiceImpl$createAccount$1.invoke(KinService.kt:184)
    at org.kin.sdk.base.tools.ExtensionsKt$queueWork$1$1.invoke(Extensions.kt:10)
    at org.kin.sdk.base.tools.ExtensionsKt$queueWork$1$1.invoke(Unknown Source:2)
    at org.kin.sdk.base.tools.NetworkOperationsHandlerImpl.runOperation(NetworkOperationsHandler.kt:230)
    at org.kin.sdk.base.tools.NetworkOperationsHandlerImpl.access$runOperation(NetworkOperationsHandler.kt:173)
    at org.kin.sdk.base.tools.NetworkOperationsHandlerImpl$schedule$1$1.run(NetworkOperationsHandler.kt:218)

Upon investigating this we found that after importing an existing mainnet account it was possible to get into this state. The issue has been resolved in release 0.1.6. Thanks again for this submission.