terra/token_bridge: remove migration code
This migration handler has successfuly completed (txn: 67E8FCFF48EEFE11BF6A975E621B6866BA930F9D2A85BC9AC5A70F009EE354C7) so we can remove it.
This commit is contained in:
parent
608c724a76
commit
0044bb5e44
|
@ -121,36 +121,8 @@ const CHAIN_ID: u16 = 3;
|
||||||
const WRAPPED_ASSET_UPDATING: &str = "updating";
|
const WRAPPED_ASSET_UPDATING: &str = "updating";
|
||||||
|
|
||||||
#[cfg_attr(not(feature = "library"), entry_point)]
|
#[cfg_attr(not(feature = "library"), entry_point)]
|
||||||
pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> StdResult<Response> {
|
pub fn migrate(_deps: DepsMut, _env: Env, _msg: MigrateMsg) -> StdResult<Response> {
|
||||||
// Clear out this just to be safe
|
Ok(Response::new())
|
||||||
wrapped_transfer_tmp(deps.storage).remove();
|
|
||||||
|
|
||||||
let mut bucket = wrapped_asset_address(deps.storage);
|
|
||||||
|
|
||||||
// Remove registered asset with old code ID.
|
|
||||||
let asset_id = deps.api.addr_canonicalize("terra16q5pke2vueu23y8punvj70h0cp0s0rc7vrzl57")?;
|
|
||||||
bucket.remove(&asset_id);
|
|
||||||
assert!(bucket.load(&asset_id).is_err());
|
|
||||||
|
|
||||||
let mut messages = vec![];
|
|
||||||
for item in bucket.range(None, None, Order::Ascending) {
|
|
||||||
let contract_address = item?.0;
|
|
||||||
messages.push(CosmosMsg::Wasm(WasmMsg::Migrate {
|
|
||||||
contract_addr: deps
|
|
||||||
.api
|
|
||||||
.addr_humanize(&contract_address.into())?
|
|
||||||
.to_string(),
|
|
||||||
new_code_id: 767,
|
|
||||||
msg: to_binary(&MigrateMsg {})?,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
let count = messages.len();
|
|
||||||
|
|
||||||
Ok(Response::new()
|
|
||||||
.add_messages(messages)
|
|
||||||
.add_attribute("migrate", "upgrade cw20 wrappers")
|
|
||||||
.add_attribute("count", count.to_string()))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(not(feature = "library"), entry_point)]
|
#[cfg_attr(not(feature = "library"), entry_point)]
|
||||||
|
|
Loading…
Reference in New Issue