Skip to content

Commit

Permalink
Removed modules for qr and stats that are now located in catalyst-too…
Browse files Browse the repository at this point in the history
…lbox project
  • Loading branch information
dkijania committed May 15, 2022
1 parent 6518240 commit 84613eb
Show file tree
Hide file tree
Showing 51 changed files with 234 additions and 1,582 deletions.
4 changes: 3 additions & 1 deletion iapyx/src/bin/iapyx-load.rs
@@ -1,4 +1,6 @@
use iapyx::cli::args::load::IapyxLoadCommand;
mod load;

use load::IapyxLoadCommand;
use structopt::StructOpt;

pub fn main() {
Expand Down
6 changes: 0 additions & 6 deletions iapyx/src/bin/iapyx-qr.rs

This file was deleted.

7 changes: 0 additions & 7 deletions iapyx/src/bin/iapyx-stats.rs

This file was deleted.

5 changes: 3 additions & 2 deletions iapyx/src/bin/iapyx.rs
@@ -1,5 +1,6 @@
use iapyx::cli::args::interactive::CliController;
use iapyx::cli::args::interactive::IapyxCommand;
mod interactive;

use interactive::{CliController, IapyxCommand};
use structopt::StructOpt;

pub fn main() {
Expand Down
@@ -1,9 +1,11 @@
use crate::cli::args::interactive::CliController;
use super::CliController;
use bech32::ToBase32;
use catalyst_toolbox::kedqr::decode;
use catalyst_toolbox::kedqr::KeyQrCode;
use catalyst_toolbox::kedqr::KeyQrCodeError;
use chain_impl_mockchain::block::BlockDate;
use iapyx::ControllerBuilderError;
use iapyx::ControllerError;
use jcli_lib::key::read_bech32;
use jormungandr_automation::jormungandr::RestError;
use jormungandr_lib::crypto::hash::Hash;
Expand Down Expand Up @@ -314,32 +316,24 @@ impl BatchOfVotes {
#[allow(clippy::large_enum_variant)]
#[derive(Error, Debug)]
pub enum IapyxCommandError {
#[error("{0}")]
GeneralError(String),
#[error(transparent)]
ControllerError(#[from] crate::controller::ControllerError),
ControllerError(#[from] ControllerError),
#[error(transparent)]
Inner(#[from] thor::cli::Error),
#[error(transparent)]
CannotParseChoicesString(#[from] serde_json::Error),
#[error("no valid until defined")]
NoValidUntilDefined,
#[error("wallet not recovered or generated")]
WalletNotRecovered,
#[error("wrong choice: {0}")]
WrongChoice(String),
#[error("cannot find proposal: {0}")]
CannotFindProposal(String),
#[error(transparent)]
ControllerBuilder(#[from] crate::controller::ControllerBuilderError),
ControllerBuilder(#[from] ControllerBuilderError),
#[error(transparent)]
Hash(#[from] chain_crypto::hash::Error),
#[error(transparent)]
Image(#[from] image::ImageError),
#[error(transparent)]
Controller(#[from] crate::cli::args::interactive::Error),
#[error("there is no default alias defined in config nor provided as argument")]
AliasNotDefined,
Controller(#[from] super::Error),
#[error(transparent)]
Bech32(#[from] bech32::Error),
#[error(transparent)]
Expand Down
@@ -1,13 +1,13 @@
mod command;

use crate::Controller;
use crate::Wallet;
use bech32::u5;
use bech32::FromBase32;
use chain_impl_mockchain::block::BlockDate;
use chain_impl_mockchain::fragment::FragmentId;
use cocoon::Cocoon;
pub use command::{IapyxCommand, IapyxCommandError};
use iapyx::Controller;
use iapyx::Wallet;
use jormungandr_automation::jormungandr::RestError;
use jormungandr_lib::interfaces::AccountState;
use jormungandr_lib::interfaces::AccountVotes;
Expand All @@ -27,6 +27,7 @@ use valgrind::SettingsExtensions;
use valgrind::ValgrindClient;
use wallet_core::Choice;
use wallet_core::Value;

pub struct CliController {
pub inner: ThorCliController,
pub backend_client: ValgrindClient,
Expand Down Expand Up @@ -140,21 +141,6 @@ impl CliController {
self.inner.votes_history().map_err(Into::into)
}

pub fn vote_for(
&mut self,
vote_plan_id: String,
proposal_index: u32,
choice: u8,
password: &str,
) -> Result<FragmentId, Error> {
let id = self
.controller(password)?
.vote_for(vote_plan_id, proposal_index, choice)?;
let template = self.inner.wallets_mut().wallet_mut()?;
template.pending_tx.push(id.into());
Ok(id)
}

pub fn vote(
&mut self,
proposal: &Proposal,
Expand Down Expand Up @@ -194,12 +180,8 @@ pub enum Error {
Config(#[from] thor::cli::ConfigError),
#[error(transparent)]
Inner(#[from] thor::cli::Error),
#[error("cannot connect to backend under address: {0}, due to: {1:?}")]
Connection(String, valgrind::Error),
#[error("cannot serialize secret key")]
CannotrSerializeSecretKey(#[from] bincode::ErrorKind),
#[error("cannot read secret key")]
CannotReadSecretKey,
#[error(transparent)]
Bincode(#[from] Box<bincode::ErrorKind>),
#[error("cannot read/write secret key")]
Expand All @@ -209,9 +191,9 @@ pub enum Error {
#[error(transparent)]
Backend(#[from] RestError),
#[error(transparent)]
Controller(#[from] crate::controller::ControllerError),
Controller(#[from] iapyx::ControllerError),
#[error(transparent)]
Wallet(#[from] crate::wallet::Error),
Wallet(#[from] iapyx::WalletError),
#[error(transparent)]
Read(#[from] chain_core::property::ReadError),
}
Expand Down
@@ -1,7 +1,5 @@
use crate::cli::args::load::build_monitor;
use crate::cli::args::load::IapyxLoadCommandError;
use crate::load::NodeLoad;
use crate::load::NodeLoadConfig;
use crate::load::{build_monitor, IapyxLoadCommandError};
use iapyx::{NodeLoad, NodeLoadConfig};
pub use jortestkit::console::progress_bar::{parse_progress_bar_mode_from_str, ProgressBarMode};
use jortestkit::load::ConfigurationBuilder;
use std::path::PathBuf;
Expand Down
@@ -1,7 +1,7 @@
use crate::cli::args::load::build_monitor;
use crate::cli::args::load::IapyxLoadCommandError;
use crate::load::NodeLoad;
use crate::load::NodeLoadConfig;
use crate::load::build_monitor;
use crate::load::IapyxLoadCommandError;
use iapyx::NodeLoad;
use iapyx::NodeLoadConfig;
pub use jortestkit::console::progress_bar::{parse_progress_bar_mode_from_str, ProgressBarMode};
use jortestkit::load::ConfigurationBuilder;
use std::path::PathBuf;
Expand Down
@@ -1,7 +1,7 @@
mod count;
mod duration;

use crate::cli::args::load::IapyxLoadCommandError;
use crate::load::IapyxLoadCommandError;
pub use count::BurstCountIapyxLoadCommand;
pub use duration::BurstDurationIapyxLoadCommand;
use structopt::StructOpt;
Expand Down
@@ -1,7 +1,7 @@
use crate::cli::args::load::build_monitor;
use crate::cli::args::load::IapyxLoadCommandError;
use crate::load::NodeLoad;
use crate::load::NodeLoadConfig;
use crate::load::build_monitor;
use crate::load::IapyxLoadCommandError;
use iapyx::NodeLoad;
use iapyx::NodeLoadConfig;
pub use jortestkit::console::progress_bar::{parse_progress_bar_mode_from_str, ProgressBarMode};
use jortestkit::load::ConfigurationBuilder;
use std::path::PathBuf;
Expand Down
@@ -1,7 +1,7 @@
use crate::cli::args::load::build_monitor;
use crate::cli::args::load::IapyxLoadCommandError;
use crate::load::NodeLoad;
use crate::load::NodeLoadConfig;
use crate::load::build_monitor;
use crate::load::IapyxLoadCommandError;
use iapyx::NodeLoad;
use iapyx::NodeLoadConfig;
pub use jortestkit::console::progress_bar::{parse_progress_bar_mode_from_str, ProgressBarMode};
use jortestkit::load::ConfigurationBuilder;
use std::path::PathBuf;
Expand Down
@@ -1,7 +1,7 @@
mod count;
mod duration;

use crate::cli::args::load::IapyxLoadCommandError;
use crate::load::IapyxLoadCommandError;
pub use count::ConstantCountIapyxLoadCommand;
pub use duration::ConstDurationIapyxLoadCommand;
use structopt::StructOpt;
Expand Down
11 changes: 6 additions & 5 deletions iapyx/src/cli/args/load/mod.rs → iapyx/src/bin/load/mod.rs
@@ -1,9 +1,12 @@
mod burst;
mod constant;

use crate::load::{ArtificialUserLoad, MultiControllerError, NodeLoadError, ServicingStationLoad};
use burst::BurstIapyxLoadCommand;
use constant::ConstIapyxLoadCommand;
use iapyx::ArtificialUserLoad;
use iapyx::MultiControllerError;
use iapyx::NodeLoadError;
use iapyx::ServicingStationLoad;
pub use jortestkit::console::progress_bar::{parse_progress_bar_mode_from_str, ProgressBarMode};
use jortestkit::load::Monitor;
use std::path::PathBuf;
Expand All @@ -12,18 +15,16 @@ use thiserror::Error;

#[derive(Error, Debug)]
pub enum IapyxLoadCommandError {
#[error("duration or requests per thread stategy has to be defined")]
NoStrategyDefined,
#[error("load runner error")]
NodeLoadError(#[from] NodeLoadError),
#[error("internal error")]
MultiControllerError(#[from] MultiControllerError),
#[error("serialize error")]
SerializeError(#[from] serde_json::Error),
#[error("servicing station error")]
ServicingStationError(#[from] crate::load::ServicingStationLoadError),
ServicingStationError(#[from] iapyx::ServicingStationLoadError),
#[error("artificial users error")]
ArtificialUserError(#[from] crate::load::ArtificialUserLoadError),
ArtificialUserError(#[from] iapyx::ArtificialUserLoadError),
#[error(transparent)]
Io(#[from] std::io::Error),
}
Expand Down
4 changes: 0 additions & 4 deletions iapyx/src/cli/args/mod.rs

This file was deleted.

88 changes: 0 additions & 88 deletions iapyx/src/cli/args/qr/address.rs

This file was deleted.

39 changes: 0 additions & 39 deletions iapyx/src/cli/args/qr/mod.rs

This file was deleted.

0 comments on commit 84613eb

Please sign in to comment.