diff --git a/release-notes.md b/release-notes.md index 0a47ca93d..9297f8343 100644 --- a/release-notes.md +++ b/release-notes.md @@ -5,11 +5,13 @@ All notable changes in this release are listed below. ## [Unreleased] ### New Features + - Test screen for developers is now available [#815](https://github.com/Adamant-im/adamant-im/pull/815) — [@Linhead](https://github.com/Linhead) - Universal macOS build added [#840](https://github.com/Adamant-im/adamant-im/pull/840) — [@S-FrontendDev](https://github.com/S-FrontendDev) - Release notes file added [#853](https://github.com/Adamant-im/adamant-im/pull/853) — [@S-FrontendDev](https://github.com/S-FrontendDev) ### Improvements + - APK name changed in GitHub workflow [#839](https://github.com/Adamant-im/adamant-im/pull/839) — [@S-FrontendDev](https://github.com/S-FrontendDev) - Wallets UI updated for better usability [#846](https://github.com/Adamant-im/adamant-im/pull/846) — [@Linhead](https://github.com/Linhead), [@adamant-al](https://github.com/adamant-al) - ESLint updated to improve code quality [#849](https://github.com/Adamant-im/adamant-im/pull/849) — [@graycraft](https://github.com/graycraft) @@ -17,7 +19,9 @@ All notable changes in this release are listed below. - GitHub Actions workflow and Husky postinstall git hook for ESLint [#858](https://github.com/Adamant-im/adamant-im/pull/858) — [@graycraft](https://github.com/graycraft) ### Bug Fixes + - Transaction fee calculation for ETH & ERC20 fixed [#805](https://github.com/Adamant-im/adamant-im/pull/805) — [@Linhead](https://github.com/Linhead) - Layout issue on "Export keys" page fixed [#841](https://github.com/Adamant-im/adamant-im/pull/841) — [@kalpovskii](https://github.com/kalpovskii), [@adamant-al](https://github.com/adamant-al) - Add disabled input field in the Welcome to ADAMANT chat, impoved paddings [#842](https://github.com/Adamant-im/adamant-im/pull/842) — [@kalpovskii](https://github.com/kalpovskii) - Resolve source code issues with ESLint 9 [#852](https://github.com/Adamant-im/adamant-im/pull/852) — [@graycraft](https://github.com/graycraft) +- Fixed status rejected BTC dust transactions in chat when node validation fails [#857](https://github.com/Adamant-im/adamant-im/pull/857) — [@Linhead](https://github.com/Linhead) diff --git a/src/hooks/queries/transaction/useBtcTransactionQuery.ts b/src/hooks/queries/transaction/useBtcTransactionQuery.ts index 9631ebef7..5ddc09ac8 100644 --- a/src/hooks/queries/transaction/useBtcTransactionQuery.ts +++ b/src/hooks/queries/transaction/useBtcTransactionQuery.ts @@ -27,7 +27,14 @@ export function useBtcTransactionQuery( return pendingTransaction } }, - retry: retryFactory(Cryptos.BTC, unref(transactionId)), + retry: (failureCount: number): boolean => { + // Don't retry dust amount BTC transactions + const dustedIds = store.state.btc.dustedTransactionsIds || [] + if (dustedIds.includes(unref(transactionId))) { + return false + } + return retryFactory(Cryptos.BTC, unref(transactionId))(failureCount) + }, retryDelay: retryDelayFactory(Cryptos.BTC, unref(transactionId)), refetchInterval: ({ state }) => refetchIntervalFactory(Cryptos.BTC, state.status, state.data), refetchOnWindowFocus: false, diff --git a/src/hooks/queries/transaction/useDashTransactionQuery.ts b/src/hooks/queries/transaction/useDashTransactionQuery.ts index fbe9f8ca7..7ea4e8bb7 100644 --- a/src/hooks/queries/transaction/useDashTransactionQuery.ts +++ b/src/hooks/queries/transaction/useDashTransactionQuery.ts @@ -27,7 +27,14 @@ export function useDashTransactionQuery( return pendingTransaction } }, - retry: retryFactory(Cryptos.DASH, unref(transactionId)), + retry: (failureCount: number): boolean => { + // Don't retry dust amount DASH transactions + const dustedIds = store.state.dash.dustedTransactionsIds || [] + if (dustedIds.includes(unref(transactionId))) { + return false + } + return retryFactory(Cryptos.DASH, unref(transactionId))(failureCount) + }, retryDelay: retryDelayFactory(Cryptos.DASH, unref(transactionId)), refetchInterval: ({ state }) => refetchIntervalFactory(Cryptos.DASH, state.status, state.data), refetchOnWindowFocus: false, diff --git a/src/hooks/queries/transaction/useDogeTransactionQuery.ts b/src/hooks/queries/transaction/useDogeTransactionQuery.ts index a83fa6b32..ee6e9ac4a 100644 --- a/src/hooks/queries/transaction/useDogeTransactionQuery.ts +++ b/src/hooks/queries/transaction/useDogeTransactionQuery.ts @@ -27,7 +27,14 @@ export function useDogeTransactionQuery( return pendingTransaction } }, - retry: retryFactory(Cryptos.DOGE, unref(transactionId)), + retry: (failureCount: number): boolean => { + // Don't retry dust amount DOGE transactions + const dustedIds = store.state.doge.dustedTransactionsIds || [] + if (dustedIds.includes(unref(transactionId))) { + return false + } + return retryFactory(Cryptos.DOGE, unref(transactionId))(failureCount) + }, retryDelay: retryDelayFactory(Cryptos.DOGE, unref(transactionId)), refetchInterval: ({ state }) => refetchIntervalFactory(Cryptos.DOGE, state.status, state.data), refetchOnWindowFocus: false, diff --git a/src/store/modules/btc-base/btc-base-actions.js b/src/store/modules/btc-base/btc-base-actions.js index d3698584b..92f340f43 100644 --- a/src/store/modules/btc-base/btc-base-actions.js +++ b/src/store/modules/btc-base/btc-base-actions.js @@ -231,7 +231,14 @@ function createActions(options) { return hash } catch (error) { + if ( + error.response?.data?.includes('dust') || + error.response?.data?.error?.message?.includes('dust') + ) { + context.commit('addDustedTransactionId', signedTransaction.txid) + } context.commit('transactions', [{ hash: signedTransaction.txid, status: 'REJECTED' }]) + PendingTxStore.remove(context.state.crypto) throw error } diff --git a/src/store/modules/btc-base/btc-base-mutations.js b/src/store/modules/btc-base/btc-base-mutations.js index f9ec4930b..f69ad8fa2 100644 --- a/src/store/modules/btc-base/btc-base-mutations.js +++ b/src/store/modules/btc-base/btc-base-mutations.js @@ -44,6 +44,10 @@ export default (initialState) => ({ }) }, + addDustedTransactionId(state, dustedTransactionId) { + state.dustedTransactionsIds.push(dustedTransactionId) + }, + areOlderLoading(state, areLoading) { state.areOlderLoading = areLoading }, diff --git a/src/store/modules/btc-base/btc-base-state.js b/src/store/modules/btc-base/btc-base-state.js index f201ab1a6..01de994cc 100644 --- a/src/store/modules/btc-base/btc-base-state.js +++ b/src/store/modules/btc-base/btc-base-state.js @@ -9,5 +9,6 @@ export default () => ({ areTransactionsLoading: false, areRecentLoading: false, areOlderLoading: false, - bottomReached: false + bottomReached: false, + dustedTransactionsIds: [] })