Repository: DA0-DA0/dao-contracts
Pull request #264 (2022-04-25 20:50:45)

Rename governance modules -> proposal modules in cw-core messages.
Noticed that we had missed some renaming when I was instantiating the latest contracts.


Patch:
diff --git a/contracts/cw-core/src/contract.rs b/contracts/cw-core/src/contract.rs
index c7375235..87e1eade 100644
--- a/contracts/cw-core/src/contract.rs
+++ b/contracts/cw-core/src/contract.rs
@@ -16,15 +16,15 @@ use crate::error::ContractError;
 use crate::msg::{ExecuteMsg, InitialItemInfo, InstantiateMsg, ModuleInstantiateInfo, QueryMsg};
 use crate::query::{Cw20BalanceResponse, DumpStateResponse, GetItemResponse};
 use crate::state::{
-    Config, CONFIG, CW20_LIST, CW721_LIST, GOVERNANCE_MODULES, GOVERNANCE_MODULE_COUNT, ITEMS,
-    PENDING_ITEM_INSTANTIATION_NAMES, VOTING_MODULE,
+    Config, CONFIG, CW20_LIST, CW721_LIST, ITEMS, PENDING_ITEM_INSTANTIATION_NAMES,
+    PROPOSAL_MODULES, PROPOSAL_MODULE_COUNT, VOTING_MODULE,
 };
 
 // version info for migration info
 const CONTRACT_NAME: &str = "crates.io:cw-governance";
 const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");
 
-const GOV_MODULE_REPLY_ID: u64 = 0;
+const PROPOSAL_MODULE_REPLY_ID: u64 = 0;
 const VOTE_MODULE_INSTANTIATE_REPLY_ID: u64 = 1;
 const VOTE_MODULE_UPDATE_REPLY_ID: u64 = 2;
 
