pub fn compute_total_value(deps: Deps, env: Env) -> StdResult<Uint128> {
    // Get all assets from storage
    let mut all_assets = VAULT_ASSETS
        .range(deps.storage, None, None, Order::Ascending)
        .collect::<StdResult<Vec<(Vec<u8>, VaultAsset)>>>()?;

    let mut total_value = Uint128::zero();
    // Calculate their value iteratively
    for vault_asset_entry in all_assets.iter_mut() {
        total_value += vault_asset_entry.1.value(deps, &env, None)?;
    }

    Ok(total_value)
}
/// Computes the total value locked in this contract
Computes the total value locked in this contract
Computes the total value locked in this contract
pub fn compute_total_value(deps: Deps, env: Env) -> StdResult<Uint128> {
    // Get all assets from storage
    let mut all_assets = VAULT_ASSETS
        .range(deps.storage, None, None, Order::Ascending)
        .collect::<StdResult<Vec<(Vec<u8>, VaultAsset)>>>()?;
    let mut total_value = Uint128::zero();
    // Calculate their value iteratively
    for vault_asset_entry in all_assets.iter_mut() {
        total_value += vault_asset_entry.1.value(deps, &env, None)?;
    }
    Ok(total_value)
}
pub fn compute_total_value ( deps : Deps , env : Env ) -> StdResult < Uint128 > { // Get all assets from storage let mut all_assets = VAULT_ASSETS . range ( deps . storage , None , None , Order :: Ascending ) . collect :: < StdResult < Vec < ( Vec < u8 > , VaultAsset ) > > > ( ) ? ; let mut total_value = Uint128 :: zero ( ) ; // Calculate their value iteratively for vault_asset_entry in all_assets . iter_mut ( ) { total_value += vault_asset_entry . 1 . value ( deps , & env , None ) ? ; } Ok ( total_value ) }
Computes the total value locked in this contract
Computes the total value locked in this contract
deps
Deps
env
Env
deps
Deps
env
Env