fn compute_locked_balance<S: Storage, A: Api, Q: Querier>(
    deps: &mut Extern<S, A, Q>,
    token_manager: &mut TokenManager,
    voter: &CanonicalAddr,
) -> StdResult<u128> {
    // filter out not in-progress polls
    token_manager.locked_balance.retain(|(poll_id, _)| {
        let poll: Poll = poll_read(&deps.storage)
            .load(&poll_id.to_be_bytes())
            .unwrap();

        // cleanup not needed information, voting info in polls with no rewards
        if poll.status != PollStatus::InProgress && poll.voters_reward.is_zero() {
            poll_voter_store(&mut deps.storage, *poll_id).remove(&voter.as_slice());
        }

        poll.status == PollStatus::InProgress
    });

    Ok(token_manager
        .locked_balance
        .iter()
        .map(|(_, v)| v.balance.u128())
        .max()
        .unwrap_or_default())
}
// returns the largest locked amount in participated polls.
returns the largest locked amount in participated polls.
returns the largest locked amount in participated polls .
fn compute_locked_balance<S: Storage, A: Api, Q: Querier>(
    deps: &mut Extern<S, A, Q>,
    token_manager: &mut TokenManager,
    voter: &CanonicalAddr,
) -> StdResult<u128> {
    // filter out not in-progress polls
    token_manager.locked_balance.retain(|(poll_id, _)| {
        let poll: Poll = poll_read(&deps.storage)
            .load(&poll_id.to_be_bytes())
            .unwrap();
        // cleanup not needed information, voting info in polls with no rewards
        if poll.status != PollStatus::InProgress && poll.voters_reward.is_zero() {
            poll_voter_store(&mut deps.storage, *poll_id).remove(&voter.as_slice());
        }
        poll.status == PollStatus::InProgress
    });
    Ok(token_manager
        .locked_balance
        .iter()
        .map(|(_, v)| v.balance.u128())
        .max()
        .unwrap_or_default())
}
fn compute_locked_balance < S : Storage , A : Api , Q : Querier > ( deps : & mut Extern < S , A , Q > , token_manager : & mut TokenManager , voter : & CanonicalAddr , ) -> StdResult < u128 > { // filter out not in-progress polls token_manager . locked_balance . retain ( | ( poll_id , _ ) | { let poll : Poll = poll_read ( & deps . storage ) . load ( & poll_id . to_be_bytes ( ) ) . unwrap ( ) ; // cleanup not needed information, voting info in polls with no rewards if poll . status != PollStatus :: InProgress && poll . voters_reward . is_zero ( ) { poll_voter_store ( & mut deps . storage , * poll_id ) . remove ( & voter . as_slice ( ) ) ; } poll . status == PollStatus :: InProgress } ) ; Ok ( token_manager . locked_balance . iter ( ) . map ( | ( _ , v ) | v . balance . u128 ( ) ) . max ( ) . unwrap_or_default ( ) ) }
returns the largest locked amount in participated polls.
returns the largest locked amount in participated polls .
deps
&mut Extern<S, A, Q>
token_manager
&mut TokenManager
voter
&CanonicalAddr