Skip to content

Commit

Permalink
interactor tests run sequentially, test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaicalinluca committed Nov 27, 2024
1 parent 2a5343e commit dcaad24
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 36 deletions.
1 change: 1 addition & 0 deletions contracts/examples/adder/interactor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ clap = { version = "4.4.7", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
toml = "0.8.6"
tokio = { version = "1.24" }
serial_test = { version = "3.2.0" }

[features]
chain-simulator-tests = []
70 changes: 35 additions & 35 deletions contracts/examples/adder/interactor/set_state.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,47 @@
"nonce": 5947,
"balance": "491982310359999986",
"keys": {
"454c524f4e44657364745453542d363437383930": "1209004563918244f40000",
"454c524f4e446e6f6e636550544d2d353336666162": "01",
"454c524f4e446573647450544d2d35333666616201": "08021202000122ef0108011212546573742d5061696e742d486172766573741a20e32afedc904fe1939746ad973beb383563cf63642ba669b3040f9b9428a5ed6020c4132a2e516d57564239575362674b52655a64615a434344766b454b70705a6b4d696d397563736e7857565041414c6a4374324368747470733a2f2f697066732e696f2f697066732f516d57564239575362674b52655a64615a434344766b454b70705a6b4d696d397563736e7857565041414c6a43743a3d746167733a3b6d657461646174613a516d52635039346b5872357a5a6a52477669376d4a36756e374c7078556859565234523452706963787a67596b74",
"454c524f4e44657364745453542d643964336136": "1209004563918244f40000",
"454c524f4e44657364745745474c442d613238633539": "120900389351ce08f09e12",
"454c524f4e44657364745453542d633636666535": "1209004563918244f40000",
"454c524f4e44657364745453542d623130616461": "1209004563918244f40000",
"454c524f4e4465736474475245454e2d306531363163": "120b00152d02c7e14af67fffdc",
"454c524f4e44657364745453542d656338383735": "12020064",
"454c524f4e44657364744c5453542d376266336431": "1209000de0b6b3a763fc19",
"454c524f4e44657364745453542d343265356138": "1209004563918244f40000",
"454c524f4e44726f6c656573647450544d2d353336666162": "0a1145534454526f6c654e46544372656174650a0f45534454526f6c654e46544275726e",
"454c524f4e44657364745453542d393836646663": "12020064",
"454c524f4e44657364745453542d323833633361": "12020064",
"454c524f4e4465736474424358535542542d33393264366172": "080112020001",
"454c524f4e44657364745453542d633565303835": "1209004563918244f40000",
"454c524f4e44657364745453542d346230653865": "1209004563918244f40000",
"454c524f4e44657364744c5453542d346638343965": "1209000de0b6b3a763fc19",
"454c524f4e44657364745453542d393864633566": "1209004563918244f40000",
"454c524f4e44657364745453542d396230323030": "1209004563918244f40000",
"454c524f4e44657364745453542d386564363538": "1209004563918244f40000",
"454c524f4e44657364745453542d343562383235": "12020064",
"454c524f4e446e6f6e636550544d2d353336666162": "01",
"454c524f4e44657364745453542d643862306438": "12020064",
"454c524f4e44657364745453542d363835303064": "1209004563918244f40000",
"454c524f4e44657364745453542d336339363762": "12020064",
"454c524f4e446573647455544b2d313464353764": "120b0001e6ce88d5ebbfd00000",
"454c524f4e44657364745453542d363434633935": "12020064",
"454c524f4e44657364745453542d306632306637": "12020064",
"454c524f4e44657364745453542d323833633361": "12020064",
"454c524f4e44657364745453542d333331386638": "1209004563918244f40000",
"454c524f4e44657364745453542d353538616434": "12020064",
"454c524f4e44657364745453542d363437383930": "1209004563918244f40000",
"454c524f4e44657364745453542d633933336139": "1209004563918244f40000",
"454c524f4e44657364745453542d393864633566": "1209004563918244f40000",
"454c524f4e44657364745453542d303637373232": "1209004563918244f40000",
"454c524f4e44657364745453542d346634303238": "12020064",
"454c524f4e44657364745453542d643862306438": "12020064",
"454c524f4e44657364745453542d346230653865": "1209004563918244f40000",
"454c524f4e44657364745745474c442d613238633539": "120900389351ce08f09e12",
"454c524f4e44657364745453542d343138613232": "1209004563918244f40000",
"454c524f4e44657364745453542d396230323030": "1209004563918244f40000",
"454c524f4e44657364745453542d656338383735": "12020064",
"454c524f4e44657364745453542d333639646531": "1209004563918244f40000",
"454c524f4e44657364745453542d373639313337": "1209004563918244f40000",
"454c524f4e44657364745453542d303362373664": "12020064",
"454c524f4e44657364745453542d363434633935": "12020064",
"454c524f4e44657364745453542d623830663863": "1209004563918244f40000",
"454c524f4e4465736474475245454e2d306531363163": "120b00152d02c7e14af67fffdc",
"454c524f4e4465736474424358535542542d33393264366172": "080112020001",
"454c524f4e44657364745453542d343562383235": "12020064",
"454c524f4e44657364745453542d613562663131": "12020064",
"454c524f4e44657364745453542d353966316165": "1209004563918244f40000",
"454c524f4e44657364745453542d623130616461": "1209004563918244f40000",
"454c524f4e44657364745453542d633933336139": "1209004563918244f40000",
"454c524f4e44657364744c5453542d376266336431": "1209000de0b6b3a763fc19",
"454c524f4e44657364745453542d336339363762": "12020064",
"454c524f4e44657364745453542d623136363735": "1209004563918244f40000",
"454c524f4e44657364745453542d333639646531": "1209004563918244f40000",
"454c524f4e44657364745453542d623830663863": "1209004563918244f40000",
"454c524f4e44657364745453542d633565303835": "1209004563918244f40000"
"454c524f4e44657364745453542d303362373664": "12020064",
"454c524f4e44657364745453542d353538616434": "12020064",
"454c524f4e44657364745453542d353966316165": "1209004563918244f40000",
"454c524f4e44657364745453542d306632306637": "12020064",
"454c524f4e446573647455544b2d313464353764": "120b0001e6ce88d5ebbfd00000",
"454c524f4e44657364745453542d633636666535": "1209004563918244f40000",
"454c524f4e44657364745453542d346634303238": "12020064",
"454c524f4e44657364745453542d643964336136": "1209004563918244f40000",
"454c524f4e44657364745453542d343265356138": "1209004563918244f40000",
"454c524f4e44657364745453542d393836646663": "12020064"
},
"code": "",
"code_hash": "",
Expand All @@ -58,19 +58,19 @@
"nonce": 1417,
"balance": "1753855617144056",
"keys": {
"454c524f4e4465736474424358535542542d3339326436616e": "080112020001",
"454c524f4e446573647442534b2d343736343730": "120b00021e19e0c9bab23fff7b",
"454c524f4e446573647445564e544e4f544946592d393634383835": "120b00152d02c7e14af6800000",
"454c524f4e4465736474494e5445524e532d63393332356601": "0801120b0013097d1fb962e12fff47",
"454c524f4e44657364744e455453432d623635306261": "120b00d137965aa7a731800000",
"454c524f4e446e6f6e6365494e5445524e532d633933323566": "01",
"454c524f4e44657364745745474c442d613238633539": "120800010593b233281b",
"454c524f4e446e6f6e6365494e5445524e532d633933323566": "01",
"454c524f4e446e6f6e63654d4554414e46542d643062623339": "01",
"454c524f4e44726f6c6565736474494e5445524e532d633933323566": "0a1145534454526f6c654e46544372656174650a1645534454526f6c654e46544164645175616e74697479",
"454c524f4e44657364744e4943552d393730323932": "120b00d3c21bcecceda1000000",
"454c524f4e44726f6c65657364744d4554414e46542d643062623339": "0a1145534454526f6c654e4654437265617465",
"454c524f4e446573647442534b2d343736343730": "120b00021e19e0c9bab23fff7b",
"454c524f4e44657364744e45543253432d306438663962": "120f0004ee2d6d3f3d6bcc25c64dc00000",
"454c524f4e4465736474424358535542542d3339326436616c": "080112020001",
"454c524f4e44657364744e4943552d393730323932": "120b00d3c21bcecceda1000000",
"454c524f4e4465736474424358535542542d3339326436616e": "080112020001"
"454c524f4e44657364744e45543253432d306438663962": "120f0004ee2d6d3f3d6bcc25c64dc00000"
},
"code": "",
"code_hash": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use basic_interactor::{AdderInteract, Config};
use multiversx_sc_snippets::{imports::Bech32Address, sdk::gateway::SetStateAccount, test_wallets};
use serial_test::serial;

#[tokio::test]
#[serial]
#[cfg_attr(not(feature = "chain-simulator-tests"), ignore)]
async fn simulator_upgrade_test() {
let mut basic_interact = AdderInteract::new(Config::chain_simulator_config()).await;
Expand Down Expand Up @@ -36,6 +38,7 @@ async fn simulator_upgrade_test() {
}

#[tokio::test]
#[serial]
#[cfg_attr(not(feature = "chain-simulator-tests"), ignore)]
async fn set_state_cs_test() {
let account_address = test_wallets::mike();
Expand All @@ -57,12 +60,17 @@ async fn set_state_cs_test() {

let set_state_response = simulator_interact.interactor.set_state(vec_state).await;

let _ = simulator_interact.interactor.generate_blocks(2u64).await;
simulator_interact
.interactor
.generate_blocks(2u64)
.await
.unwrap();

assert!(set_state_response.is_ok());
}

#[tokio::test]
#[serial]
#[cfg_attr(not(feature = "chain-simulator-tests"), ignore)]
async fn set_state_from_file_cs_test() {
let account_address = test_wallets::mike();
Expand Down

0 comments on commit dcaad24

Please sign in to comment.