diff --git a/contracts/tgrade-ap-voting/MIGRATING.md b/contracts/tgrade-ap-voting/MIGRATING.md index 67c1b555..0cefa355 100644 --- a/contracts/tgrade-ap-voting/MIGRATING.md +++ b/contracts/tgrade-ap-voting/MIGRATING.md @@ -2,9 +2,17 @@ This guide lists API changes between releases of *Tgrade* contracts. +## 0.12.1 -> UNRELEASED + +### tgrade-ap-voting + +* Add support for setting `multisig_code_id` during migration. + Also sets `waiting_period`. + Only for versions lower than 0.13.0. + ## 0.8.1 -> UNRELEASED ### tgrade-ap-voting * Added `multisig_code` field to instantiation message containing the code of - `cw3_fixed_multisig` contract to handle arbiters verification + `cw3_fixed_multisig` contract to handle arbiters verification. diff --git a/contracts/tgrade-ap-voting/src/contract.rs b/contracts/tgrade-ap-voting/src/contract.rs index a4cf6352..643b3826 100644 --- a/contracts/tgrade-ap-voting/src/contract.rs +++ b/contracts/tgrade-ap-voting/src/contract.rs @@ -33,7 +33,7 @@ pub type Response = cosmwasm_std::Response; pub type SubMsg = cosmwasm_std::SubMsg; // version info for migration info -const CONTRACT_NAME: &str = "crates.io:tgrade_validator_voting_proposals"; +const CONTRACT_NAME: &str = "crates.io:tgrade_ap_voting"; const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); const AWAITING_MULTISIG_RESP: u64 = 1; diff --git a/contracts/tgrade-ap-voting/src/migration.rs b/contracts/tgrade-ap-voting/src/migration.rs index 4787c67d..84c9831d 100644 --- a/contracts/tgrade-ap-voting/src/migration.rs +++ b/contracts/tgrade-ap-voting/src/migration.rs @@ -31,8 +31,19 @@ pub fn migrate_config( next_complaint_id: config.next_complaint_id, multisig_code_id: msg.multisig_code, } + } else if *version < "0.13.0".parse::().unwrap() { + let mut config = CONFIG.load(deps.storage)?; + if msg.multisig_code > 0 { + // tgrade-1.0.0 does not set multisig_code_id during bootstrap + config.multisig_code_id = msg.multisig_code; + } + if msg.waiting_period.seconds() > 0 { + // tgrade-1.0.0 does not set waiting_period during bootstrap + config.waiting_period = msg.waiting_period; + } + config } else { - // It is already properly migrated + // It is already properly migrated / no multisig code id set return Ok(()); }; diff --git a/contracts/tgrade-ap-voting/src/msg.rs b/contracts/tgrade-ap-voting/src/msg.rs index a4fd4d1b..b7582827 100644 --- a/contracts/tgrade-ap-voting/src/msg.rs +++ b/contracts/tgrade-ap-voting/src/msg.rs @@ -121,4 +121,6 @@ pub struct ListComplaintsResp { pub struct MigrationMsg { /// Cw3 fixed multisig contract code pub multisig_code: u64, + /// Waiting period in seconds for this contract + pub waiting_period: Duration, }