Skip to content

Commit

Permalink
more debug
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Mar 5, 2024
1 parent 4102aff commit bdbf0b6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions contracts/subdaos/cwd-subdao-timelock-single/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ pub fn migrate(deps: DepsMut, env: Env, _msg: MigrateMsg) -> Result<Response, Co
.into_iter()
.map(|(_, proposal)| proposal)
.collect();
let mut res: Vec<String> = vec![];
let mut migrated_ids: Vec<String> = vec![];
let mut overrule_statuses: Vec<String> = vec![];
for mut item in props {
let overrule_proposal_id: u64 = deps.querier.query_wasm_smart(
&config.overrule_pre_propose,
Expand All @@ -365,15 +366,22 @@ pub fn migrate(deps: DepsMut, env: Env, _msg: MigrateMsg) -> Result<Response, Co
proposal_id: overrule_proposal_id,
},
)?;
overrule_statuses.push(format!(
"{:?}:{:?}",
overrule_proposal.id.to_string(),
overrule_proposal.proposal.status.to_string()
));

if overrule_proposal.proposal.status == Status::Closed {
item.status = ProposalStatus::Overruled;
res.push(item.id.to_string());
migrated_ids.push(item.id.to_string());
PROPOSALS.save(deps.storage, item.id, &item)?;
}
}

Ok(Response::default().add_attribute("migrated_proposal_ids", res.join(",")))
Ok(Response::default()
.add_attribute("migrated_proposal_ids", migrated_ids.join(","))
.add_attribute("migrated_overrule_statuses", overrule_statuses.join(",")))
}

fn is_overrule_proposal_denied(
Expand Down

0 comments on commit bdbf0b6

Please sign in to comment.