Skip to content

Commit

Permalink
Generates Rust integration tests
Browse files Browse the repository at this point in the history
Generates Rust integration tests based on scenarios provided in the scenarios folder of each contract.
  • Loading branch information
CostinCarabas committed Dec 21, 2023
1 parent 8c1438e commit 7c02b14
Show file tree
Hide file tree
Showing 56 changed files with 440 additions and 178 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
use multiversx_sc_scenario::*;

fn world() -> ScenarioWorld {
ScenarioWorld::vm_go()
}

#[test]
fn add_wrapped_token_go() {
world().run("scenarios/add_wrapped_token.scen.json");
}

#[test]
fn blacklist_token_go() {
world().run("scenarios/blacklist_token.scen.json");
}

#[test]
fn remove_wrapped_token_go() {
world().run("scenarios/remove_wrapped_token.scen.json");
}

#[test]
fn setup_go() {
world().run("scenarios/setup.scen.json");
}

#[test]
fn unwrap_token_go() {
world().run("scenarios/unwrap_token.scen.json");
}

#[test]
fn whitelist_token_go() {
world().run("scenarios/whitelist_token.scen.json");
}

#[test]
fn wrap_token_go() {
world().run("scenarios/wrap_token.scen.json");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
use multiversx_sc_scenario::*;

fn world() -> ScenarioWorld {
todo!()
}

#[test]
fn add_wrapped_token_rs() {
world().run("scenarios/add_wrapped_token.scen.json");
}

#[test]
fn blacklist_token_rs() {
world().run("scenarios/blacklist_token.scen.json");
}

#[test]
fn remove_wrapped_token_rs() {
world().run("scenarios/remove_wrapped_token.scen.json");
}

#[test]
fn setup_rs() {
world().run("scenarios/setup.scen.json");
}

#[test]
fn unwrap_token_rs() {
world().run("scenarios/unwrap_token.scen.json");
}

#[test]
fn whitelist_token_rs() {
world().run("scenarios/whitelist_token.scen.json");
}

#[test]
fn wrap_token_rs() {
world().run("scenarios/wrap_token.scen.json");
}
29 changes: 0 additions & 29 deletions bridged-tokens-wrapper/tests/scenario_go_test.rs

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
85 changes: 85 additions & 0 deletions esdt-safe/tests/esdt_safe_scenario_go_test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
use multiversx_sc_scenario::*;

fn world() -> ScenarioWorld {
ScenarioWorld::vm_go()
}

#[test]
fn add_refund_batch_go() {
world().run("scenarios/add_refund_batch.scen.json");
}

#[test]
fn create_another_tx_ok_go() {
world().run("scenarios/create_another_tx_ok.scen.json");
}

#[test]
fn create_another_tx_too_late_for_batch_go() {
world().run("scenarios/create_another_tx_too_late_for_batch.scen.json");
}

#[test]
fn create_transaction_ok_go() {
world().run("scenarios/create_transaction_ok.scen.json");
}

#[test]
fn create_transaction_over_max_amount_go() {
world().run("scenarios/create_transaction_over_max_amount.scen.json");
}

#[test]
fn distribute_fees_go() {
world().run("scenarios/distribute_fees.scen.json");
}

#[test]
fn execute_batch_both_rejected_go() {
world().run("scenarios/execute_batch_both_rejected.scen.json");
}

#[test]
fn execute_batch_both_success_go() {
world().run("scenarios/execute_batch_both_success.scen.json");
}

#[test]
fn execute_batch_one_success_one_rejected_go() {
world().run("scenarios/execute_batch_one_success_one_rejected.scen.json");
}

#[test]
fn execute_transaction_rejected_go() {
world().run("scenarios/execute_transaction_rejected.scen.json");
}

#[test]
fn execute_transaction_success_go() {
world().run("scenarios/execute_transaction_success.scen.json");
}

#[test]
fn get_next_pending_tx_go() {
world().run("scenarios/get_next_pending_tx.scen.json");
}

#[test]
fn get_next_tx_batch_go() {
world().run("scenarios/get_next_tx_batch.scen.json");
}

#[test]
fn get_next_tx_batch_too_early_go() {
world().run("scenarios/get_next_tx_batch_too_early.scen.json");
}

#[test]
fn setup_accounts_go() {
world().run("scenarios/setup_accounts.scen.json");
}

#[test]
fn zero_fees_go() {
world().run("scenarios/zero_fees.scen.json");
}
85 changes: 85 additions & 0 deletions esdt-safe/tests/esdt_safe_scenario_rs_test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
use multiversx_sc_scenario::*;

fn world() -> ScenarioWorld {
todo!()
}

#[test]
fn add_refund_batch_rs() {
world().run("scenarios/add_refund_batch.scen.json");
}

#[test]
fn create_another_tx_ok_rs() {
world().run("scenarios/create_another_tx_ok.scen.json");
}

#[test]
fn create_another_tx_too_late_for_batch_rs() {
world().run("scenarios/create_another_tx_too_late_for_batch.scen.json");
}

#[test]
fn create_transaction_ok_rs() {
world().run("scenarios/create_transaction_ok.scen.json");
}

#[test]
fn create_transaction_over_max_amount_rs() {
world().run("scenarios/create_transaction_over_max_amount.scen.json");
}

#[test]
fn distribute_fees_rs() {
world().run("scenarios/distribute_fees.scen.json");
}

#[test]
fn execute_batch_both_rejected_rs() {
world().run("scenarios/execute_batch_both_rejected.scen.json");
}

#[test]
fn execute_batch_both_success_rs() {
world().run("scenarios/execute_batch_both_success.scen.json");
}

#[test]
fn execute_batch_one_success_one_rejected_rs() {
world().run("scenarios/execute_batch_one_success_one_rejected.scen.json");
}

#[test]
fn execute_transaction_rejected_rs() {
world().run("scenarios/execute_transaction_rejected.scen.json");
}

#[test]
fn execute_transaction_success_rs() {
world().run("scenarios/execute_transaction_success.scen.json");
}

#[test]
fn get_next_pending_tx_rs() {
world().run("scenarios/get_next_pending_tx.scen.json");
}

#[test]
fn get_next_tx_batch_rs() {
world().run("scenarios/get_next_tx_batch.scen.json");
}

#[test]
fn get_next_tx_batch_too_early_rs() {
world().run("scenarios/get_next_tx_batch_too_early.scen.json");
}

#[test]
fn setup_accounts_rs() {
world().run("scenarios/setup_accounts.scen.json");
}

#[test]
fn zero_fees_rs() {
world().run("scenarios/zero_fees.scen.json");
}
69 changes: 0 additions & 69 deletions esdt-safe/tests/scenario_go_test.rs

This file was deleted.

45 changes: 45 additions & 0 deletions multi-transfer-esdt/tests/multi_transfer_esdt_scenario_go_test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
use multiversx_sc_scenario::*;

fn world() -> ScenarioWorld {
ScenarioWorld::vm_go()
}

#[test]
fn batch_transfer_both_executed_go() {
world().run("scenarios/batch_transfer_both_executed.scen.json");
}

#[test]
fn batch_transfer_both_failed_go() {
world().run("scenarios/batch_transfer_both_failed.scen.json");
}

#[test]
fn batch_transfer_one_executed_one_failed_go() {
world().run("scenarios/batch_transfer_one_executed_one_failed.scen.json");
}

#[test]
fn batch_transfer_to_frozen_account_go() {
world().run("scenarios/batch_transfer_to_frozen_account.scen.json");
}

#[test]
fn batch_transfer_with_wrapping_go() {
world().run("scenarios/batch_transfer_with_wrapping.scen.json");
}

#[test]
fn setup_accounts_go() {
world().run("scenarios/setup_accounts.scen.json");
}

#[test]
fn transfer_ok_go() {
world().run("scenarios/transfer_ok.scen.json");
}

#[test]
fn two_transfers_same_token_go() {
world().run("scenarios/two_transfers_same_token.scen.json");
}
Loading

0 comments on commit 7c02b14

Please sign in to comment.