Client - Importing accounts that are already imported shouldn't throw but be handled more gracefully
- Dominant language
- No language data
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
### Feature description
When importing accounts (which is required for certain operations) i dont think it should throw in case the account is already imported but instead just silently fail or return a boolean at most.
Currently the handling complexity is pushed downstream from miden client instead of miden client handling it.
### Why is this feature needed?
In rust and JS you need to manually check if account is already imported unless you want to deal with throwing.
In JS try/catch will still print an error (in case you dont wanna wrap with "if not already imported" block) into console from worker in case the account is already imported.
Im unsure if there is a use case when u want to throw in case the account is already imported. In case of miden apps, i dont see it.
Contributor guide
Research direction
Look at the client import account functions in Rust and JavaScript codebases. Identify where the error is thrown when an account already exists. Modify to handle duplicate imports gracefully, perhaps returning a boolean. Test by importing the same account twice to ensure no error is thrown.
Written by the indexing model from the issue text.
Assessment
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100