pub fn convert<S: Storage, A: Api, Q: Querier>(
    deps: &mut Extern<S, A, Q>,
    env: Env,
    asset_token: HumanAddr,
) -> HandleResult<TerraMsgWrapper> {
    let config: Config = read_config(&deps.storage)?;
    let asset_token_raw = deps.api.canonical_address(&asset_token)?;

    if asset_token_raw == config.aust_token {
        anchor_redeem(deps, env, &config, asset_token)
    } else if asset_token_raw == config.bluna_token {
        bluna_swap(deps, env, &config, asset_token)
    } else {
        direct_swap(deps, env, &config, asset_token)
    }
}
/// Convert
/// Anyone can execute convert function to swap
/// asset token => collateral token
/// collateral token => MIR token
Convert
Anyone can execute convert function to swap
asset token => collateral token
collateral token => MIR token
Convert Anyone can execute convert function to swap asset token = > collateral token collateral token = > MIR token
pub fn convert<S: Storage, A: Api, Q: Querier>(
    deps: &mut Extern<S, A, Q>,
    env: Env,
    asset_token: HumanAddr,
) -> HandleResult<TerraMsgWrapper> {
    let config: Config = read_config(&deps.storage)?;
    let asset_token_raw = deps.api.canonical_address(&asset_token)?;
    if asset_token_raw == config.aust_token {
        anchor_redeem(deps, env, &config, asset_token)
    } else if asset_token_raw == config.bluna_token {
        bluna_swap(deps, env, &config, asset_token)
    } else {
        direct_swap(deps, env, &config, asset_token)
    }
}
pub fn convert < S : Storage , A : Api , Q : Querier > ( deps : & mut Extern < S , A , Q > , env : Env , asset_token : HumanAddr , ) -> HandleResult < TerraMsgWrapper > { let config : Config = read_config ( & deps . storage ) ? ; let asset_token_raw = deps . api . canonical_address ( & asset_token ) ? ; if asset_token_raw == config . aust_token { anchor_redeem ( deps , env , & config , asset_token ) } else if asset_token_raw == config . bluna_token { bluna_swap ( deps , env , & config , asset_token ) } else { direct_swap ( deps , env , & config , asset_token ) } }
Convert
Anyone can execute convert function to swap
asset token => collateral token
collateral token => MIR token
Convert Anyone can execute convert function to swap asset token = > collateral token collateral token = > MIR token
deps
&mut Extern<S, A, Q>
env
Env
asset_token
HumanAddr