-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1820 from multiversx/cs-test
chain sim - adder interactor integration test
- Loading branch information
Showing
5 changed files
with
68 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
extern crate basic_interact; | ||
|
||
#[tokio::main] | ||
pub async fn main() { | ||
basic_interact::adder_cli().await; | ||
} |
30 changes: 30 additions & 0 deletions
30
contracts/examples/adder/interact/tests/basic_interact_cs_test.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use basic_interact::{AdderInteract, Config}; | ||
|
||
#[tokio::test] | ||
#[cfg_attr(not(feature = "chain_simulator"), ignore)] | ||
async fn simulator_upgrade_test() { | ||
let mut basic_interact = AdderInteract::init(Config::chain_simulator_config()).await; | ||
// let wallet_address = basic_interact.wallet_address.clone(); | ||
let adder_owner_address = basic_interact.adder_owner_address.clone(); | ||
// let error_not_owner = (4, "upgrade is allowed only for owner"); | ||
|
||
basic_interact.deploy().await; | ||
basic_interact.add(1u32).await; | ||
|
||
// Sum will be 1 | ||
basic_interact.print_sum().await; | ||
|
||
basic_interact | ||
.upgrade(7u32, &adder_owner_address, None) | ||
.await; | ||
|
||
// Sum will be the updated value of 7 | ||
basic_interact.print_sum().await; | ||
|
||
// basic_interact | ||
// .upgrade(10u32, &wallet_address, Some(error_not_owner)) | ||
// .await; | ||
|
||
// // Sum will remain 7 | ||
// basic_interact.print_sum().await; | ||
} |