Skip to content

Commit e6d9bd5

Browse files
Get rid of ENABLE_CREATE_CANISTER_AND_INSTALL_CODE_PROPOSALS flag.
1 parent ea86e66 commit e6d9bd5

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
@@ -213,9 +213,6 @@ thread_local! {
213213
static ENABLE_BLESS_ALTERNATIVE_GUEST_OS_VERSION_PROPOSALS: Cell<bool>
214214
= const { Cell::new(true) };
215215

216-
static ENABLE_CREATE_CANISTER_AND_INSTALL_CODE_PROPOSALS: Cell<bool>
217-
= const { Cell::new(true) };
218-
219216
static ENABLE_SUBNET_SPLITTING_PROPOSALS: Cell<bool>
220217
= const { Cell::new(false) };
221218

@@ -302,20 +299,6 @@ pub fn temporarily_disable_bless_alternative_guest_os_version_proposals() -> Tem
302299
Temporary::new(&ENABLE_BLESS_ALTERNATIVE_GUEST_OS_VERSION_PROPOSALS, false)
303300
}
304301

305-
pub fn are_create_canister_and_install_code_proposals_enabled() -> bool {
306-
ENABLE_CREATE_CANISTER_AND_INSTALL_CODE_PROPOSALS.get()
307-
}
308-
309-
#[cfg(any(test, feature = "canbench-rs", feature = "test"))]
310-
pub fn temporarily_enable_create_canister_and_install_code_proposals() -> Temporary {
311-
Temporary::new(&ENABLE_CREATE_CANISTER_AND_INSTALL_CODE_PROPOSALS, true)
312-
}
313-
314-
#[cfg(any(test, feature = "canbench-rs", feature = "test"))]
315-
pub fn temporarily_disable_create_canister_and_install_code_proposals() -> Temporary {
316-
Temporary::new(&ENABLE_CREATE_CANISTER_AND_INSTALL_CODE_PROPOSALS, false)
317-
}
318-
319302
#[cfg(any(test, feature = "canbench-rs", feature = "test"))]
320303
pub fn temporarily_enable_subnet_splitting_proposals() -> Temporary {
321304
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)