Skip to content

Commit

Permalink
async call sc test
Browse files Browse the repository at this point in the history
  • Loading branch information
dorin-iancu committed Aug 8, 2024
1 parent ca820a7 commit 2b4a681
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions contracts/multisig-improved/tests/ms_improved_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,28 @@ fn transfer_execute_batch_test() {
.assert_ok();
}

#[test]
fn async_call_to_sc_test() {
let mut ms_setup = MsImprovedSetup::new(multisig_improved::contract_obj, adder::contract_obj);

let args = [&[5u8][..]].to_vec();
let action_id = ms_setup.propose_async_call(
&ms_setup.adder_wrapper.address_ref().clone(),
0,
b"add",
args,
);
ms_setup.sign(action_id, 0);
ms_setup.perform(action_id);

ms_setup
.b_mock
.execute_query(&ms_setup.adder_wrapper, |sc| {
assert_eq!(sc.sum().get(), 5);
})
.assert_ok();
}

#[test]
fn add_can_execute_module_test() {
let mut ms_setup = MsImprovedSetup::new(multisig_improved::contract_obj, adder::contract_obj);
Expand Down

0 comments on commit 2b4a681

Please sign in to comment.