From 36c25aaab9c6a06ad2e5000b5080eb021bd48669 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 8 Jun 2021 09:20:21 -0400 Subject: [PATCH] fix issue with calling getSettings; document issue --- .../api/architecture_development/common_errors.md | 10 ++++++++++ src/app/wallet/core.nim | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/devuser_guide/content/api/architecture_development/common_errors.md b/devuser_guide/content/api/architecture_development/common_errors.md index f79693ee4d..eb6998675a 100644 --- a/devuser_guide/content/api/architecture_development/common_errors.md +++ b/devuser_guide/content/api/architecture_development/common_errors.md @@ -78,6 +78,16 @@ If you are using an `Input` QML prop, to get the current value use `idName.TextF a common scenario this error can happen is when trying to immediatly access something in status-go when the app starts before the node is ready. it can also happen due to 2 threads attempting to call & change something from status-go at the same time +### Error: type mismatch: got <> but expected one of: + +Sometimes this can happen when using generics, it can be solved by either passing the parameters explicitily: + +`getSetting[string](self.status.settings, Setting.SigningPhrase)` + +or using typedesc param with `:` like: + +`self.status.settings.getSetting[:string](Setting.SigningPhrase)` + ## Warnings ### QML anchor warnings diff --git a/src/app/wallet/core.nim b/src/app/wallet/core.nim index f23e9a3861..9a2909d613 100644 --- a/src/app/wallet/core.nim +++ b/src/app/wallet/core.nim @@ -48,7 +48,7 @@ proc init*(self: WalletController) = self.status.events.on("assetChanged") do(e: Args): self.view.updateView() - self.view.setSigningPhrase(self.status.settings.getSetting[string](Setting.SigningPhrase)) + self.view.setSigningPhrase(self.status.settings.getSetting[:string](Setting.SigningPhrase)) self.view.setEtherscanLink(self.status.settings.getCurrentNetworkDetails().etherscanLink) self.status.events.on(SignalType.Wallet.event) do(e:Args):