pub fn update_asset_addresses(
    deps: DepsMut,
    msg_info: MessageInfo,
    to_add: Vec<(String, AssetInfo)>,
    to_remove: Vec<String>,
) -> MemoryResult {
    // Only Admin can call this method
    ADMIN.assert_admin(deps.as_ref(), &msg_info.sender)?;

    for (name, new_address) in to_add.into_iter() {
        // Update function for new or existing keys
        let insert = |_| -> StdResult<AssetInfo> { Ok(new_address) };
        ASSET_ADDRESSES.update(deps.storage, name.as_str(), insert)?;
    }

    for name in to_remove {
        ASSET_ADDRESSES.remove(deps.storage, name.as_str());
    }

    Ok(Response::new().add_attribute("action", "updated asset addresses"))
}
/// Adds, updates or removes provided addresses.
Adds, updates or removes provided addresses.
Adds updates or removes provided addresses .
pub fn update_asset_addresses(
    deps: DepsMut,
    msg_info: MessageInfo,
    to_add: Vec<(String, AssetInfo)>,
    to_remove: Vec<String>,
) -> MemoryResult {
    // Only Admin can call this method
    ADMIN.assert_admin(deps.as_ref(), &msg_info.sender)?;
    for (name, new_address) in to_add.into_iter() {
        // Update function for new or existing keys
        let insert = |_| -> StdResult<AssetInfo> { Ok(new_address) };
        ASSET_ADDRESSES.update(deps.storage, name.as_str(), insert)?;
    }
    for name in to_remove {
        ASSET_ADDRESSES.remove(deps.storage, name.as_str());
    }
    Ok(Response::new().add_attribute("action", "updated asset addresses"))
}
pub fn update_asset_addresses ( deps : DepsMut , msg_info : MessageInfo , to_add : Vec < ( String , AssetInfo ) > , to_remove : Vec < String > , ) -> MemoryResult { // Only Admin can call this method ADMIN . assert_admin ( deps . as_ref ( ) , & msg_info . sender ) ? ; for ( name , new_address ) in to_add . into_iter ( ) { // Update function for new or existing keys let insert = | _ | -> StdResult < AssetInfo > { Ok ( new_address ) } ; ASSET_ADDRESSES . update ( deps . storage , name . as_str ( ) , insert ) ? ; } for name in to_remove { ASSET_ADDRESSES . remove ( deps . storage , name . as_str ( ) ) ; } Ok ( Response :: new ( ) . add_attribute ( " " , " " ) ) }
Adds, updates or removes provided addresses.
Adds updates or removes provided addresses .
deps
DepsMut
msg_info
MessageInfo
to_add
Vec<(String, AssetInfo)>
to_remove
Vec<String>
deps
DepsMut
msg_info
MessageInfo
to_add
Vec<(String, AssetInfo)>
to_remove
Vec<String>