Skip to content

Commit

Permalink
added pre-propose v2.4.1 migration tests (#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso authored Jul 22, 2024
1 parent be861a8 commit cf86aed
Show file tree
Hide file tree
Showing 13 changed files with 2,610 additions and 103 deletions.
292 changes: 233 additions & 59 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,12 @@ voting-v1 = { package = "dao-voting", version = "0.1.0" }
# v2.4.1 dependencies. used for state migrations.
cw-denom-v241 = { package = "cw-denom", version = "2.4.1" }
dao-dao-core-v241 = { package = "dao-dao-core", version = "2.4.1" }
dao-interface-v241 = { package = "dao-interface", version = "2.4.1" }
dao-pre-propose-base-v241 = { package = "dao-pre-propose-base", version = "2.4.1" }
dao-pre-propose-approval-single-v241 = { package = "dao-pre-propose-approval-single", version = "2.4.1" }
dao-pre-propose-multiple-v241 = { package = "dao-pre-propose-multiple", version = "2.4.1" }
dao-pre-propose-single-v241 = { package = "dao-pre-propose-single", version = "2.4.1" }
dao-proposal-multiple-v241 = { package = "dao-proposal-multiple", version = "2.4.1" }
dao-proposal-single-v241 = { package = "dao-proposal-single", version = "2.4.1" }
dao-voting-cw4-v241 = { package = "dao-voting-cw4", version = "2.4.1" }
dao-voting-v241 = { package = "dao-voting", version = "2.4.1" }
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dao-interface = { workspace = true }
cw-denom = { workspace = true }
cw-multi-test = { workspace = true }
cw-utils = { workspace = true }
cw4 = { workspace = true }
cw4-group = { workspace = true }
cw20 = { workspace = true }
cw20-base = { workspace = true }
Expand All @@ -41,3 +42,11 @@ dao-voting = { workspace = true }
dao-voting-cw4 = { workspace = true }
dao-voting-cw20-staked = { workspace = true }
dao-proposal-single = { workspace = true }

# v2.4.1 migration
dao-dao-core-v241 = { workspace = true }
dao-interface-v241 = { workspace = true }
dao-pre-propose-approval-single-v241 = { workspace = true }
dao-proposal-single-v241 = { workspace = true }
dao-voting-cw4-v241 = { workspace = true }
dao-voting-v241 = { workspace = true }
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<Binary> {
}

#[cfg_attr(not(feature = "library"), entry_point)]
pub fn migrate(deps: DepsMut, _env: Env, msg: MigrateMsg) -> Result<Response, PreProposeError> {
PrePropose::default().migrate(deps, msg)
pub fn migrate(mut deps: DepsMut, _env: Env, msg: MigrateMsg) -> Result<Response, PreProposeError> {
let res = PrePropose::default().migrate(deps.branch(), msg);
set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;
res
}
Loading

0 comments on commit cf86aed

Please sign in to comment.