Updated on 2026-08-14

This commit is contained in:
Tangem 2023-01-18 18:05:18 +08:00
parent e98780ff93
commit 479d142807
283 changed files with 2338 additions and 2730 deletions

View file

@ -97,15 +97,12 @@ class TransactionManagerImpl(
private fun handleSendResult(result: SimpleResult): SendTxResult {
when (result) {
is SimpleResult.Success -> {
return SendTxResult.Success
}
is SimpleResult.Success -> return SendTxResult.Success
is SimpleResult.Failure -> {
val error = (result.error as? BlockchainSdkError) ?: return SendTxResult.UnknownError()
val error = result.error as? BlockchainSdkError ?: return SendTxResult.UnknownError()
when (error) {
is BlockchainSdkError.WrappedTangemError -> {
val tangemSdkError = (error.tangemError as? TangemSdkError)
?: return SendTxResult.UnknownError()
val tangemSdkError = error.tangemError as? TangemSdkError ?: return SendTxResult.UnknownError()
if (tangemSdkError is TangemSdkError.UserCancelled) return SendTxResult.UserCancelledError
return SendTxResult.TangemSdkError(tangemSdkError.code, tangemSdkError.cause)
}
@ -202,6 +199,5 @@ class TransactionManagerImpl(
companion object {
private const val HEX_PREFIX = "0x"
private const val DEFAULT_GAS_LIMIT = 300000L
}
}