chore(@dekstop/keycard): os sleep used in the past is not needed any more

This commit is contained in:
Sale Djenic 2023-11-30 14:08:22 +01:00 committed by saledjenic
parent 608bb38874
commit e7c4cd7c6c
7 changed files with 7 additions and 28 deletions

View File

@ -1,4 +1,4 @@
import stint, std/strutils, uuids, os
import stint, std/strutils, uuids
import ./io_interface
import app/core/signals/types
@ -457,9 +457,6 @@ proc connectKeycardReponseSignal(self: Controller) =
proc cancelCurrentFlow*(self: Controller) =
self.keycardService.cancelCurrentFlow()
# in most cases we're running another flow after canceling the current one,
# this way we're giving to the keycard some time to cancel the current flow
sleep(200)
proc runSignFlow(self: Controller, pin, path, dataToSign: string) =
self.cancelCurrentFlow()

View File

@ -1,4 +1,4 @@
import Tables, os, uuids, chronicles, json
import Tables, uuids, chronicles, json
import io_interface
import app/global/global_singleton
@ -196,9 +196,6 @@ proc connectKeycardReponseSignal(self: Controller) =
proc cancelCurrentFlow*(self: Controller) =
self.keycardService.cancelCurrentFlow()
# in most cases we're running another flow after canceling the current one,
# this way we're giving to the keycard some time to cancel the current flow
sleep(200)
proc runSignFlow*(self: Controller, pin, bip44Path, txHash: string) =
self.cancelCurrentFlow()

View File

@ -1,4 +1,4 @@
import Tables, os, uuids, stint, json
import Tables, uuids, stint, json
import ./io_interface
@ -212,9 +212,6 @@ proc connectKeycardReponseSignal(self: Controller) =
proc cancelCurrentFlow*(self: Controller) =
self.keycardService.cancelCurrentFlow()
# in most cases we're running another flow after canceling the current one,
# this way we're giving to the keycard some time to cancel the current flow
sleep(200)
proc runSignFlow*(self: Controller, pin, bip44Path, txHash: string) =
self.cancelCurrentFlow()

View File

@ -1,5 +1,5 @@
import sugar, sequtils, stint, json, json_serialization
import uuids, os, chronicles
import uuids, chronicles
import io_interface
import app_service/service/wallet_account/service as wallet_account_service
import app_service/service/network/service as network_service
@ -151,9 +151,6 @@ proc connectKeycardReponseSignal(self: Controller) =
proc cancelCurrentFlow*(self: Controller) =
self.keycardService.cancelCurrentFlow()
# in most cases we're running another flow after canceling the current one,
# this way we're giving to the keycard some time to cancel the current flow
sleep(200)
proc runSignFlow*(self: Controller, pin, bip44Path, txHash: string) =
self.cancelCurrentFlow()

View File

@ -1,4 +1,4 @@
import times, os, chronicles
import times, chronicles
import uuids
import io_interface
@ -224,9 +224,6 @@ proc connectKeycardReponseSignal(self: Controller) =
proc cancelCurrentFlow*(self: Controller) =
self.keycardService.cancelCurrentFlow()
# in most cases we're running another flow after canceling the current one,
# this way we're giving to the keycard some time to cancel the current flow
sleep(200)
proc fetchAddressesFromKeycard*(self: Controller, bip44Paths: seq[string]) =
self.cancelCurrentFlow()

View File

@ -1,4 +1,4 @@
import chronicles, tables, strutils, os, sequtils, sugar
import chronicles, tables, strutils, sequtils, sugar
import uuids
import io_interface
@ -491,9 +491,6 @@ proc cancelCurrentFlow*(self: Controller) =
if not serviceApplicable(self.keycardService):
return
self.keycardService.cancelCurrentFlow()
# in most cases we're running another flow after canceling the current one,
# this way we're giving to the keycard some time to cancel the current flow
sleep(200)
proc runGetAppInfoFlow*(self: Controller, factoryReset = false) =
if not serviceApplicable(self.keycardService):

View File

@ -1,4 +1,4 @@
import Tables, chronicles, strutils, os
import Tables, chronicles, strutils
import uuids
import io_interface
@ -534,9 +534,6 @@ proc getLastReceivedKeycardData*(self: Controller): tuple[flowType: string, flow
proc cancelCurrentFlow*(self: Controller) =
self.keycardService.cancelCurrentFlow()
# in most cases we're running another flow after canceling the current one,
# this way we're giving to the keycard some time to cancel the current flow
sleep(200)
proc runLoadAccountFlow*(self: Controller, seedPhraseLength = 0, seedPhrase = "", pin = "", puk = "", factoryReset = false) =
self.cancelCurrentFlow() # before running into any flow we're making sure that the previous flow is canceled