Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add support for lotus wallet import to be idempotent #6562

Open
travisperson opened this issue Jun 22, 2021 · 0 comments
Open
Labels
kind/feature Kind: Feature

Comments

@travisperson
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When running lotus wallet import on a wallet that already exists in the targeted $LOTUS_PATH (importing the same wallet twice). The command exists with an error. This is helpful to remind users that they might have a short memory, but makes automation around importing wallets difficult and error prone because users either need to check that a wallet exists first by listing, or more commonly users will just throw a || true which is bug prone.

Describe the solution you'd like
To avoid breaking the current behaviour, adding a new boolean flag --no-error (default to false) which will cause the command to exit with no error and a status code of 0.

I also wouldn't be terribly opposed to just not returning an error if the address already exists as the outcome is the same as if it was not present.

Note: accepting flag name ideas

Additional context
The command lotus-shed keyinfo import also has this issue (I believe because there was no exported error to check against) so any fix to lotus wallet import should also be ported to lotus-shed keyinfo import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Kind: Feature
Projects
None yet
Development

No branches or pull requests

3 participants