Skip to content

Commit

Permalink
Removed voteplan unused file, Implemented basic command structure and…
Browse files Browse the repository at this point in the history
… fixed compilation errors and import warnings
  • Loading branch information
Daniel Sanchez Quiros committed May 11, 2021
1 parent 9324a76 commit c2564e7
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
2 changes: 2 additions & 0 deletions catalyst-toolbox-cli/src/cli/mod.rs
Expand Up @@ -28,6 +28,7 @@ pub enum CatalystCommand {
/// Rewards related operations
Rewards(rewards::Rewards),
PushNotification(notifications::PushNotifications),
Recover(recovery::Recover),
}

impl Cli {
Expand All @@ -52,6 +53,7 @@ impl CatalystCommand {
match self {
Rewards(rewards) => rewards.exec()?,
PushNotification(notifications) => notifications.exec()?,
Recover(recover) => recover.exec()?,
};
Ok(())
}
Expand Down
18 changes: 18 additions & 0 deletions catalyst-toolbox-cli/src/cli/recovery/mod.rs
@@ -1 +1,19 @@
pub mod tally;

use structopt::StructOpt;

use crate::cli::recovery::tally::Error;

#[derive(StructOpt)]
#[structopt(rename_all = "kebab-case")]
pub enum Recover {
Tally(tally::Replay),
}

impl Recover {
pub fn exec(self) -> Result<(), Error> {
match self {
Recover::Tally(tally) => tally.exec(),
}
}
}
4 changes: 2 additions & 2 deletions catalyst-toolbox-cli/src/cli/recovery/tally/mockchain.rs
Expand Up @@ -3,7 +3,7 @@ use std::time::{Duration, SystemTime};

use super::Error;
use chain_addr::{Discrimination, Kind};
use chain_core::property::Fragment;
use chain_core::property::Fragment as _;
use chain_impl_mockchain::account::SpendingCounter;
use chain_impl_mockchain::block::HeaderId;
use chain_impl_mockchain::certificate::{VotePlan, VotePlanId};
Expand Down Expand Up @@ -164,7 +164,7 @@ pub fn recover_ledger_from_logs(
Some(new_fragment)
}
} else {
failed_fragments.push(fragment);
failed_fragments.push(fragment.clone());
None
}
}
Expand Down
17 changes: 15 additions & 2 deletions catalyst-toolbox-cli/src/cli/recovery/tally/mod.rs
@@ -1,7 +1,7 @@
pub(crate) mod mockchain;
pub(crate) mod voteplan;

use thiserror;
use std::path::PathBuf;
use structopt::StructOpt;

#[derive(thiserror::Error, Debug)]
pub enum Error {
Expand All @@ -26,3 +26,16 @@ pub enum Error {
range: std::ops::Range<i32>,
},
}

#[derive(StructOpt)]
#[structopt(rename_all = "kebab")]
pub struct Replay {
block0_path: PathBuf,
logs_path: PathBuf,
}

impl Replay {
pub fn exec(self) -> Result<(), Error> {
Ok(())
}
}
1 change: 0 additions & 1 deletion catalyst-toolbox-cli/src/cli/recovery/tally/voteplan.rs

This file was deleted.

0 comments on commit c2564e7

Please sign in to comment.