Skip to content

Commit fe5d73a

Browse files
Get rid of ENABLE_CREATE_CANISTER_AND_INSTALL_CODE_PROPOSALS flag.
1 parent 446004e commit fe5d73a

3 files changed

Lines changed: 1 addition & 42 deletions

File tree

rs/nervous_system/integration_tests/tests/create_canister_and_install_code.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ async fn test_create_canister_and_install_code() {
2828
.build_async()
2929
.await;
3030

31-
// Step 1.2: Install NNS canisters with the test governance canister
32-
// (which has the CreateCanisterAndInstallCode feature flag enabled).
31+
// Step 1.2: Install NNS canisters.
3332
{
3433
let mut nns_installer = NnsInstaller::default();
3534
nns_installer.with_current_nns_canister_versions();
36-
nns_installer.with_test_governance_canister();
3735
nns_installer.install(&pocket_ic).await;
3836
}
3937

rs/nns/governance/src/lib.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,6 @@ thread_local! {
210210
static ENABLE_NEURON_FOLLOW_RESTRICTIONS: Cell<bool>
211211
= const { Cell::new(true) };
212212

213-
static ENABLE_CREATE_CANISTER_AND_INSTALL_CODE_PROPOSALS: Cell<bool>
214-
= const { Cell::new(true) };
215-
216213
static ENABLE_SUBNET_SPLITTING_PROPOSALS: Cell<bool>
217214
= const { Cell::new(false) };
218215

@@ -285,20 +282,6 @@ pub fn temporarily_disable_neuron_follow_restrictions() -> Temporary {
285282
Temporary::new(&ENABLE_NEURON_FOLLOW_RESTRICTIONS, false)
286283
}
287284

288-
pub fn are_create_canister_and_install_code_proposals_enabled() -> bool {
289-
ENABLE_CREATE_CANISTER_AND_INSTALL_CODE_PROPOSALS.get()
290-
}
291-
292-
#[cfg(any(test, feature = "canbench-rs", feature = "test"))]
293-
pub fn temporarily_enable_create_canister_and_install_code_proposals() -> Temporary {
294-
Temporary::new(&ENABLE_CREATE_CANISTER_AND_INSTALL_CODE_PROPOSALS, true)
295-
}
296-
297-
#[cfg(any(test, feature = "canbench-rs", feature = "test"))]
298-
pub fn temporarily_disable_create_canister_and_install_code_proposals() -> Temporary {
299-
Temporary::new(&ENABLE_CREATE_CANISTER_AND_INSTALL_CODE_PROPOSALS, false)
300-
}
301-
302285
#[cfg(any(test, feature = "canbench-rs", feature = "test"))]
303286
pub fn temporarily_enable_subnet_splitting_proposals() -> Temporary {
304287
Temporary::new(&ENABLE_SUBNET_SPLITTING_PROPOSALS, true)

rs/nns/governance/src/proposals/create_canister_and_install_code.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::{
2-
are_create_canister_and_install_code_proposals_enabled,
32
pb::v1::{
43
CreateCanisterAndInstallCode, GovernanceError, SelfDescribingValue, Topic,
54
canister_settings::{LogVisibility, SnapshotVisibility},
@@ -23,13 +22,6 @@ use ic_nns_handler_root_interface as root;
2322

2423
impl CreateCanisterAndInstallCode {
2524
pub fn validate(&self) -> Result<(), GovernanceError> {
26-
if !are_create_canister_and_install_code_proposals_enabled() {
27-
return Err(GovernanceError::new_with_message(
28-
ErrorType::InvalidProposal,
29-
"CreateCanisterAndInstallCode proposals are not enabled yet.",
30-
));
31-
}
32-
3325
let Self {
3426
host_subnet_id,
3527
canister_settings,
@@ -226,24 +218,10 @@ impl CallCanister for CreateCanisterAndInstallCode {
226218
type Reply = root::CreateCanisterAndInstallCodeOk;
227219

228220
fn canister_and_function(&self) -> Result<(CanisterId, &str), GovernanceError> {
229-
if !are_create_canister_and_install_code_proposals_enabled() {
230-
return Err(GovernanceError::new_with_message(
231-
ErrorType::InvalidProposal,
232-
"CreateCanisterAndInstallCode proposals are not enabled yet.",
233-
));
234-
}
235-
236221
Ok((ROOT_CANISTER_ID, "create_canister_and_install_code"))
237222
}
238223

239224
fn payload(&self) -> Result<Vec<u8>, GovernanceError> {
240-
if !are_create_canister_and_install_code_proposals_enabled() {
241-
return Err(GovernanceError::new_with_message(
242-
ErrorType::InvalidProposal,
243-
"CreateCanisterAndInstallCode proposals are not enabled yet.",
244-
));
245-
}
246-
247225
let request = root::CreateCanisterAndInstallCodeRequest::try_from(self.clone())?;
248226

249227
Encode!(&request).map_err(|e| {

0 commit comments

Comments
 (0)