Skip to content

Commit

Permalink
fix: migrate incorrect error print
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangsoledad committed Mar 24, 2021
1 parent 029b7bd commit 5c6dab6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ckb-bin/src/subcommand/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub fn migrate(args: MigrateArgs, async_handle: Handle) -> Result<(), ExitCode>
}
}

let (_shared, _table) = builder.build().map_err(|err| {
let (_shared, _table) = builder.consensus(args.consensus).build().map_err(|err| {
eprintln!("Run error: {:?}", err);
ExitCode::Failure
})?;
Expand Down
2 changes: 2 additions & 0 deletions util/app-config/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ pub struct PeerIDArgs {
pub struct MigrateArgs {
/// The parsed `ckb.toml.`
pub config: Box<CKBAppConfig>,
/// Loaded consensus.
pub consensus: Consensus,
/// Check whether it is required to do migration instead of really perform the migration.
pub check: bool,
/// Do migration without interactive prompt.
Expand Down
2 changes: 2 additions & 0 deletions util/app-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ impl Setup {

/// `migrate` subcommand has one `flags` arg, trigger this arg with "--check"
pub fn migrate<'m>(self, matches: &ArgMatches<'m>) -> Result<MigrateArgs, ExitCode> {
let consensus = self.consensus()?;
let config = self.config.into_ckb()?;
let check = matches.is_present(cli::ARG_MIGRATE_CHECK);
let force = matches.is_present(cli::ARG_FORCE);

Ok(MigrateArgs {
config,
consensus,
check,
force,
})
Expand Down

0 comments on commit 5c6dab6

Please sign in to comment.