pub fn assert_contract_termination<T, F>( should_terminate: F, expected_beneficiary: T::AccountId, expected_value_transferred_to_beneficiary: T::Balance )where T: Environment, F: FnMut() + UnwindSafe, <T as Environment>::AccountId: Debug, <T as Environment>::Balance: Debug,
Tests if a contract terminates successfully after
has been called.
The arguments denote:
should_terminate: A closure in which the function supposed to terminate is called.
expected_beneficiary: The beneficiary account who should have received the remaining value in the contract
expected_value_transferred_to_beneficiary: The value which should have been transferred to the
let should_terminate = move || your_contract.fn_which_should_terminate(); ink_env::test::assert_contract_termination::<ink_env::DefaultEnvironment, _>( should_terminate, expected_beneficiary, expected_value_transferred_to_beneficiary );
integration-tests/contract-terminate for a complete usage example.