Function ink_env::test::assert_contract_termination[][src]

pub fn assert_contract_termination<T, F>(
    should_terminate: F,
    expected_beneficiary: T::AccountId,
    expected_balance: 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 self.env().terminate() has been called.

Usage

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
);

See examples/contract-terminate for a complete usage example.