@@ -62,16 +62,16 @@ pub fn instantiate(
         SubMsg::reply_on_success(vote_module_msg, VOTE_MODULE_INSTANTIATE_REPLY_ID);
 
     let gov_module_msgs: Vec<SubMsg<Empty>> = msg
-        .governance_modules_instantiate_info
+        .proposal_modules_instantiate_info
         .into_iter()
         .map(|info| info.into_wasm_msg(env.contract.address.clone()))
-        .map(|wasm| SubMsg::reply_on_success(wasm, GOV_MODULE_REPLY_ID))
+        .map(|wasm| SubMsg::reply_on_success(wasm, PROPOSAL_MODULE_REPLY_ID))
         .collect();
     if gov_module_msgs.is_empty() {
-        return Err(ContractError::NoGovernanceModule {});
+        return Err(ContractError::NoProposalModule {});
     }
 
-    GOVERNANCE_MODULE_COUNT.save(deps.storage, &(gov_module_msgs.len() as u64))?;
+    PROPOSAL_MODULE_COUNT.save(deps.storage, &(gov_module_msgs.len() as u64))?;
 
     // Add or instantiate items if any are present.
     let mut instantiate_item_msgs: Vec<SubMsg<Empty>> = vec![];
@@ -159,7 +159,7 @@ pub fn execute_proposal_hook(
     sender: Addr,
     msgs: Vec<CosmosMsg<Empty>>,
 ) -> Result<Response, ContractError> {
-    if !GOVERNANCE_MODULES.has(deps.storage, sender) {
+    if !PROPOSAL_MODULES.has(deps.storage, sender) {
         return Err(ContractError::Unauthorized {});
     }
     Ok(Response::default()
@@ -221,7 +221,7 @@ pub fn execute_update_governance_modules(
         return Err(ContractError::Unauthorized {});
     }
 
-    let module_count = GOVERNANCE_MODULE_COUNT.load(deps.storage)?;
+    let module_count = PROPOSAL_MODULE_COUNT.load(deps.storage)?;
 
     // Some safe maths.
     let new_total = module_count
@@ -230,19 +230,19 @@ pub fn execute_update_governance_modules(
         .checked_sub(to_remove.len() as u64)
         .ok_or(ContractError::Overflow {})?;
     if new_total == 0 {
-        return Err(ContractError::NoGovernanceModule {});
+        return Err(ContractError::NoProposalModule {});
     }
-    GOVERNANCE_MODULE_COUNT.save(deps.storage, &new_total)?;
+    PROPOSAL_MODULE_COUNT.save(deps.storage, &new_total)?;
 
     for addr in to_remove {
         let addr = deps.api.addr_validate(&addr)?;
-        GOVERNANCE_MODULES.remove(deps.storage, addr);
+        PROPOSAL_MODULES.remove(deps.storage, addr);
     }
 
     let to_add: Vec<SubMsg<Empty>> = to_add
         .into_iter()
         .map(|info| info.into_wasm_msg(env.contract.address.clone()))
-        .map(|wasm| SubMsg::reply_on_success(wasm, GOV_MODULE_REPLY_ID))
+        .map(|wasm| SubMsg::reply_on_success(wasm, PROPOSAL_MODULE_REPLY_ID))
         .collect();
 
     Ok(Response::default()
@@ -368,7 +368,7 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<Binary> {
     match msg {
         QueryMsg::Config {} => query_config(deps),
         QueryMsg::VotingModule {} => query_voting_module(deps),
-        QueryMsg::GovernanceModules { start_at, limit } => {
+        QueryMsg::ProposalModules { start_at, limit } => {
             query_governance_modules(deps, start_at, limit)
         }
         QueryMsg::DumpState {} => query_dump_state(deps),
@@ -416,7 +416,7 @@ pub fn query_governance_modules(
     //
     // Even if this does lock up one can determine the existing
     // governance modules by looking at past transactions on chain.
-    let modules = GOVERNANCE_MODULES.keys(
+    let modules = PROPOSAL_MODULES.keys(
         deps.storage,
         start_at.map(Bound::inclusive),
         None,
@@ -434,7 +434,7 @@ pub fn query_governance_modules(
 pub fn query_dump_state(deps: Deps) -> StdResult<Binary> {
     let config = CONFIG.load(deps.storage)?;
     let voting_module = VOTING_MODULE.load(deps.storage)?;
-    let governance_modules = GOVERNANCE_MODULES
+    let governance_modules = PROPOSAL_MODULES
         .keys(deps.storage, None, None, cosmwasm_std::Order::Descending)
         .collect::<Result<Vec<Addr>, _>>()?;
     let version = get_contract_version(deps.storage)?;
@@ -583,10 +583,10 @@ pub fn query_cw20_balances(
 #[cfg_attr(not(feature = "library"), entry_point)]
 pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result<Response, ContractError> {
     match msg.id {
-        GOV_MODULE_REPLY_ID => {
+        PROPOSAL_MODULE_REPLY_ID => {
             let res = parse_reply_instantiate_data(msg)?;
             let gov_module_addr = deps.api.addr_validate(&res.contract_address)?;
-            GOVERNANCE_MODULES.save(deps.storage, gov_module_addr, &Empty {})?;
+            PROPOSAL_MODULES.save(deps.storage, gov_module_addr, &Empty {})?;
 
             Ok(Response::default().add_attribute("gov_module".to_string(), res.contract_address))
         }
diff --git a/contracts/cw-core/src/error.rs b/contracts/cw-core/src/error.rs
index 16d6208c..500e409f 100644
--- a/contracts/cw-core/src/error.rs
+++ b/contracts/cw-core/src/error.rs
@@ -14,7 +14,7 @@ pub enum ContractError {
     NoVotingModule {},
 
     #[error("Execution would result in no governance modules being present.")]
-    NoGovernanceModule {},
+    NoProposalModule {},
 
     #[error("An unknown reply ID was received.")]
     UnknownReplyID {},
diff --git a/contracts/cw-core/src/helpers.rs b/contracts/cw-core/src/helpers.rs
index 72102892..02b4f228 100644
--- a/contracts/cw-core/src/helpers.rs
+++ b/contracts/cw-core/src/helpers.rs
@@ -7,7 +7,7 @@ impl ModuleInstantiateInfo {
         WasmMsg::Instantiate {
             admin: match self.admin {
                 Admin::Address { addr } => Some(addr),
-                Admin::GovernanceContract {} => Some(contract_address.to_string()),
+                Admin::CoreContract {} => Some(contract_address.to_string()),
                 Admin::None {} => None,
             },
             code_id: self.code_id,
diff --git a/contracts/cw-core/src/msg.rs b/contracts/cw-core/src/msg.rs
index 66686767..65261481 100644
--- a/contracts/cw-core/src/msg.rs
+++ b/contracts/cw-core/src/msg.rs
@@ -12,14 +12,14 @@ use crate::state::Config;
 pub enum Admin {
     /// A specific address.
     Address { addr: String },
-    /// The governance contract itself. The contract will fill this in
+    /// The core contract itself. The contract will fill this in
     /// while instantiation takes place.
-    GovernanceContract {},
+    CoreContract {},
     /// No admin.
     None {},
 }
 
-/// Information needed to instantiate a governance or voting module.
+/// Information needed to instantiate a proposal or voting module.
 #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
 pub struct ModuleInstantiateInfo {
     /// Code ID of the contract to be instantiated.
@@ -50,11 +50,11 @@ pub struct InitialItem {
 
 #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
 pub struct InstantiateMsg {
-    /// The name of the governance contract.
+    /// The name of the core contract.
     pub name: String,
-    /// A description of the governance contract.
+    /// A description of the core contract.
     pub description: String,
-    /// An image URL to describe the governance module contract.
+    /// An image URL to describe the core module contract.
     pub image_url: Option<String>,
 
     /// If true the contract will automatically add received cw20
@@ -64,12 +64,12 @@ pub struct InstantiateMsg {
     /// tokens to its treasury.
     pub automatically_add_cw721s: bool,
 
-    /// Instantiate information for the governance contract's voting
+    /// Instantiate information for the core contract's voting
     /// power module.
     pub voting_module_instantiate_info: ModuleInstantiateInfo,
-    /// Instantiate information for the governance contract's
-    /// governance modules.
-    pub governance_modules_instantiate_info: Vec<ModuleInstantiateInfo>,
+    /// Instantiate information for the core contract's
+    /// proposal modules.
+    pub proposal_modules_instantiate_info: Vec<ModuleInstantiateInfo>,
 
     /// Initial information for arbitrary contract addresses to be
     /// added to the items map. The key is the name of the item in the
@@ -81,28 +81,28 @@ pub struct InstantiateMsg {
 #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
 #[serde(rename_all = "snake_case")]
 pub enum ExecuteMsg {
-    /// Callable by governance modules. The DAO will execute the
+    /// Callable by proposal modules. The DAO will execute the
     /// messages in the hook in order.
     ExecuteProposalHook { msgs: Vec<CosmosMsg<Empty>> },
-    /// Callable by the governance contract. Replaces the current
+    /// Callable by the core contract. Replaces the current
     /// governance contract config with the provided config.
     UpdateConfig { config: Config },
-    /// Callable by the governance contract. Replaces the current
+    /// Callable by the core contract. Replaces the current
     /// voting module with a new one instantiated by the governance
     /// contract.
     UpdateVotingModule { module: ModuleInstantiateInfo },
-    /// Updates the governance contract's governance modules. Module
+    /// Updates the core contract's proposal modules. Module
     /// instantiate info in `to_add` is used to create new modules and
     /// install them.
     UpdateGovernanceModules {
         to_add: Vec<ModuleInstantiateInfo>,
         to_remove: Vec<String>,
     },
-    /// Adds an item to the governance contract's item map. If the
+    /// Adds an item to the core contract's item map. If the
     /// item already exists the existing value is overriden. If the
     /// item does not exist a new item is added.
     SetItem { key: String, addr: String },
-    /// Removes an item from the governance contract's item map.
+    /// Removes an item from the core contract's item map.
     RemoveItem { key: String },
     /// Executed when the contract receives a cw20 token. Depending on
     /// the contract's configuration the contract will automatically
@@ -132,13 +132,13 @@ pub enum QueryMsg {
     Config {},
     /// Gets the contract's voting module. Returns Addr.
     VotingModule {},
-    /// Gets the governance modules assocaited with the
+    /// Gets the proposal modules assocaited with the
     /// contract. Returns Vec<Addr>.
-    GovernanceModules {
+    ProposalModules {
         start_at: Option<String>,
         limit: Option<u64>,
     },
-    /// Dumps all of the governance contract's state in a single
+    /// Dumps all of the core contract's state in a single
     /// query. Useful for frontends as performance for queries is more
     /// limited by network times than compute times. Returns
     /// `DumpStateResponse`.
diff --git a/contracts/cw-core/src/state.rs b/contracts/cw-core/src/state.rs
index 43c355f1..1c7ade53 100644
--- a/contracts/cw-core/src/state.rs
+++ b/contracts/cw-core/src/state.rs
@@ -23,7 +23,7 @@ pub struct Config {
 
 pub const CONFIG: Item<Config> = Item::new("config");
 pub const VOTING_MODULE: Item<Addr> = Item::new("voting_module");
-pub const GOVERNANCE_MODULES: Map<Addr, Empty> = Map::new("governance_modules");
+pub const PROPOSAL_MODULES: Map<Addr, Empty> = Map::new("governance_modules");
 pub const ITEMS: Map<String, Addr> = Map::new("items");
 pub const PENDING_ITEM_INSTANTIATION_NAMES: Map<u64, String> =
     Map::new("pending_item_instantiations");
@@ -42,4 +42,4 @@ pub const CW721_LIST: Map<Addr, Empty> = Map::new("cw721s");
 /// removing modules to check that at least one is present as it could
 /// cause the contract to lock due to gas issues if too many modules
 /// are present.
-pub const GOVERNANCE_MODULE_COUNT: Item<u64> = Item::new("governance_module_count");
+pub const PROPOSAL_MODULE_COUNT: Item<u64> = Item::new("governance_module_count");


Test patch:
diff --git a/contracts/cw-core/src/tests.rs b/contracts/cw-core/src/tests.rs
index c1cd8c0b..3a8fb5ce 100644
--- a/contracts/cw-core/src/tests.rs
+++ b/contracts/cw-core/src/tests.rs
@@ -96,14 +96,14 @@ fn test_instantiate_with_n_gov_modules(n: usize) {
         voting_module_instantiate_info: ModuleInstantiateInfo {
             code_id: cw20_id,
             msg: to_binary(&cw20_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "voting module".to_string(),
         },
-        governance_modules_instantiate_info: (0..n)
+        proposal_modules_instantiate_info: (0..n)
             .map(|n| ModuleInstantiateInfo {
                 code_id: cw20_id,
                 msg: to_binary(&cw20_instantiate).unwrap(),
-                admin: Admin::GovernanceContract {},
+                admin: Admin::CoreContract {},
                 label: format!("governance module {}", n),
             })
             .collect(),
@@ -172,20 +172,20 @@ fn test_instantiate_with_submessage_failure() {
         .map(|n| ModuleInstantiateInfo {
             code_id: cw20_id,
             msg: to_binary(&cw20_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: format!("governance module {}", n),
         })
         .collect::<Vec<_>>();
     governance_modules.push(ModuleInstantiateInfo {
         code_id: cw20_id,
         msg: to_binary("bad").unwrap(),
-        admin: Admin::GovernanceContract {},
+        admin: Admin::CoreContract {},
         label: "I have a bad instantiate message".to_string(),
     });
     governance_modules.push(ModuleInstantiateInfo {
         code_id: cw20_id,
         msg: to_binary(&cw20_instantiate).unwrap(),
-        admin: Admin::GovernanceContract {},
+        admin: Admin::CoreContract {},
         label: "Everybody knowing
 that goodness is good
 makes wickedness."
@@ -201,10 +201,10 @@ makes wickedness."
         voting_module_instantiate_info: ModuleInstantiateInfo {
             code_id: cw20_id,
             msg: to_binary(&cw20_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "voting module".to_string(),
         },
-        governance_modules_instantiate_info: governance_modules,
+        proposal_modules_instantiate_info: governance_modules,
         initial_items: None,
     };
     instantiate_gov(&mut app, gov_id, instantiate);
@@ -229,13 +229,13 @@ fn test_update_config() {
         voting_module_instantiate_info: ModuleInstantiateInfo {
             code_id: govmod_id,
             msg: to_binary(&govmod_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "voting module".to_string(),
         },
-        governance_modules_instantiate_info: vec![ModuleInstantiateInfo {
+        proposal_modules_instantiate_info: vec![ModuleInstantiateInfo {
             code_id: govmod_id,
             msg: to_binary(&govmod_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "voting module".to_string(),
         }],
         initial_items: None,
@@ -256,7 +256,7 @@ fn test_update_config() {
         .wrap()
         .query_wasm_smart(
             gov_addr.clone(),
-            &QueryMsg::GovernanceModules {
+            &QueryMsg::ProposalModules {
                 start_at: None,
                 limit: None,
             },
@@ -317,13 +317,13 @@ fn test_swap_governance(swaps: Vec<(u64, u64)>) {
         voting_module_instantiate_info: ModuleInstantiateInfo {
             code_id: govmod_id,
             msg: to_binary(&govmod_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "voting module".to_string(),
         },
-        governance_modules_instantiate_info: vec![ModuleInstantiateInfo {
+        proposal_modules_instantiate_info: vec![ModuleInstantiateInfo {
             code_id: govmod_id,
             msg: to_binary(&govmod_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "governance module".to_string(),
         }],
         initial_items: None,
@@ -344,7 +344,7 @@ fn test_swap_governance(swaps: Vec<(u64, u64)>) {
         .wrap()
         .query_wasm_smart(
             gov_addr.clone(),
-            &QueryMsg::GovernanceModules {
+            &QueryMsg::ProposalModules {
                 start_at: None,
                 limit: None,
             },
@@ -358,7 +358,7 @@ fn test_swap_governance(swaps: Vec<(u64, u64)>) {
             .wrap()
             .query_wasm_smart(
                 gov_addr.clone(),
-                &QueryMsg::GovernanceModules {
+                &QueryMsg::ProposalModules {
                     start_at: None,
                     limit: None,
                 },
@@ -369,7 +369,7 @@ fn test_swap_governance(swaps: Vec<(u64, u64)>) {
             .map(|n| ModuleInstantiateInfo {
                 code_id: govmod_id,
                 msg: to_binary(&govmod_instantiate).unwrap(),
-                admin: Admin::GovernanceContract {},
+                admin: Admin::CoreContract {},
                 label: format!("governance module {}", n),
             })
             .collect();
@@ -400,7 +400,7 @@ fn test_swap_governance(swaps: Vec<(u64, u64)>) {
             .wrap()
             .query_wasm_smart(
                 gov_addr.clone(),
-                &QueryMsg::GovernanceModules {
+                &QueryMsg::ProposalModules {
                     start_at: None,
                     limit: None,
                 },
@@ -447,13 +447,13 @@ fn test_swap_voting_module() {
         voting_module_instantiate_info: ModuleInstantiateInfo {
             code_id: govmod_id,
             msg: to_binary(&govmod_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "voting module".to_string(),
         },
-        governance_modules_instantiate_info: vec![ModuleInstantiateInfo {
+        proposal_modules_instantiate_info: vec![ModuleInstantiateInfo {
             code_id: govmod_id,
             msg: to_binary(&govmod_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "governance module".to_string(),
         }],
         initial_items: None,
@@ -479,7 +479,7 @@ fn test_swap_voting_module() {
         .wrap()
         .query_wasm_smart(
             gov_addr.clone(),
-            &QueryMsg::GovernanceModules {
+            &QueryMsg::ProposalModules {
                 start_at: None,
                 limit: None,
             },
@@ -499,7 +499,7 @@ fn test_swap_voting_module() {
                     module: ModuleInstantiateInfo {
                         code_id: govmod_id,
                         msg: to_binary(&govmod_instantiate).unwrap(),
-                        admin: Admin::GovernanceContract {},
+                        admin: Admin::CoreContract {},
                         label: "voting module".to_string(),
                     },
                 })
@@ -546,13 +546,13 @@ fn test_permissions() {
         voting_module_instantiate_info: ModuleInstantiateInfo {
             code_id: govmod_id,
             msg: to_binary(&govmod_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "voting module".to_string(),
         },
-        governance_modules_instantiate_info: vec![ModuleInstantiateInfo {
+        proposal_modules_instantiate_info: vec![ModuleInstantiateInfo {
             code_id: govmod_id,
             msg: to_binary(&govmod_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "governance module".to_string(),
         }],
         initial_items: None,
@@ -578,7 +578,7 @@ fn test_permissions() {
             module: ModuleInstantiateInfo {
                 code_id: govmod_id,
                 msg: to_binary(&govmod_instantiate).unwrap(),
-                admin: Admin::GovernanceContract {},
+                admin: Admin::CoreContract {},
                 label: "voting module".to_string(),
             },
         },
@@ -642,13 +642,13 @@ fn do_standard_instantiate(auto_add: bool) -> (Addr, App) {
         voting_module_instantiate_info: ModuleInstantiateInfo {
             code_id: voting_id,
             msg: to_binary(&voting_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "voting module".to_string(),
         },
-        governance_modules_instantiate_info: vec![ModuleInstantiateInfo {
+        proposal_modules_instantiate_info: vec![ModuleInstantiateInfo {
             code_id: govmod_id,
             msg: to_binary(&govmod_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "governance module".to_string(),
         }],
         initial_items: None,
@@ -792,13 +792,13 @@ fn test_list_items() {
         voting_module_instantiate_info: ModuleInstantiateInfo {
             code_id: voting_id,
             msg: to_binary(&voting_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "voting module".to_string(),
         },
-        governance_modules_instantiate_info: vec![ModuleInstantiateInfo {
+        proposal_modules_instantiate_info: vec![ModuleInstantiateInfo {
             code_id: govmod_id,
             msg: to_binary(&govmod_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "governance module".to_string(),
         }],
         initial_items: None,
@@ -877,13 +877,13 @@ fn test_instantiate_with_items() {
         voting_module_instantiate_info: ModuleInstantiateInfo {
             code_id: voting_id,
             msg: to_binary(&voting_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "voting module".to_string(),
         },
-        governance_modules_instantiate_info: vec![ModuleInstantiateInfo {
+        proposal_modules_instantiate_info: vec![ModuleInstantiateInfo {
             code_id: govmod_id,
             msg: to_binary(&govmod_instantiate).unwrap(),
-            admin: Admin::GovernanceContract {},
+            admin: Admin::CoreContract {},
             label: "governance module".to_string(),
         }],
         initial_items: Some(vec![
@@ -893,7 +893,7 @@ fn test_instantiate_with_items() {
                     info: ModuleInstantiateInfo {
                         code_id: voting_id,
                         msg: to_binary(&voting_instantiate).unwrap(),
-                        admin: Admin::GovernanceContract {},
+                        admin: Admin::CoreContract {},
                         label: "item0: a voting module".to_string(),
                     },
                 },
@@ -904,7 +904,7 @@ fn test_instantiate_with_items() {
                     info: ModuleInstantiateInfo {
                         code_id: voting_id,
                         msg: to_binary(&voting_instantiate).unwrap(),
-                        admin: Admin::GovernanceContract {},
+                        admin: Admin::CoreContract {},
                         label: "item1: another voting module".to_string(),
                     },
                 },
diff --git a/contracts/cw-proposal-single/src/tests.rs b/contracts/cw-proposal-single/src/tests.rs
index 5a26e752..f6a79fe6 100644
--- a/contracts/cw-proposal-single/src/tests.rs
+++ b/contracts/cw-proposal-single/src/tests.rs
@@ -124,13 +124,13 @@ fn instantiate_with_default_governance(
                 },
             })
             .unwrap(),
-            admin: cw_core::msg::Admin::GovernanceContract {},
+            admin: cw_core::msg::Admin::CoreContract {},
             label: "DAO DAO voting module".to_string(),
         },
-        governance_modules_instantiate_info: vec![cw_core::msg::ModuleInstantiateInfo {
+        proposal_modules_instantiate_info: vec![cw_core::msg::ModuleInstantiateInfo {
             code_id,
             msg: to_binary(&msg).unwrap(),
-            admin: cw_core::msg::Admin::GovernanceContract {},
+            admin: cw_core::msg::Admin::CoreContract {},
             label: "DAO DAO governance module".to_string(),
         }],
         initial_items: None,
@@ -182,13 +182,13 @@ fn instantiate_with_staking_default_governance(
                 active_threshold,
             })
             .unwrap(),
-            admin: cw_core::msg::Admin::GovernanceContract {},
+            admin: cw_core::msg::Admin::CoreContract {},
             label: "DAO DAO voting module".to_string(),
         },
-        governance_modules_instantiate_info: vec![cw_core::msg::ModuleInstantiateInfo {
+        proposal_modules_instantiate_info: vec![cw_core::msg::ModuleInstantiateInfo {
             code_id,
             msg: to_binary(&msg).unwrap(),
-            admin: cw_core::msg::Admin::GovernanceContract {},
+            admin: cw_core::msg::Admin::CoreContract {},
             label: "DAO DAO governance module".to_string(),
         }],
         initial_items: None,
@@ -219,7 +219,7 @@ fn test_propose() {
         .wrap()
         .query_wasm_smart(
             governance_addr.clone(),
-            &cw_core::msg::QueryMsg::GovernanceModules {
+            &cw_core::msg::QueryMsg::ProposalModules {
                 start_at: None,
                 limit: None,
             },
@@ -356,7 +356,7 @@ fn do_test_votes(
         .wrap()
         .query_wasm_smart(
             governance_addr.clone(),
-            &cw_core::msg::QueryMsg::GovernanceModules {
+            &cw_core::msg::QueryMsg::ProposalModules {
                 start_at: None,
                 limit: None,
             },
@@ -1631,7 +1631,7 @@ fn test_query_list_proposals() {
         .wrap()
         .query_wasm_smart(
             gov_addr,
-            &cw_core::msg::QueryMsg::GovernanceModules {
+            &cw_core::msg::QueryMsg::ProposalModules {
                 start_at: None,
                 limit: None,
             },
@@ -1771,7 +1771,7 @@ fn test_hooks() {
         .wrap()
         .query_wasm_smart(
             governance_addr,
-            &cw_core::msg::QueryMsg::GovernanceModules {
+            &cw_core::msg::QueryMsg::ProposalModules {
                 start_at: None,
                 limit: None,
             },
@@ -1950,7 +1950,7 @@ fn test_active_threshold_absolute() {
         .wrap()
         .query_wasm_smart(
             governance_addr,
-            &cw_core::msg::QueryMsg::GovernanceModules {
+            &cw_core::msg::QueryMsg::ProposalModules {
                 start_at: None,
                 limit: None,
             },
@@ -2075,7 +2075,7 @@ fn test_active_threshold_percent() {
         .wrap()
         .query_wasm_smart(
             governance_addr,
-            &cw_core::msg::QueryMsg::GovernanceModules {
+            &cw_core::msg::QueryMsg::ProposalModules {
                 start_at: None,
                 limit: None,
             },
@@ -2192,7 +2192,7 @@ fn test_active_threshold_none() {
         .wrap()
         .query_wasm_smart(
             governance_addr,
-            &cw_core::msg::QueryMsg::GovernanceModules {
+            &cw_core::msg::QueryMsg::ProposalModules {
                 start_at: None,
                 limit: None,
             },
@@ -2269,7 +2269,7 @@ fn test_active_threshold_none() {
         .wrap()
         .query_wasm_smart(
             governance_addr,
-            &cw_core::msg::QueryMsg::GovernanceModules {
+            &cw_core::msg::QueryMsg::ProposalModules {
                 start_at: None,
                 limit: None,
             },
diff --git a/contracts/proposal-hooks-counter/src/tests.rs b/contracts/proposal-hooks-counter/src/tests.rs
index 4e44bd03..02002f51 100644
--- a/contracts/proposal-hooks-counter/src/tests.rs
+++ b/contracts/proposal-hooks-counter/src/tests.rs
@@ -110,13 +110,13 @@ fn instantiate_with_default_governance(
                 },
             })
             .unwrap(),
-            admin: cw_core::msg::Admin::GovernanceContract {},
+            admin: cw_core::msg::Admin::CoreContract {},
             label: "DAO DAO voting module".to_string(),
         },
-        governance_modules_instantiate_info: vec![cw_core::msg::ModuleInstantiateInfo {
+        proposal_modules_instantiate_info: vec![cw_core::msg::ModuleInstantiateInfo {
             code_id,
             msg: to_binary(&msg).unwrap(),
-            admin: cw_core::msg::Admin::GovernanceContract {},
+            admin: cw_core::msg::Admin::CoreContract {},
             label: "DAO DAO governance module".to_string(),
         }],
         initial_items: None,
@@ -148,7 +148,7 @@ fn test_counters() {
         .wrap()
         .query_wasm_smart(
             governance_addr,
-            &cw_core::msg::QueryMsg::GovernanceModules {
+            &cw_core::msg::QueryMsg::ProposalModules {
                 start_at: None,
                 limit: None,
             },