You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to create a new wallet for a user that already has one. In order to do that, first, I delete everything related to that wallet (stronghold file and DB) and after that, I proceed to create the new wallet. The first time it creates the wallet correctly. But if I repeat the process, i.e., delete the wallet and create a new one, the deletion is done successfully but in the creation, the following error appears: Error: can't create account: account alias already exists.
I found the following pull regarding the keeping of the accounts on the memory: #174
I am not sure if it has something to do with this issue.
Version
@iota/wallet: 1.0.17
Expected behaviour
The expected behaviour should be that the wallet is created correctly the second time as well, similarly to what happens with the first time the wallet is restored.
Actual behaviour
The second time the wallet is restored, the following error appears:
~/walletService/node_modules/@iota/wallet/lib/binding/accountManager.js:106
let acc = createAccount.apply(this.accountManager, [
^
Error: can't create account: account alias already exists
at AccountManager.createAccount (~/iota-for-iiot/walletService/node_modules/@iota/wallet/lib/binding/accountManager.js:106:33)
at createWallet (~/iota-for-iiot/walletService/walletRestoration.js:43:21)
at restoreWallet (~/iota-for-iiot/walletService/walletRestoration.js:11:32)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Can the issue reliably be reproduced?
Yes
Steps to reproduce the issue
walletRestoration.txt
PD: This should be a .js file but since GitHub doesn't support it, I uploaded it as a .txt file
Errors
~/iota-for-iiot/walletService/node_modules/@iota/wallet/lib/binding/accountManager.js:106
let acc = createAccount.apply(this.accountManager, [
^
Error: can't create account: account alias already exists
at AccountManager.createAccount (~/iota-for-iiot/walletService/node_modules/@iota/wallet/lib/binding/accountManager.js:106:33)
at createWallet (~/iota-for-iiot/walletService/walletRestoration.js:43:21)
at restoreWallet (~/iota-for-iiot/walletService/walletRestoration.js:11:32)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Duplicate declaration
I have searched the issues tracker this issue and there is none
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
thibault-martinez
changed the title
[Bug]: Account alias already exist error when there is no account
Account alias already exist error when there is no account
Mar 6, 2023
Hello, finally got time to do it
The accounts where still in memory, you can now import and call await dropAccountsAndStorages() to clean it up
Tested it with your example by adding it in removeDir()
Issue description
I am trying to create a new wallet for a user that already has one. In order to do that, first, I delete everything related to that wallet (stronghold file and DB) and after that, I proceed to create the new wallet. The first time it creates the wallet correctly. But if I repeat the process, i.e., delete the wallet and create a new one, the deletion is done successfully but in the creation, the following error appears:
Error: can't create account: account alias already exists
.I found the following pull regarding the keeping of the accounts on the memory: #174
I am not sure if it has something to do with this issue.
Version
@iota/wallet: 1.0.17
Expected behaviour
The expected behaviour should be that the wallet is created correctly the second time as well, similarly to what happens with the first time the wallet is restored.
Actual behaviour
The second time the wallet is restored, the following error appears:
Can the issue reliably be reproduced?
Yes
Steps to reproduce the issue
walletRestoration.txt
PD: This should be a .js file but since GitHub doesn't support it, I uploaded it as a .txt file
Errors
Duplicate declaration
Code of Conduct
The text was updated successfully, but these errors were encountered: