Skip to content

Commit

Permalink
Add repeat transaction for testing high-load scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
keyvank committed Jun 14, 2023
1 parent ec258fd commit 575e194
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ enum WalletOptions {
amount: Decimal,
#[structopt(long, default_value = "0")]
fee: Decimal,
#[structopt(long, default_value = "1")]
repeat: usize,
},
/// Register your validator
RegisterValidator {
Expand Down Expand Up @@ -511,19 +513,22 @@ pub async fn initialize_cli() {
amount,
fee,
token_id,
repeat,
} => {
crate::cli::wallet::send(
memo,
from,
to,
amount,
fee,
token_id,
conf.expect(BAZUKA_NOT_INITILIZED),
wallet.expect(BAZUKA_NOT_INITILIZED),
&wallet_path,
)
.await;
for _ in 0..repeat {
crate::cli::wallet::send(
memo.clone(),
from.clone(),
to.clone(),
amount,
fee,
token_id.clone(),
conf.clone().expect(BAZUKA_NOT_INITILIZED),
wallet.clone().expect(BAZUKA_NOT_INITILIZED),
&wallet_path,
)
.await;
}
}
WalletOptions::Reset {} => {
crate::cli::wallet::reset(wallet.expect(BAZUKA_NOT_INITILIZED), &wallet_path);
Expand Down
2 changes: 2 additions & 0 deletions src/core/money.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pub enum ParseDecimalError {
#[error("amount invalid")]
Invalid,
}

#[derive(Clone, Copy)]
pub struct Decimal {
pub value: u64,
pub num_decimals: u8,
Expand Down

0 comments on commit 575e194

Please sign in to comment.