Skip to content

Commit

Permalink
fix(Wallet) move deletion of pending transactions in nim
Browse files Browse the repository at this point in the history
Bump status-go HEAD that removes deletion of pending multi-transactions
in status-go

Previous implementation was relying on the fact that all pending
transactions are also multi-transactions, which it seems not to be
the case (e.g. ens, airdrop collectible)

Also tried to extend the deletion of multi-transactions to status go
but it was causing crashes for minted/dropped tokens.

Updates #10474
  • Loading branch information
stefandunca committed May 8, 2023
1 parent 110e5af commit 528bb53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/app_service/service/transaction/service.nim
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ QtObject:
return @[]

return toSeq(self.allTransactions[address].values)

proc watchTransactionResult*(self: Service, watchTxResult: string) {.slot.} =
let watchTxResult = parseJson(watchTxResult)
let success = watchTxResult["isSuccessfull"].getBool
Expand All @@ -183,7 +183,10 @@ QtObject:
let address = watchTxResult["address"].getStr
let transactionReceipt = transactions.getTransactionReceipt(chainId, hash).result
if transactionReceipt != nil and transactionReceipt.kind != JNull:
# Pending transaction will be deleted by backend after transfering multi-transaction info to history
# Delete pending transaction. Deleting it in status-go didn't work for all the cases
# TODO: make delete pending and save transaction atomc in status-go after fixing the crash
discard transactions.deletePendingTransaction(chainId, hash)

echo watchTxResult["data"].getStr
let ev = TransactionMinedArgs(
data: watchTxResult["data"].getStr,
Expand Down

0 comments on commit 528bb53

Please sign in to comment.