Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:tonkeeper/android into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
polstianka committed Jan 14, 2025
2 parents e1abfbe + b401e4f commit abe28f7
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,18 @@ class SendTransactionViewModel(

private val emulationReadyDate = AtomicLong(0)

var message: MessageBodyEntity? = null

init {
viewModelScope.launch(Dispatchers.IO) {
val tokens = getTokens()
val transfers = transfers(tokens.filter { it.isRequestMinting }, true)
val message = accountRepository.messageBody(wallet, request.validUntil, transfers)
val internalMessage = (forceRelayer || settingsRepository.batteryIsEnabledTx(wallet.accountId, batteryTransactionType))
try {
val transfers = transfers(tokens.filter { it.isRequestMinting }, true)
message = accountRepository.messageBody(wallet, request.validUntil, transfers)

val emulated = emulationUseCase(
message = message,
message = message!!,
useBattery = settingsRepository.batteryIsEnabledTx(wallet.accountId, batteryTransactionType),
forceRelayer = forceRelayer,
params = true
Expand Down Expand Up @@ -128,7 +131,7 @@ class SendTransactionViewModel(
}
} catch (e: Throwable) {
FirebaseCrashlytics.getInstance().recordException(APIException.Emulation(
boc = message.createSignedBody(EmptyPrivateKeyEd25519.invoke(), internalMessage).base64(),
boc = message?.createSignedBody(EmptyPrivateKeyEd25519.invoke(), internalMessage)?.base64() ?: "failed",
sourceUri = request.appUri,
cause = e
))
Expand Down

0 comments on commit abe28f7

Please sign in to comment.