Accounts service is cleared if on NodeStopped signal
This commit is contained in:
parent
11cdd608f3
commit
72197f86f5
|
@ -48,6 +48,7 @@ method init*(self: Controller) =
|
|||
self.events.on(SignalType.NodeStopped.event) do(e:Args):
|
||||
echo "-NEW-EVENT-- NodeStopped: ", repr(e)
|
||||
self.events.emit("nodeStopped", Args())
|
||||
self.accountsService.clear()
|
||||
self.delegate.emitLogOut()
|
||||
|
||||
self.events.on(SignalType.NodeReady.event) do(e:Args):
|
||||
|
|
|
@ -58,6 +58,12 @@ method init*(self: Service) =
|
|||
except Exception as e:
|
||||
error "error: ", methodName="init", errName = e.name, errDesription = e.msg
|
||||
|
||||
method clear*(self: Service) =
|
||||
self.generatedAccounts = @[]
|
||||
self.loggedInAccount = AccountDto()
|
||||
self.importedAccount = GeneratedAccountDto()
|
||||
self.isFirstTimeAccountLogin = false
|
||||
|
||||
method validateMnemonic*(self: Service, mnemonic: string): string =
|
||||
try:
|
||||
let response = status_go_general.validateMnemonic(mnemonic)
|
||||
|
|
|
@ -48,4 +48,7 @@ method importMnemonic*(self: ServiceInterface, mnemonic: string): bool {.base.}
|
|||
|
||||
method login*(self: ServiceInterface, account: AccountDto, password: string):
|
||||
string {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method clear*(self: ServiceInterface) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
Loading…
Reference in New Issue