-
Notifications
You must be signed in to change notification settings - Fork 378
Add a command to purge the relay chain only #306
Conversation
Tested and working:
|
Commented on the issue |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move and also please write some tests for the command on its own.
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and please don't forget the tests 🙈 )
I'm on it. You're too fast |
Sorry :P |
There is an issue with the The other problem with this is that it is also impacting the Meanwhile I have a few questions:
One other (very far fetched) alternative would be to give a big thought about moving away from structopt and changing completely sc-cli's API to use clap directly. It's less declarative but this is actually a good thing in term of flexibility. We might be able to achieve more with less complexity. |
You should make yourself familiar what this command is doing. From the perspective of cumulus the
We used clap before and it was horrible :P Yeah, it is more flexible, but you also loose all your shit when you try to modify something or to add a new parameter. So, no switch. |
I know that very well but my problem is still there. I will try to explain better: When you run cumulus you can give a Unfortunately, because of limitations with structopt, I can't parse the arguments after What I can do to circumvent this issue:
(I'm mostly using the parameter |
Wait, there is already a parameter |
Or maybe just make |
Ok I get it, the relay chain is actually found from the parachain's extension. So I just fixed the test. @bkchr this is ready for review then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late review. Some last nitpicks, otherwise looks good.
cli/src/lib.rs
Outdated
.iter() | ||
.map(|x| { | ||
x.path().ok_or_else(|| { | ||
sc_cli::Error::Input("Cannot purge custom database implementation".into()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a hint which on this is, would be nice :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 670b674
@@ -15,50 +15,63 @@ | |||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>. | |||
|
|||
use assert_cmd::cargo::cargo_bin; | |||
use std::{convert::TryInto, fs, path::PathBuf, process::Command, thread, time::Duration}; | |||
use std::{convert::TryInto, process::Command, thread, time::Duration}; | |||
|
|||
mod common; | |||
|
|||
#[test] | |||
#[cfg(unix)] | |||
fn purge_chain_works() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be really nice to have these tests part of the /tests/
"parachain". But this can be done in a later pr.
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
|
||
let base_path = "purge_chain_test"; | ||
let base_path = tempfile::tempdir().unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cecton I'm curious why you did this after you already gave us the --tmp
flag in paritytech/substrate#6221
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I get it. So you can check the directory later on.
Fixes #259