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

feat: add --force option to forc-wallet new #148

Merged
merged 24 commits into from
Dec 12, 2023

Conversation

levisyin
Copy link
Contributor

close #146

Copy link
Member

@kayagokalp kayagokalp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of suggestions for the code. Also I am a little worried as this is a pretty destructive and dangerous operation maybe we shouldn't offer it at all, and force people to remove their wallets explicitly, but happy to see this implemented as well. cc @sdankel

src/import.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
@kayagokalp kayagokalp added the enhancement New feature or request label Nov 27, 2023
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/new.rs Show resolved Hide resolved
@levisyin
Copy link
Contributor Author

@sdankel @kayagokalp GM sir, looking forward for review of the changed code😀

Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is shaping up nicely, but where are the test cases? 😄

src/import.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/new.rs Outdated Show resolved Hide resolved
src/import.rs Outdated Show resolved Hide resolved
src/new.rs Outdated Show resolved Hide resolved
src/new.rs Outdated Show resolved Hide resolved
@levisyin
Copy link
Contributor Author

This is shaping up nicely, but where are the test cases? 😄

Sorry for this, I missed your comment about the test example, I will do it later.

Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few more suggestions. Thanks!

src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/new.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/main.rs Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Outdated Show resolved Hide resolved
src/utils.rs Show resolved Hide resolved
levisyin and others added 5 commits December 5, 2023 09:29
Co-authored-by: Sophie Dankel <[email protected]>
Co-authored-by: Sophie Dankel <[email protected]>
Co-authored-by: Sophie Dankel <[email protected]>
Co-authored-by: Sophie Dankel <[email protected]>
@levisyin levisyin requested a review from kayagokalp December 8, 2023 01:20
@levisyin
Copy link
Contributor Author

@kayagokalp Hi sir, could you please help me to review the latest code, or can we merge this pr now?

Copy link
Member

@kayagokalp kayagokalp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, left a single nit but not a blocker.

));
let mut need_replace = String::new();
reader.read_line(&mut need_replace).unwrap();
if need_replace.trim() == "y" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if need_replace.trim() == "y" {
if need_replace.trim().to_lowercase() == "y" {

Nothing to block but we may want to cast to lowercase first, so that both Y and y is accepted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's pretty standard that the user has to match the case to choose the non-default option. Any other keypress is equivalent to selecting the default.

@sdankel sdankel merged commit 36ecad0 into FuelLabs:master Dec 12, 2023
10 checks passed
@levisyin levisyin deleted the feat/force-wallet-new branch December 13, 2023 00:35
JoshuaBatty pushed a commit that referenced this pull request Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a --force option to forc wallet new
3 participants