From 0f9d29261a4fbe2fd42cd0443fabddd294f51115 Mon Sep 17 00:00:00 2001 From: Omar Date: Sat, 11 Jul 2026 05:31:59 +0300 Subject: [PATCH] await wallet saving minor CI fix --- .github/workflows/lint.yml | 6 ++++++ cw_core/lib/wallet_addresses.dart | 11 ++++++----- cw_core/lib/wallet_info.dart | 8 +++----- lib/utils/exception_handler.dart | 1 + 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bdcd36a4cc..e496201aa3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,6 +32,12 @@ jobs: api-level: [ 29 ] steps: + - name: Fix github actions messing up $HOME... + run: "echo HOME=/root | sudo tee -a $GITHUB_ENV" + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + - name: configure git run: | git config --global --add safe.directory '*' diff --git a/cw_core/lib/wallet_addresses.dart b/cw_core/lib/wallet_addresses.dart index ccbb8aa34d..765afaa583 100644 --- a/cw_core/lib/wallet_addresses.dart +++ b/cw_core/lib/wallet_addresses.dart @@ -71,11 +71,12 @@ abstract class WalletAddresses { Future saveAddressesInBox() async { try { walletInfo.address = address; - walletInfo.setAddresses(addressesMap); - walletInfo.setAddressInfos(addressInfos); - walletInfo.setUsedAddresses(usedAddresses.toList()); - walletInfo.setHiddenAddresses(hiddenAddresses.toList()); - walletInfo.setManualAddresses(manualAddresses.toList()); + // TODO: check if it will affect the performance of each wallet + await walletInfo.setAddresses(addressesMap); + await walletInfo.setAddressInfos(addressInfos); + await walletInfo.setUsedAddresses(usedAddresses.toList()); + await walletInfo.setHiddenAddresses(hiddenAddresses.toList()); + await walletInfo.setManualAddresses(manualAddresses.toList()); await walletInfo.save(); } catch (e) { diff --git a/cw_core/lib/wallet_info.dart b/cw_core/lib/wallet_info.dart index 5877ad2dab..a43bfa1541 100644 --- a/cw_core/lib/wallet_info.dart +++ b/cw_core/lib/wallet_info.dart @@ -428,11 +428,9 @@ class WalletInfo { Future setAddresses(Map addresses) async { await WalletInfoAddressMap.deleteByWalletInfoId(internalId); - final keys = addresses.keys.toList(); - final values = addresses.values.toList(); - // ToDo: check why the addresses list gets changed half way through - for (int i = 0; i < keys.length; i++) { - await WalletInfoAddressMap.insert(internalId, keys[i], values[i]); + final entries = addresses.entries.toList(); + for (final entry in entries) { + await WalletInfoAddressMap.insert(internalId, entry.key, entry.value); } } diff --git a/lib/utils/exception_handler.dart b/lib/utils/exception_handler.dart index abbef80cb1..7a048fed01 100644 --- a/lib/utils/exception_handler.dart +++ b/lib/utils/exception_handler.dart @@ -258,6 +258,7 @@ class ExceptionHandler { "Connection timed out", "Connection reset by peer", "Connection closed before full header was received", + "Connection closed while receiving data", "Connection terminated during handshake", "OS Error: Connection refused, errno = 61", "PERMISSION_NOT_GRANTED",