From 3da62c909245474335216656d52f594386e700af Mon Sep 17 00:00:00 2001 From: Sale Djenic Date: Tue, 8 Nov 2022 14:15:24 +0100 Subject: [PATCH] fix(@desktop/wallet): adding derived wallet account fixed An issue with adding wallet account was happening only for a new user, the reason for that was incorrectly set keystore path and keystore file couldn't be found on the statusgo side because of that. --- src/app_service/service/accounts/service.nim | 2 +- ui/app/AppLayouts/Wallet/popups/AddAccountModal.qml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app_service/service/accounts/service.nim b/src/app_service/service/accounts/service.nim index 0f7376476a..6efd9be632 100644 --- a/src/app_service/service/accounts/service.nim +++ b/src/app_service/service/accounts/service.nim @@ -345,6 +345,7 @@ proc setupAccount*(self: Service, accountId, password, displayName: string): str try: let installationId = $genUUID() var accountDataJson = self.getAccountDataForAccountId(accountId, displayName) + self.setKeyStoreDir(accountDataJson{"key-uid"}.getStr) # must be called before `getDefaultNodeConfig` let subaccountDataJson = self.getSubaccountDataForAccountId(accountId, displayName) var settingsJson = self.getAccountSettings(accountId, installationId, displayName) let nodeConfigJson = self.getDefaultNodeConfig(installationId) @@ -355,7 +356,6 @@ proc setupAccount*(self: Service, accountId, password, displayName: string): str error "error: ", procName="setupAccount", errDesription = description return description - self.setKeyStoreDir(accountDataJson{"key-uid"}.getStr) let hashedPassword = hashString(password) discard self.storeAccount(accountId, hashedPassword) discard self.storeDerivedAccounts(accountId, hashedPassword, PATHS) diff --git a/ui/app/AppLayouts/Wallet/popups/AddAccountModal.qml b/ui/app/AppLayouts/Wallet/popups/AddAccountModal.qml index 86b8bd8bc1..e6084d9315 100644 --- a/ui/app/AppLayouts/Wallet/popups/AddAccountModal.qml +++ b/ui/app/AppLayouts/Wallet/popups/AddAccountModal.qml @@ -96,10 +96,10 @@ StatusModal { && !!advancedSelection.expandableItem.mnemonicText) { RootStore.getDerivedAddressListForMnemonic(advancedSelection.expandableItem.mnemonicText, advancedSelection.expandableItem.path, numOfItems, pageNumber) - } else if(!!advancedSelection.expandableItem.path && !!advancedSelection.expandableItem.derivedFromAddress + } else if(!!d.selectedPath && !!d.selectedAccountDerivedFromAddress && (d.password.length > 0)) { - RootStore.getDerivedAddressList(d.password, advancedSelection.expandableItem.derivedFromAddress, - advancedSelection.expandableItem.path, numOfItems, pageNumber) + RootStore.getDerivedAddressList(d.password, d.selectedAccountDerivedFromAddress, + d.selectedPath, numOfItems, pageNumber) } }