From b6a23f55a131f6aeebb8a65c0a7ad8f08582fced Mon Sep 17 00:00:00 2001 From: Ivan Belyakov Date: Mon, 5 Jun 2023 10:36:42 +0200 Subject: [PATCH] feat(wallet/desktop): Enable sequential scheduler. Handle 'new transfers' event for activity view to load transactions. It is a temporary solution until integration of sequential transfer fetching is properly done with activity filter --- src/app_service/common/network_constants.nim | 3 ++- src/app_service/service/accounts/service.nim | 3 ++- src/app_service/service/transaction/service.nim | 11 +++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/app_service/common/network_constants.nim b/src/app_service/common/network_constants.nim index f1e43a4640..f9668cded1 100644 --- a/src/app_service/common/network_constants.nim +++ b/src/app_service/common/network_constants.nim @@ -396,7 +396,8 @@ var NODE_CONFIG* = %* { "420": ALCHEMY_OPTIMISM_GOERLI_TOKEN_RESOLVED }, "InfuraAPIKey": INFURA_TOKEN_RESOLVED, - "InfuraAPIKeySecret": INFURA_TOKEN_SECRET_RESOLVED + "InfuraAPIKeySecret": INFURA_TOKEN_SECRET_RESOLVED, + "LoadAllTransfers": true, }, "EnsConfig": { "Enabled": true diff --git a/src/app_service/service/accounts/service.nim b/src/app_service/service/accounts/service.nim index 572bad59d1..02daf00a46 100644 --- a/src/app_service/service/accounts/service.nim +++ b/src/app_service/service/accounts/service.nim @@ -661,7 +661,8 @@ QtObject: "420": ALCHEMY_OPTIMISM_GOERLI_TOKEN_RESOLVED }, "InfuraAPIKey": INFURA_TOKEN_RESOLVED, - "InfuraAPIKeySecret": INFURA_TOKEN_SECRET_RESOLVED + "InfuraAPIKeySecret": INFURA_TOKEN_SECRET_RESOLVED, + "LoadAllTransfers": true }, "TorrentConfig": { "Enabled": false, diff --git a/src/app_service/service/transaction/service.nim b/src/app_service/service/transaction/service.nim index b9472ae5a4..e9b060eb57 100644 --- a/src/app_service/service/transaction/service.nim +++ b/src/app_service/service/transaction/service.nim @@ -46,6 +46,7 @@ const SIGNAL_HISTORY_FETCHING* = "historyFetching" const SIGNAL_HISTORY_READY* = "historyReady" const SIGNAL_HISTORY_NON_ARCHIVAL_NODE* = "historyNonArchivalNode" const SIGNAL_HISTORY_ERROR* = "historyError" +const SIGNAL_NEW_TRANSFERS* = "newTransfers" const SIGNAL_CRYPTO_SERVICES_READY* = "cryptoServicesReady" const SIMPLE_TX_BRIDGE_NAME = "Simple" @@ -144,6 +145,16 @@ QtObject: self.events.emit(SIGNAL_HISTORY_NON_ARCHIVAL_NODE, Args()) of "fetching-history-error": self.events.emit(SIGNAL_HISTORY_ERROR, Args()) + of "new-transfers": + # TODO delete this, once activity filter is integrated + # with scheduler (Reactor) in status-go. + # It should handle proper updates of activity list. Proper + # handling of new and old transfers with current implementation + # requires lots of refactoring. + for account in data.accounts: + self.loadTransactions(account, stint.fromHex(Uint256, "0x0")) + + self.events.emit(SIGNAL_NEW_TRANSFERS, HistoryArgs(addresses: data.accounts)) proc getPendingTransactions*(self: Service): seq[TransactionDto] = try: