From 699f591113a2e0abffd584e89a45202eb70358e0 Mon Sep 17 00:00:00 2001 From: David Adegoke <64401859+Blazebrain@users.noreply.github.com> Date: Wed, 11 Dec 2024 20:26:13 +0100 Subject: [PATCH] fix: Tentative fix for transaction history items overlap across wallet types (#1864) --- cw_bitcoin/lib/electrum_transaction_history.dart | 5 ++++- cw_evm/lib/evm_chain_transaction_history.dart | 6 +++++- cw_nano/lib/nano_transaction_history.dart | 5 ++++- cw_solana/lib/solana_transaction_history.dart | 5 ++++- cw_tron/lib/tron_transaction_history.dart | 5 ++++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/cw_bitcoin/lib/electrum_transaction_history.dart b/cw_bitcoin/lib/electrum_transaction_history.dart index 658f83f8a..d096d0e7b 100644 --- a/cw_bitcoin/lib/electrum_transaction_history.dart +++ b/cw_bitcoin/lib/electrum_transaction_history.dart @@ -31,7 +31,10 @@ abstract class ElectrumTransactionHistoryBase String _password; int _height; - Future init() async => await _load(); + Future init() async { + clear(); + await _load(); + } @override void addOne(ElectrumTransactionInfo transaction) => transactions[transaction.id] = transaction; diff --git a/cw_evm/lib/evm_chain_transaction_history.dart b/cw_evm/lib/evm_chain_transaction_history.dart index c4d91783f..4a05746da 100644 --- a/cw_evm/lib/evm_chain_transaction_history.dart +++ b/cw_evm/lib/evm_chain_transaction_history.dart @@ -34,7 +34,10 @@ abstract class EVMChainTransactionHistoryBase //! Common methods across all child classes - Future init() async => await _load(); + Future init() async { + clear(); + await _load(); + } @override Future save() async { @@ -81,6 +84,7 @@ abstract class EVMChainTransactionHistoryBase _update(tx); } } + print('doneee'); } catch (e) { log(e.toString()); } diff --git a/cw_nano/lib/nano_transaction_history.dart b/cw_nano/lib/nano_transaction_history.dart index 7b4c5bc12..2b551ffa6 100644 --- a/cw_nano/lib/nano_transaction_history.dart +++ b/cw_nano/lib/nano_transaction_history.dart @@ -28,7 +28,10 @@ abstract class NanoTransactionHistoryBase extends TransactionHistoryBase init() async => await _load(); + Future init() async { + clear(); + await _load(); + } @override Future save() async { diff --git a/cw_solana/lib/solana_transaction_history.dart b/cw_solana/lib/solana_transaction_history.dart index 761753f06..62b9db8f7 100644 --- a/cw_solana/lib/solana_transaction_history.dart +++ b/cw_solana/lib/solana_transaction_history.dart @@ -26,7 +26,10 @@ abstract class SolanaTransactionHistoryBase extends TransactionHistoryBase init() async => await _load(); + Future init() async { + clear(); + await _load(); + } @override Future save() async { diff --git a/cw_tron/lib/tron_transaction_history.dart b/cw_tron/lib/tron_transaction_history.dart index 9d226c09c..c940c7708 100644 --- a/cw_tron/lib/tron_transaction_history.dart +++ b/cw_tron/lib/tron_transaction_history.dart @@ -25,7 +25,10 @@ abstract class TronTransactionHistoryBase extends TransactionHistoryBase init() async => await _load(); + Future init() async { + clear(); + await _load(); + } @override Future save() async {