/// Votes for and executes the proposal identified by `proposal_id`. Asserts
/// that the ProposalStatus is Failed.
///
/// It is also verified that the rejection message contains (case-insensitive)
/// expected_message_substring. This can be left empty to guarantee a match when
/// not needed.
Votes for and executes the proposal identified by `proposal_id`. Asserts
that the ProposalStatus is Failed.

It is also verified that the rejection message contains (case-insensitive)
expected_message_substring. This can be left empty to guarantee a match when
not needed.
Votes for and executes the proposal identified by ` proposal_id ` . Asserts that the ProposalStatus is Failed . It is also verified that the rejection message contains ( case - insensitive ) expected_message_substring . This can be left empty to guarantee a match when not needed .
pub async fn vote_execute_proposal_assert_failed(
    governance_canister: &Canister<'_>,
    proposal_id: ProposalId,
    expected_message_substring: impl ToString,
) {
    let expected_message_substring = expected_message_substring.to_string();
    // Wait for the proposal to be accepted and executed.
    let proposal_info = vote_and_execute_proposal(governance_canister, proposal_id).await;
    assert_eq!(proposal_info.status(), ProposalStatus::Failed);
    let reason = proposal_info.failure_reason.unwrap_or_default();
    assert!(
       reason
            .error_message
            .to_lowercase()
            .contains(expected_message_substring.to_lowercase().as_str()),
        "Rejection error for proposal {}, which is '{}', does not contain the expected substring '{}'",
        proposal_id,
        reason,
        expected_message_substring
    );
}
pub async fn vote_execute_proposal_assert_failed ( governance_canister : & Canister < ' _ > , proposal_id : ProposalId , expected_message_substring : impl ToString , ) { let expected_message_substring = expected_message_substring . to_string ( ) ; // Wait for the proposal to be accepted and executed. let proposal_info = vote_and_execute_proposal ( governance_canister , proposal_id ) . await ; assert_eq ! ( proposal_info status ( ) ProposalStatus Failed ) ; let reason = proposal_info . failure_reason . unwrap_or_default ( ) ; assert ! ( reason error_message to_lowercase ( ) contains ( expected_message_substring to_lowercase ( ) as_str ( ) ) " " proposal_id reason expected_message_substring ) ; }
Votes for and executes the proposal identified by `proposal_id`.
Votes for and executes the proposal identified by ` proposal_id ` .
governance_canister
&Canister<'_>
proposal_id
ProposalId
expected_message_substring
impl ToString