Skip to content

Commit

Permalink
enable missing migrations in sigle party covenant
Browse files Browse the repository at this point in the history
  • Loading branch information
bekauz committed Jan 18, 2024
1 parent 4e67298 commit 4a08af6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
34 changes: 23 additions & 11 deletions contracts/single-party-pol-covenant/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,9 @@ pub fn migrate(deps: DepsMut, _env: Env, msg: MigrateMsg) -> StdResult<Response>
clock,
ls_forwarder,
lp_forwarder,
holder: _, // TODO: Holder
holder,
liquid_pooler,
liquid_staker,
splitter,
} => {
let mut migrate_msgs = vec![];
Expand Down Expand Up @@ -382,16 +383,27 @@ pub fn migrate(deps: DepsMut, _env: Env, msg: MigrateMsg) -> StdResult<Response>
});
}

// if let Some(holder) = holder {
// let msg: Binary = to_json_binary(&holder)?;
// let holder_fields = PRESET_HOLDER_FIELDS.load(deps.storage)?;
// resp = resp.add_attribute("holder_migrate", msg.to_base64());
// migrate_msgs.push(WasmMsg::Migrate {
// contract_addr: COVENANT_POL_HOLDER_ADDR.load(deps.storage)?.to_string(),
// new_code_id: holder_fields.code_id,
// msg,
// });
// }
if let Some(holder) = holder {
let msg: Binary = to_json_binary(&holder)?;
let holder_fields = PRESET_HOLDER_FIELDS.load(deps.storage)?;
resp = resp.add_attribute("holder_migrate", msg.to_base64());
migrate_msgs.push(WasmMsg::Migrate {
contract_addr: HOLDER_ADDR.load(deps.storage)?.to_string(),
new_code_id: holder_fields.code_id,
msg,
});
}

if let Some(liquid_staker) = liquid_staker {
let msg: Binary = to_json_binary(&liquid_staker)?;
let liquid_staker_fields = PRESET_LIQUID_STAKER_FIELDS.load(deps.storage)?;
resp = resp.add_attribute("liquid_staker_migrate", msg.to_base64());
migrate_msgs.push(WasmMsg::Migrate {
contract_addr: LIQUID_STAKER_ADDR.load(deps.storage)?.to_string(),
new_code_id: liquid_staker_fields.code_id,
msg,
});
}

Ok(resp.add_messages(migrate_msgs))
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/single-party-pol-covenant/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,6 @@ pub enum MigrateMsg {
lp_forwarder: Option<covenant_ibc_forwarder::msg::MigrateMsg>,
splitter: Option<covenant_interchain_splitter::msg::MigrateMsg>,
liquid_pooler: Option<covenant_astroport_liquid_pooler::msg::MigrateMsg>,
// liquid_staker: Option<covenant_astroport_liquid_pooler::msg::MigrateMsg>,
liquid_staker: Option<covenant_stride_liquid_staker::msg::MigrateMsg>,
},
}

0 comments on commit 4a08af6

Please sign in to comment.