Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small test fix #931

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 36 additions & 27 deletions dex/interactor/src/dex_interact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,39 @@ impl DexInteract {
}

// Just for demo, still TODO
// #[cfg(test)]
// pub mod integration_tests {
// use crate::{dex_interact_cli::SwapArgs, pair, DexInteract};

// #[test]
// fn test_full_farm_scenario() {
// let rt = crate::tokio::runtime::Runtime::new().unwrap();

// rt.block_on(async {
// let mut dex_interact = DexInteract::init().await;
// dex_interact.register_wallets();
// let args = SwapArgs {
// amount: 10_000_000_000_000_000_000u128,
// min_amount: 1_000_000_000_000u128,
// };
// let result = pair::swap_tokens_fixed_input(&mut dex_interact, &args).await;
// println!("result {:#?}", result);
// // let args =PairArgs {
// // first_payment_amount: 0u128,
// // second_payment_amount: 0u128,
// // first_token_amount_min: 0u128,
// // second_token_amount_min: 0u128,
// // };
// // dex_interact.full_farm_scenario(&args).await;
// });
// }
// }
#[cfg(test)]
pub mod integration_tests {
use multiversx_sc_snippets::tokio;

use crate::{
dex_interact_cli::{AddArgs, SwapArgs},
pair, DexInteract,
};

#[tokio::test]
#[ignore = "run on demand"]
async fn test_swap() {
let mut dex_interact = DexInteract::init().await;
dex_interact.register_wallets();
let args = SwapArgs {
amount: 10_000_000_000_000_000_000u128,
min_amount: 1_000_000_000_000u128,
};
let result = pair::swap_tokens_fixed_input(&mut dex_interact, &args).await;
println!("result {:#?}", result);
}

#[tokio::test]
#[ignore = "run on demand"]
async fn test_full_farm_scenario() {
// initialize interactor
let mut dex_interact = DexInteract::init().await;
// test users
dex_interact.register_wallets();
// mock arguments
let args = AddArgs::default();

// runs a full farm scenario
dex_interact.full_farm_scenario(&args).await;
}
}
Loading