Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
nuo-xu committed Dec 10, 2024
1 parent e8e6b7c commit fa80d09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ public class TransactionConfirmationStore: ObservableObject, WalletObserverStore
else { return nil }

let allTokens =
await blockchainRegistry.allTokens(chainId: network.chainId, coin: txInfo.coin) + tokenInfoCache
await blockchainRegistry.allTokens(chainId: network.chainId, coin: txInfo.coin)
+ tokenInfoCache
let userAssets = await assetManager.getAllUserAssetsInNetworkAssets(
networks: [network],
includingUserDeleted: true
Expand All @@ -396,16 +397,15 @@ public class TransactionConfirmationStore: ObservableObject, WalletObserverStore
var followUpAction = TransactionStatusStore.FollowUpAction.none
if case .ethSend(let detail) = activeParsedTransaction.details,
let fromValue = BDouble(detail.fromAmount),
fromValue == 0, activeTransaction.ethTxData.isEmpty
fromValue == 0, activeTransaction.ethTxData.isEmpty
{
// loop through allTx to find if there is a tx that has the same chain id, coin type, nonce and from address
// maxFeePerGas/gasPrice is smaller than this active tx
if let txInfo = allTxs.first(where: {
$0.id != activeTransaction.id &&
$0.coin == activeTransaction.coin &&
$0.chainId == activeTransaction.chainId &&
$0.ethTxNonce == activeTransaction.ethTxNonce &&
$0.fromAddress == activeTransaction.fromAddress
$0.id != activeTransaction.id && $0.coin == activeTransaction.coin
&& $0.chainId == activeTransaction.chainId
&& $0.ethTxNonce == activeTransaction.ethTxNonce
&& $0.fromAddress == activeTransaction.fromAddress
}), let parsedTx = await parseTransaction(txInfo) {
followUpAction = .cancel(toCancelParsedTx: parsedTx)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class TransactionStatusStore: ObservableObject, WalletObserverStore {
self.txServiceObserver = TxServiceObserver(
txService: txService,
_onNewUnapprovedTx: { _ in
// tx speed up and cancellation will be handled inside `TxConfirmationStore`
// tx speed up and cancellation will be handled inside `TxConfirmationStore`
},
_onUnapprovedTxUpdated: { _ in
// should only handle tx speed up and tx cancellation
Expand Down

0 comments on commit fa80d09

Please sign in to comment.