Skip to content

Commit

Permalink
Base cli command structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Sanchez Quiros committed Oct 14, 2021
1 parent 8450e25 commit 4dd82bc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/bin/cli/rewards/mod.rs
@@ -1,3 +1,4 @@
mod veterans;
mod voters;

use structopt::StructOpt;
Expand All @@ -17,12 +18,16 @@ pub enum Error {
pub enum Rewards {
/// Calculate rewards for voters base on their stake
Voters(voters::VotersRewards),

/// Calculate rewards for veteran community advisors
Veterans(veterans::VeteransRewards),
}

impl Rewards {
pub fn exec(self) -> Result<(), Error> {
match self {
Rewards::Voters(cmd) => cmd.exec(),
Rewards::Veterans(cmd) => cmd.exec(),
}
}
}
23 changes: 23 additions & 0 deletions src/bin/cli/rewards/veterans.rs
@@ -0,0 +1,23 @@
use super::Error;
use catalyst_toolbox::rewards::veterans;
use std::path::PathBuf;
use structopt::StructOpt;

#[derive(StructOpt)]
#[structopt(rename_all = "kebab-case")]
pub struct VotersRewards {
#[structopt(flatten)]
reviews: PathBuf,
/// Reward (in LOVELACE) to be distributed
#[structopt(long = "total-rewards")]
total_rewards: u64,
}

impl VotersRewards {
pub fn exec(self) -> Result<(), Error> {
let Self {
reviews,
total_rewards,
};
}
}

0 comments on commit 4dd82bc

Please sign in to comment.