pub fn assert_stake_tokens_result(
    total_share: u128,
    total_deposit: u128,
    new_share: u128,
    poll_count: u64,
    execute_res: Response,
    deps: Deps,
) {
    assert_eq!(
        execute_res.attributes.get(2).expect("no log"),
        &attr("share", new_share.to_string())
    );

    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,
            total_share: Uint128::from(total_share),
            total_deposit: Uint128::from(total_deposit),
        }
    );
}
/**
 * Assert helper to confirm the expected staked tokens response
 */
Assert helper to confirm the expected staked tokens response
Assert helper to confirm the expected staked tokens response
pub fn assert_stake_tokens_result(
    total_share: u128,
    total_deposit: u128,
    new_share: u128,
    poll_count: u64,
    execute_res: Response,
    deps: Deps,
) {
    assert_eq!(
        execute_res.attributes.get(2).expect("no log"),
        &attr("share", new_share.to_string())
    );
    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,
            total_share: Uint128::from(total_share),
            total_deposit: Uint128::from(total_deposit),
        }
    );
}
pub fn assert_stake_tokens_result ( total_share : u128 , total_deposit : u128 , new_share : u128 , poll_count : u64 , execute_res : Response , deps : Deps , ) { assert_eq ! ( execute_res attributes get ( 2 ) expect ( " " ) attr ( " " new_share to_string ( ) ) ) ; 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 total_share Uint128 from ( total_share ) total_deposit Uint128 from ( total_deposit ) } ) ; }
Assert helper to confirm the expected staked tokens response
Assert helper to confirm the expected staked tokens response
total_share
u128
total_deposit
u128
new_share
u128
poll_count
u64
execute_res
Response
deps
Deps
total_share
u128
total_deposit
u128
new_share
u128
poll_count
u64
execute_res
Response
deps
Deps