pub fn assert_create_poll_result(
    poll_id: u64,
    end_height: u64,
    creator: &str,
    execute_res: Response,
    deps: Deps,
) {
    assert_eq!(
        execute_res.attributes,
        vec![
            attr("action", "create_poll"),
            attr("creator", creator),
            attr("poll_id", poll_id.to_string()),
            attr("end_height", end_height.to_string()),
        ]
    );

    //confirm poll count
    let state: State = state_read(deps.storage).load().unwrap();
    assert_eq!(
        state,
        State {
            contract_addr: deps.api.addr_canonicalize(MOCK_CONTRACT_ADDR).unwrap(),
            poll_count: 1,
            total_share: Uint128::zero(),
            total_deposit: Uint128::from(DEFAULT_PROPOSAL_DEPOSIT),
        }
    );
}
/**
 * Assert helper to confirm the expected create_poll response
 */
Assert helper to confirm the expected create_poll response
Assert helper to confirm the expected create_poll response
pub fn assert_create_poll_result(
    poll_id: u64,
    end_height: u64,
    creator: &str,
    execute_res: Response,
    deps: Deps,
) {
    assert_eq!(
        execute_res.attributes,
        vec![
            attr("action", "create_poll"),
            attr("creator", creator),
            attr("poll_id", poll_id.to_string()),
            attr("end_height", end_height.to_string()),
        ]
    );
    //confirm poll count
    let state: State = state_read(deps.storage).load().unwrap();
    assert_eq!(
        state,
        State {
            contract_addr: deps.api.addr_canonicalize(MOCK_CONTRACT_ADDR).unwrap(),
            poll_count: 1,
            total_share: Uint128::zero(),
            total_deposit: Uint128::from(DEFAULT_PROPOSAL_DEPOSIT),
        }
    );
}
pub fn assert_create_poll_result ( poll_id : u64 , end_height : u64 , creator : & str , execute_res : Response , deps : Deps , ) { assert_eq ! ( execute_res attributes vec [ attr ( " " " " ) attr ( " " creator ) attr ( " " poll_id to_string ( ) ) attr ( " " end_height to_string ( ) ) ] ) ; //confirm poll count let state : State = state_read ( deps . storage ) . load ( ) . unwrap ( ) ; assert_eq ! ( state State { contract_addr deps api addr_canonicalize ( MOCK_CONTRACT_ADDR ) unwrap ( ) poll_count 1 total_share Uint128 zero ( ) total_deposit Uint128 from ( DEFAULT_PROPOSAL_DEPOSIT ) } ) ; }
Assert helper to confirm the expected create_poll response
Assert helper to confirm the expected create_poll response
poll_id
u64
end_height
u64
creator
&str
execute_res
Response
deps
Deps
poll_id
u64
end_height
u64
creator
&str
execute_res
Response
deps
Deps