Repository: DA0-DA0/dao-contracts
Pull request #292 (2022-05-20 19:03:18)

Remove old naming and update schema for cw-core.
This removes usage of the old naming "governance modules" from the cw-core contract in favor of the current "proposal modules" naming.


Patch:
diff --git a/contracts/cw-core/schema/dump_state_response.json b/contracts/cw-core/schema/dump_state_response.json
index cf09b2dc..c2086d4a 100644
--- a/contracts/cw-core/schema/dump_state_response.json
+++ b/contracts/cw-core/schema/dump_state_response.json
@@ -5,8 +5,8 @@
   "type": "object",
   "required": [
     "config",
-    "governance_modules",
     "pause_info",
+    "proposal_modules",
     "version",
     "voting_module"
   ],
@@ -19,16 +19,16 @@
         }
       ]
     },
-    "governance_modules": {
+    "pause_info": {
+      "$ref": "#/definitions/PauseInfoResponse"
+    },
+    "proposal_modules": {
       "description": "The governance modules associated with the governance contract.",
       "type": "array",
       "items": {
         "$ref": "#/definitions/Addr"
       }
     },
-    "pause_info": {
-      "$ref": "#/definitions/PauseInfoResponse"
-    },
     "version": {
       "description": "The governance contract's version.",
       "allOf": [
diff --git a/contracts/cw-core/schema/execute_msg.json b/contracts/cw-core/schema/execute_msg.json
index d08685f6..bd0814d1 100644
--- a/contracts/cw-core/schema/execute_msg.json
+++ b/contracts/cw-core/schema/execute_msg.json
@@ -3,7 +3,7 @@
   "title": "ExecuteMsg",
   "oneOf": [
     {
-      "description": "Callable by governance modules. The DAO will execute the messages in the hook in order.",
+      "description": "Callable by proposal modules. The DAO will execute the messages in the hook in order.",
       "type": "object",
       "required": [
         "execute_proposal_hook"
@@ -27,7 +27,7 @@
       "additionalProperties": false
     },
     {
-      "description": "Callable by the governance contract. Replaces the current governance contract config with the provided config.",
+      "description": "Callable by the core contract. Replaces the current governance contract config with the provided config.",
       "type": "object",
       "required": [
         "update_config"
@@ -48,7 +48,7 @@
       "additionalProperties": false
     },
     {
-      "description": "Callable by the governance contract. Replaces the current voting module with a new one instantiated by the governance contract.",
+      "description": "Callable by the core contract. Replaces the current voting module with a new one instantiated by the governance contract.",
       "type": "object",
       "required": [
         "update_voting_module"
@@ -72,10 +72,10 @@
       "description": "Updates the governance contract's governance modules. Module instantiate info in `to_add` is used to create new modules and install them.",
       "type": "object",
       "required": [
-        "update_governance_modules"
+        "update_proposal_modules"
       ],
       "properties": {
-        "update_governance_modules": {
+        "update_proposal_modules": {
           "type": "object",
           "required": [
             "to_add",
@@ -280,13 +280,13 @@
           "additionalProperties": false
         },
         {
-          "description": "The governance contract itself. The contract will fill this in while instantiation takes place.",
+          "description": "The core contract itself. The contract will fill this in while instantiation takes place.",
           "type": "object",
           "required": [
-            "governance_contract"
+            "core_contract"
           ],
           "properties": {
-            "governance_contract": {
+            "core_contract": {
               "type": "object"
             }
           },
@@ -609,7 +609,7 @@
       "type": "object"
     },
     "ModuleInstantiateInfo": {
-      "description": "Information needed to instantiate a governance or voting module.",
+      "description": "Information needed to instantiate a proposal or voting module.",
       "type": "object",
       "required": [
         "admin",
diff --git a/contracts/cw-core/schema/instantiate_msg.json b/contracts/cw-core/schema/instantiate_msg.json
index 703da894..5e84c10f 100644
--- a/contracts/cw-core/schema/instantiate_msg.json
+++ b/contracts/cw-core/schema/instantiate_msg.json
@@ -6,8 +6,8 @@
     "automatically_add_cw20s",
     "automatically_add_cw721s",
     "description",
-    "governance_modules_instantiate_info",
     "name",
+    "proposal_modules_instantiate_info",
     "voting_module_instantiate_info"
   ],
   "properties": {
@@ -20,18 +20,11 @@
       "type": "boolean"
     },
     "description": {
-      "description": "A description of the governance contract.",
+      "description": "A description of the core contract.",
       "type": "string"
     },
-    "governance_modules_instantiate_info": {
-      "description": "Instantiate information for the governance contract's governance modules.",
-      "type": "array",
-      "items": {
-        "$ref": "#/definitions/ModuleInstantiateInfo"
-      }
-    },
     "image_url": {
-      "description": "An image URL to describe the governance module contract.",
+      "description": "An image URL to describe the core module contract.",
       "type": [
         "string",
         "null"
@@ -48,11 +41,18 @@
       }
     },
     "name": {
-      "description": "The name of the governance contract.",
+      "description": "The name of the core contract.",
       "type": "string"
     },
+    "proposal_modules_instantiate_info": {
+      "description": "Instantiate information for the core contract's proposal modules.",
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/ModuleInstantiateInfo"
+      }
+    },
     "voting_module_instantiate_info": {
-      "description": "Instantiate information for the governance contract's voting power module.",
+      "description": "Instantiate information for the core contract's voting power module.",
       "allOf": [
         {
           "$ref": "#/definitions/ModuleInstantiateInfo"
@@ -86,13 +86,13 @@
           "additionalProperties": false
         },
         {
-          "description": "The governance contract itself. The contract will fill this in while instantiation takes place.",
+          "description": "The core contract itself. The contract will fill this in while instantiation takes place.",
           "type": "object",
           "required": [
-            "governance_contract"
+            "core_contract"
           ],
           "properties": {
-            "governance_contract": {
+            "core_contract": {
               "type": "object"
             }
           },
@@ -185,7 +185,7 @@
       ]
     },
     "ModuleInstantiateInfo": {
-      "description": "Information needed to instantiate a governance or voting module.",
+      "description": "Information needed to instantiate a proposal or voting module.",
       "type": "object",
       "required": [
         "admin",
diff --git a/contracts/cw-core/schema/query_msg.json b/contracts/cw-core/schema/query_msg.json
index 75101399..6ec4b659 100644
--- a/contracts/cw-core/schema/query_msg.json
+++ b/contracts/cw-core/schema/query_msg.json
@@ -42,13 +42,13 @@
       "additionalProperties": false
     },
     {
-      "description": "Gets the governance modules assocaited with the contract. Returns Vec<Addr>.",
+      "description": "Gets the proposal modules assocaited with the contract. Returns Vec<Addr>.",
       "type": "object",
       "required": [
-        "governance_modules"
+        "proposal_modules"
       ],
       "properties": {
-        "governance_modules": {
+        "proposal_modules": {
           "type": "object",
           "properties": {
             "limit": {
@@ -71,7 +71,7 @@
       "additionalProperties": false
     },
     {
-      "description": "Dumps all of the governance 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`.",
+      "description": "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`.",
       "type": "object",
       "required": [
         "dump_state"
diff --git a/contracts/cw-core/src/contract.rs b/contracts/cw-core/src/contract.rs
index 99152f49..c2f95317 100644
--- a/contracts/cw-core/src/contract.rs
+++ b/contracts/cw-core/src/contract.rs
@@ -21,7 +21,7 @@ use crate::state::{
 };
 
 // version info for migration info
-const CONTRACT_NAME: &str = "crates.io:cw-governance";
+const CONTRACT_NAME: &str = "crates.io:cw-core";
 const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");
 
 const PROPOSAL_MODULE_REPLY_ID: u64 = 0;
@@ -61,13 +61,13 @@ pub fn instantiate(
     let vote_module_msg: SubMsg<Empty> =
         SubMsg::reply_on_success(vote_module_msg, VOTE_MODULE_INSTANTIATE_REPLY_ID);
 
-    let gov_module_msgs: Vec<SubMsg<Empty>> = msg
+    let proposal_module_msgs: Vec<SubMsg<Empty>> = msg
         .proposal_modules_instantiate_info
         .into_iter()
         .map(|info| info.into_wasm_msg(env.contract.address.clone()))
         .map(|wasm| SubMsg::reply_on_success(wasm, PROPOSAL_MODULE_REPLY_ID))
         .collect();
-    if gov_module_msgs.is_empty() {
+    if proposal_module_msgs.is_empty() {
         return Err(ContractError::NoProposalModule {});
     }
 
@@ -115,7 +115,7 @@ pub fn instantiate(
         .add_attribute("action", "instantiate")
         .add_attribute("sender", info.sender)
         .add_submessage(vote_module_msg)
-        .add_submessages(gov_module_msgs)
+        .add_submessages(proposal_module_msgs)
         .add_submessages(instantiate_item_msgs))
 }
 
@@ -144,7 +144,7 @@ pub fn execute(
             execute_update_voting_module(env, info.sender, module)
         }
         ExecuteMsg::UpdateProposalModules { to_add, to_remove } => {
-            execute_update_governance_modules(deps, env, info.sender, to_add, to_remove)
+            execute_update_proposal_modules(deps, env, info.sender, to_add, to_remove)
         }
         ExecuteMsg::SetItem { key, addr } => execute_set_item(deps, env, info.sender, key, addr),
         ExecuteMsg::RemoveItem { key } => execute_remove_item(deps, env, info.sender, key),
@@ -209,7 +209,7 @@ pub fn execute_update_config(
     // response. This has the benefit that it makes it reasonably
     // simple to ask "when did this field in the config change" by
     // running something like `junod query txs --events
-    // 'wasm._contract_address=governance&wasm.name=name'`.
+    // 'wasm._contract_address=core&wasm.name=name'`.
     Ok(Response::default()
         .add_attribute("action", "execute_update_config")
         .add_attribute("name", config.name)
@@ -237,7 +237,7 @@ pub fn execute_update_voting_module(
         .add_submessage(submessage))
 }
 
-pub fn execute_update_governance_modules(
+pub fn execute_update_proposal_modules(
     deps: DepsMut,
     env: Env,
     sender: Addr,
@@ -272,7 +272,7 @@ pub fn execute_update_governance_modules(
     }
 
     Ok(Response::default()
-        .add_attribute("action", "execute_update_governance_modules")
+        .add_attribute("action", "execute_update_proposal_modules")
         .add_submessages(to_add))
 }
 
@@ -395,7 +395,7 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<Binary> {
         QueryMsg::Config {} => query_config(deps),
         QueryMsg::VotingModule {} => query_voting_module(deps),
         QueryMsg::ProposalModules { start_at, limit } => {
-            query_governance_modules(deps, start_at, limit)
+            query_proposal_modules(deps, start_at, limit)
         }
         QueryMsg::DumpState {} => query_dump_state(deps, env),
         QueryMsg::VotingPowerAtHeight { address, height } => {
@@ -424,7 +424,7 @@ pub fn query_voting_module(deps: Deps) -> StdResult<Binary> {
     to_binary(&voting_module)
 }
 
-pub fn query_governance_modules(
+pub fn query_proposal_modules(
     deps: Deps,
     start_at: Option<String>,
     limit: Option<u64>,
@@ -442,7 +442,7 @@ pub fn query_governance_modules(
     // case we are only paying for what we need here.
     //
     // Even if this does lock up one can determine the existing
-    // governance modules by looking at past transactions on chain.
+    // proposal modules by looking at past transactions on chain.
     let modules = PROPOSAL_MODULES.keys(
         deps.storage,
         start_at.map(Bound::inclusive),
@@ -478,7 +478,7 @@ pub fn query_paused(deps: Deps, env: Env) -> StdResult<Binary> {
 pub fn query_dump_state(deps: Deps, env: Env) -> StdResult<Binary> {
     let config = CONFIG.load(deps.storage)?;
     let voting_module = VOTING_MODULE.load(deps.storage)?;
-    let governance_modules = PROPOSAL_MODULES
+    let proposal_modules = PROPOSAL_MODULES
         .keys(deps.storage, None, None, cosmwasm_std::Order::Descending)
         .collect::<Result<Vec<Addr>, _>>()?;
     let pause_info = get_pause_info(deps, env)?;
@@ -487,7 +487,7 @@ pub fn query_dump_state(deps: Deps, env: Env) -> StdResult<Binary> {
         config,
         version,
         pause_info,
-        governance_modules,
+        proposal_modules,
         voting_module,
     })
 }
@@ -631,10 +631,10 @@ pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result<Response, ContractE
     match msg.id {
         PROPOSAL_MODULE_REPLY_ID => {
             let res = parse_reply_instantiate_data(msg)?;
-            let gov_module_addr = deps.api.addr_validate(&res.contract_address)?;
-            PROPOSAL_MODULES.save(deps.storage, gov_module_addr, &Empty {})?;
+            let prop_module_addr = deps.api.addr_validate(&res.contract_address)?;
+            PROPOSAL_MODULES.save(deps.storage, prop_module_addr, &Empty {})?;
 
-            Ok(Response::default().add_attribute("gov_module".to_string(), res.contract_address))
+            Ok(Response::default().add_attribute("prop_module".to_string(), res.contract_address))
         }
         VOTE_MODULE_INSTANTIATE_REPLY_ID => {
             let res = parse_reply_instantiate_data(msg)?;
diff --git a/contracts/cw-core/src/query.rs b/contracts/cw-core/src/query.rs
index d42bf860..48794aba 100644
--- a/contracts/cw-core/src/query.rs
+++ b/contracts/cw-core/src/query.rs
@@ -18,7 +18,7 @@ pub struct DumpStateResponse {
     pub version: ContractVersion,
     /// The governance modules associated with the governance
     /// contract.
-    pub governance_modules: Vec<Addr>,
+    pub proposal_modules: Vec<Addr>,
     /// The voting module associated with the governance contract.
     pub voting_module: Addr,
 }
diff --git a/contracts/cw-core/src/state.rs b/contracts/cw-core/src/state.rs
index 4847e9f3..012dd687 100644
--- a/contracts/cw-core/src/state.rs
+++ b/contracts/cw-core/src/state.rs
@@ -28,7 +28,7 @@ pub const PAUSED: Item<Expiration> = Item::new("paused");
 
 /// The voting module associated with this contract.
 pub const VOTING_MODULE: Item<Addr> = Item::new("voting_module");
-pub const PROPOSAL_MODULES: Map<Addr, Empty> = Map::new("governance_modules");
+pub const PROPOSAL_MODULES: Map<Addr, Empty> = Map::new("proposal_modules");
 
 pub const ITEMS: Map<String, Addr> = Map::new("items");
 pub const PENDING_ITEM_INSTANTIATION_NAMES: Map<u64, String> =


Test patch:
diff --git a/contracts/cw-core/src/tests.rs b/contracts/cw-core/src/tests.rs
index d3bb231f..1ba108d9 100644
--- a/contracts/cw-core/src/tests.rs
+++ b/contracts/cw-core/src/tests.rs
@@ -34,7 +34,7 @@ fn cw721_contract() -> Box<dyn Contract<Empty>> {
     Box::new(contract)
 }
 
-fn sudo_govmod_contract() -> Box<dyn Contract<Empty>> {
+fn sudo_proposal_contract() -> Box<dyn Contract<Empty>> {
     let contract = ContractWrapper::new(
         cw_proposal_sudo::contract::execute,
         cw_proposal_sudo::contract::instantiate,
@@ -53,7 +53,7 @@ fn cw20_balances_voting() -> Box<dyn Contract<Empty>> {
     Box::new(contract)
 }
 
-fn cw_gov_contract() -> Box<dyn Contract<Empty>> {
+fn cw_core_contract() -> Box<dyn Contract<Empty>> {
     let contract = ContractWrapper::new(
         crate::contract::execute,
         crate::contract::instantiate,
@@ -78,7 +78,7 @@ fn instantiate_gov(app: &mut App, code_id: u64, msg: InstantiateMsg) -> Addr {
 fn test_instantiate_with_n_gov_modules(n: usize) {
     let mut app = App::default();
     let cw20_id = app.store_code(cw20_contract());
-    let gov_id = app.store_code(cw_gov_contract());
+    let gov_id = app.store_code(cw_core_contract());
 
     let cw20_instantiate = cw20_base::msg::InstantiateMsg {
         name: "DAO".to_string(),
@@ -131,12 +131,12 @@ fn test_instantiate_with_n_gov_modules(n: usize) {
     assert_eq!(
         state.version,
         ContractVersion {
-            contract: "crates.io:cw-governance".to_string(),
+            contract: "crates.io:cw-core".to_string(),
             version: env!("CARGO_PKG_VERSION").to_string()
         }
     );
 
-    assert_eq!(state.governance_modules.len(), n);
+    assert_eq!(state.proposal_modules.len(), n);
 }
 
 #[test]
@@ -158,7 +158,7 @@ fn test_valid_instantiate() {
 fn test_instantiate_with_submessage_failure() {
     let mut app = App::default();
     let cw20_id = app.store_code(cw20_contract());
-    let gov_id = app.store_code(cw_gov_contract());
+    let gov_id = app.store_code(cw_core_contract());
 
     let cw20_instantiate = cw20_base::msg::InstantiateMsg {
         name: "DAO".to_string(),
@@ -214,8 +214,8 @@ makes wickedness."
 #[test]
 fn test_update_config() {
     let mut app = App::default();
-    let govmod_id = app.store_code(sudo_govmod_contract());
-    let gov_id = app.store_code(cw_gov_contract());
+    let govmod_id = app.store_code(sudo_proposal_contract());
+    let gov_id = app.store_code(cw_core_contract());
 
     let govmod_instantiate = cw_proposal_sudo::msg::InstantiateMsg {
         root: CREATOR_ADDR.to_string(),
@@ -302,8 +302,8 @@ fn test_update_config() {
 
 fn test_swap_governance(swaps: Vec<(u64, u64)>) {
     let mut app = App::default();
-    let govmod_id = app.store_code(sudo_govmod_contract());
-    let gov_id = app.store_code(cw_gov_contract());
+    let propmod_id = app.store_code(sudo_proposal_contract());
+    let core_id = app.store_code(cw_core_contract());
 
     let govmod_instantiate = cw_proposal_sudo::msg::InstantiateMsg {
         root: CREATOR_ADDR.to_string(),
@@ -316,13 +316,13 @@ fn test_swap_governance(swaps: Vec<(u64, u64)>) {
         automatically_add_cw20s: true,
         automatically_add_cw721s: true,
         voting_module_instantiate_info: ModuleInstantiateInfo {
-            code_id: govmod_id,
+            code_id: propmod_id,
             msg: to_binary(&govmod_instantiate).unwrap(),
             admin: Admin::CoreContract {},
             label: "voting module".to_string(),
         },
         proposal_modules_instantiate_info: vec![ModuleInstantiateInfo {
-            code_id: govmod_id,
+            code_id: propmod_id,
             msg: to_binary(&govmod_instantiate).unwrap(),
             admin: Admin::CoreContract {},
             label: "governance module".to_string(),
@@ -332,7 +332,7 @@ fn test_swap_governance(swaps: Vec<(u64, u64)>) {
 
     let gov_addr = app
         .instantiate_contract(
-            gov_id,
+            core_id,
             Addr::unchecked(CREATOR_ADDR),
             &gov_instantiate,
             &[],
@@ -368,7 +368,7 @@ fn test_swap_governance(swaps: Vec<(u64, u64)>) {
 
         let to_add: Vec<_> = (0..add)
             .map(|n| ModuleInstantiateInfo {
-                code_id: govmod_id,
+                code_id: propmod_id,
                 msg: to_binary(&govmod_instantiate).unwrap(),
                 admin: Admin::CoreContract {},
                 label: format!("governance module {}", n),
@@ -377,6 +377,7 @@ fn test_swap_governance(swaps: Vec<(u64, u64)>) {
 
         let to_remove: Vec<_> = start_modules
             .iter()
+            .rev()
             .take(remove as usize)
             .map(|a| a.to_string())
             .collect();
@@ -412,7 +413,7 @@ fn test_swap_governance(swaps: Vec<(u64, u64)>) {
             finish_modules.len() as u64,
             start_modules.len() as u64 + add - remove
         );
-        for module in start_modules.into_iter().take(remove as usize) {
+        for module in start_modules.into_iter().rev().take(remove as usize) {
             assert!(!finish_modules.contains(&module))
         }
     }
@@ -420,7 +421,13 @@ fn test_swap_governance(swaps: Vec<(u64, u64)>) {
 
 #[test]
 fn test_update_governance() {
-    test_swap_governance(vec![(1, 1), (5, 0), (0, 5), (0, 0)])
+    test_swap_governance(vec![(1, 1), (5, 0), (0, 5), (0, 0)]);
+    test_swap_governance(vec![(1, 1), (1, 1), (1, 1), (1, 1)])
+}
+
+#[test]
+fn test_add_then_remove_governance() {
+    test_swap_governance(vec![(1, 0), (0, 1)])
 }
 
 #[test]
@@ -432,8 +439,8 @@ fn test_swap_governance_bad() {
 #[test]
 fn test_removed_modules_can_not_execute() {
     let mut app = App::default();
-    let govmod_id = app.store_code(sudo_govmod_contract());
-    let gov_id = app.store_code(cw_gov_contract());
+    let govmod_id = app.store_code(sudo_proposal_contract());
+    let gov_id = app.store_code(cw_core_contract());
 
     let govmod_instantiate = cw_proposal_sudo::msg::InstantiateMsg {
         root: CREATOR_ADDR.to_string(),
@@ -577,8 +584,8 @@ fn test_removed_modules_can_not_execute() {
 #[test]
 fn test_swap_voting_module() {
     let mut app = App::default();
-    let govmod_id = app.store_code(sudo_govmod_contract());
-    let gov_id = app.store_code(cw_gov_contract());
+    let govmod_id = app.store_code(sudo_proposal_contract());
+    let gov_id = app.store_code(cw_core_contract());
 
     let govmod_instantiate = cw_proposal_sudo::msg::InstantiateMsg {
         root: CREATOR_ADDR.to_string(),
@@ -678,8 +685,8 @@ fn test_unauthorized(app: &mut App, gov_addr: Addr, msg: ExecuteMsg) {
 #[test]
 fn test_permissions() {
     let mut app = App::default();
-    let govmod_id = app.store_code(sudo_govmod_contract());
-    let gov_id = app.store_code(cw_gov_contract());
+    let govmod_id = app.store_code(sudo_proposal_contract());
+    let gov_id = app.store_code(cw_core_contract());
 
     let govmod_instantiate = cw_proposal_sudo::msg::InstantiateMsg {
         root: CREATOR_ADDR.to_string(),
@@ -756,9 +763,9 @@ fn test_permissions() {
 
 fn do_standard_instantiate(auto_add: bool) -> (Addr, App) {
     let mut app = App::default();
-    let govmod_id = app.store_code(sudo_govmod_contract());
+    let govmod_id = app.store_code(sudo_proposal_contract());
     let voting_id = app.store_code(cw20_balances_voting());
-    let gov_id = app.store_code(cw_gov_contract());
+    let gov_id = app.store_code(cw_core_contract());
     let cw20_id = app.store_code(cw20_contract());
 
     let govmod_instantiate = cw_proposal_sudo::msg::InstantiateMsg {
@@ -906,9 +913,9 @@ fn test_add_remove_get() {
 #[test]
 fn test_list_items() {
     let mut app = App::default();
-    let govmod_id = app.store_code(sudo_govmod_contract());
+    let govmod_id = app.store_code(sudo_proposal_contract());
     let voting_id = app.store_code(cw20_balances_voting());
-    let gov_id = app.store_code(cw_gov_contract());
+    let gov_id = app.store_code(cw_core_contract());
     let cw20_id = app.store_code(cw20_contract());
 
     let govmod_instantiate = cw_proposal_sudo::msg::InstantiateMsg {
@@ -991,9 +998,9 @@ fn test_list_items() {
 #[test]
 fn test_instantiate_with_items() {
     let mut app = App::default();
-    let govmod_id = app.store_code(sudo_govmod_contract());
+    let govmod_id = app.store_code(sudo_proposal_contract());
     let voting_id = app.store_code(cw20_balances_voting());
-    let gov_id = app.store_code(cw_gov_contract());
+    let gov_id = app.store_code(cw_core_contract());
     let cw20_id = app.store_code(cw20_contract());
 
     let govmod_instantiate = cw_proposal_sudo::msg::InstantiateMsg {
diff --git a/contracts/cw-proposal-single/src/staking_tests.rs b/contracts/cw-proposal-single/src/staking_tests.rs
index 8d134728..73d1fb61 100644
--- a/contracts/cw-proposal-single/src/staking_tests.rs
+++ b/contracts/cw-proposal-single/src/staking_tests.rs
@@ -132,7 +132,7 @@ fn instantiate_with_staked_balances_voting() {
         .query_wasm_smart(core_addr, &cw_core::msg::QueryMsg::DumpState {})
         .unwrap();
 
-    assert_eq!(state.governance_modules.len(), 1);
+    assert_eq!(state.proposal_modules.len(), 1);
     assert_eq!(
         state.config,
         cw_core::state::Config {
diff --git a/contracts/cw-proposal-single/src/tests.rs b/contracts/cw-proposal-single/src/tests.rs
index 59228bd6..6cd1cbfc 100644
--- a/contracts/cw-proposal-single/src/tests.rs
+++ b/contracts/cw-proposal-single/src/tests.rs
@@ -885,7 +885,7 @@ fn test_voting_module_token_proposal_deposit_instantiate() {
         .wrap()
         .query_wasm_smart(governance_addr, &cw_core::msg::QueryMsg::DumpState {})
         .unwrap();
-    let governance_modules = gov_state.governance_modules;
+    let governance_modules = gov_state.proposal_modules;
     let voting_module = gov_state.voting_module;
 
     assert_eq!(governance_modules.len(), 1);
@@ -1047,7 +1047,7 @@ fn test_take_proposal_deposit() {
         .wrap()
         .query_wasm_smart(governance_addr, &cw_core::msg::QueryMsg::DumpState {})
         .unwrap();
-    let governance_modules = gov_state.governance_modules;
+    let governance_modules = gov_state.proposal_modules;
 
     assert_eq!(governance_modules.len(), 1);
     let govmod_single = governance_modules.into_iter().next().unwrap();
@@ -1144,7 +1144,7 @@ fn test_deposit_return_on_execute() {
         .wrap()
         .query_wasm_smart(governance_addr, &cw_core::msg::QueryMsg::DumpState {})
         .unwrap();
-    let governance_modules = gov_state.governance_modules;
+    let governance_modules = gov_state.proposal_modules;
 
     assert_eq!(governance_modules.len(), 1);
     let govmod_single = governance_modules.into_iter().next().unwrap();
@@ -1217,7 +1217,7 @@ fn test_close_open_proposal() {
         .wrap()
         .query_wasm_smart(governance_addr, &cw_core::msg::QueryMsg::DumpState {})
         .unwrap();
-    let governance_modules = gov_state.governance_modules;
+    let governance_modules = gov_state.proposal_modules;
 
     assert_eq!(governance_modules.len(), 1);
     let govmod_single = governance_modules.into_iter().next().unwrap();
@@ -1312,7 +1312,7 @@ fn test_deposit_return_on_close() {
         .wrap()
         .query_wasm_smart(governance_addr, &cw_core::msg::QueryMsg::DumpState {})
         .unwrap();
-    let governance_modules = gov_state.governance_modules;
+    let governance_modules = gov_state.proposal_modules;
 
     assert_eq!(governance_modules.len(), 1);
     let govmod_single = governance_modules.into_iter().next().unwrap();
@@ -1392,7 +1392,7 @@ fn test_execute_expired_proposal() {
         .wrap()
         .query_wasm_smart(core_addr, &cw_core::msg::QueryMsg::DumpState {})
         .unwrap();
-    let proposal_modules = gov_state.governance_modules;
+    let proposal_modules = gov_state.proposal_modules;
 
     assert_eq!(proposal_modules.len(), 1);
     let proposal_single = proposal_modules.into_iter().next().unwrap();
@@ -1503,7 +1503,7 @@ fn test_update_config() {
         .wrap()
         .query_wasm_smart(governance_addr, &cw_core::msg::QueryMsg::DumpState {})
         .unwrap();
-    let governance_modules = gov_state.governance_modules;
+    let governance_modules = gov_state.proposal_modules;
 
     assert_eq!(governance_modules.len(), 1);
     let govmod_single = governance_modules.into_iter().next().unwrap();
@@ -1616,7 +1616,7 @@ fn test_no_return_if_no_refunds() {
         .wrap()
         .query_wasm_smart(governance_addr, &cw_core::msg::QueryMsg::DumpState {})
         .unwrap();
-    let governance_modules = gov_state.governance_modules;
+    let governance_modules = gov_state.proposal_modules;
 
     assert_eq!(governance_modules.len(), 1);
     let govmod_single = governance_modules.into_iter().next().unwrap();