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

Fix subspace-node purge-chain command #1216

Merged
merged 1 commit into from Mar 5, 2023
Merged

Conversation

hazyone
Copy link

@hazyone hazyone commented Mar 4, 2023

This PR fixes problem #1215 for thesubspace-node.

As I realized, clap-rs made implicit ArgGroup creation, and PurgeChainCmd contains the same named struct in it:

pub struct PurgeChainCmd {
    /// The base struct of the purge-chain command.
    #[clap(flatten)]
    pub base: sc_cli::PurgeChainCmd,
}

So, as mentioned in the error description, we have to use #[group(skip)] to avoid this behavior.

After fixing the command works as desired:

 > ./subspace-node purge-chain -d nodee/ --chain gemini-3c

nodee/system/chains/subspace_gemini_3c_system_domain/paritydb/full
nodee/chains/subspace_gemini_3c/paritydb/full
Are you sure to remove? [y/N]: y
"nodee/system/chains/subspace_gemini_3c_system_domain/paritydb/full" did not exist.
"nodee/chains/subspace_gemini_3c/paritydb/full" removed.

...
> ls nodee/chains/subspace_gemini_3c/paritydb/full
ls: nodee/chains/subspace_gemini_3c/paritydb/full: No such file or directory

Code contributor checklist:

Copy link
Member

@nazar-pc nazar-pc left a comment

Choose a reason for hiding this comment

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

Makes sense to me, thanks!

@nazar-pc nazar-pc enabled auto-merge March 5, 2023 00:01
@nazar-pc nazar-pc merged commit 712d73f into subspace:main Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants