Skip to content

Commit

Permalink
fix: review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ratik committed Sep 25, 2024
1 parent 13f4ec9 commit 2c8a8ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contracts/staker/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ fn execute_stake(
"puppeteer_ica not set",
)))?;
let mut delegations = vec![];
let chain_type = CHAIN_TYPE.load(deps.storage).unwrap_or_default();
let chain_type = CHAIN_TYPE.may_load(deps.storage)?.unwrap_or_default();
for (validator, amount) in items {
delegations.push(get_delegate_msg(
chain_type.clone(),
Expand Down Expand Up @@ -593,6 +593,10 @@ pub fn migrate(

if storage_version < version {
cw2::set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;

if storage_version < semver::Version::parse("1.1.0")? {
CHAIN_TYPE.save(deps.storage, &ChainType::default())?;
}
}

Ok(Response::new())
Expand Down

0 comments on commit 2c8a8ee

Please sign in to comment.