From 2a53ea7966e3522d9f04df8a36991371d48524c5 Mon Sep 17 00:00:00 2001 From: Daniel Wong Date: Thu, 30 Jan 2025 14:26:40 +0100 Subject: [PATCH] Deleted ARE_SET_VISIBILITY_PROPOSALS_ENABLED, now that the feature has gone through a probation period. --- rs/nns/governance/src/governance.rs | 29 +---------------------------- rs/nns/governance/src/lib.rs | 18 ------------------ 2 files changed, 1 insertion(+), 46 deletions(-) diff --git a/rs/nns/governance/src/governance.rs b/rs/nns/governance/src/governance.rs index 5dbefc01241..84884c8944c 100644 --- a/rs/nns/governance/src/governance.rs +++ b/rs/nns/governance/src/governance.rs @@ -1,5 +1,5 @@ use crate::{ - are_set_visibility_proposals_enabled, decoder_config, + decoder_config, governance::{ merge_neurons::{ build_merge_neurons_response, calculate_merge_neurons_effect, @@ -527,18 +527,6 @@ impl ManageNeuron { (Some(nid), None) => Ok(Some(NeuronIdOrSubaccount::NeuronId(*nid))), } } - - // TODO(NNS1-3228): Delete this. - fn is_set_visibility(&self) -> bool { - let Some(Command::Configure(ref configure)) = self.command else { - return false; - }; - - matches!( - configure.operation, - Some(manage_neuron::configure::Operation::SetVisibility(_)), - ) - } } impl Command { @@ -4978,21 +4966,6 @@ impl Governance { &self, manage_neuron: &ManageNeuron, ) -> Result<(), GovernanceError> { - // TODO(NNS1-3228): Delete this. - if manage_neuron.is_set_visibility() && - // But SetVisibility proposals are disabled - !are_set_visibility_proposals_enabled() - { - return Err(GovernanceError::new_with_message( - ErrorType::Unavailable, - "Setting neuron visibility via proposal is not allowed yet, \ - but it will be in the not too distant future. If you need \ - this sooner, please, start a new thread at forum.dfinity.org \ - and describe your use case." - .to_string(), - )); - } - let managed_id = manage_neuron .get_neuron_id_or_subaccount()? .ok_or_else(|| { diff --git a/rs/nns/governance/src/lib.rs b/rs/nns/governance/src/lib.rs index 7eef5a26f77..93ebe8c68d0 100644 --- a/rs/nns/governance/src/lib.rs +++ b/rs/nns/governance/src/lib.rs @@ -200,8 +200,6 @@ thread_local! { static IS_PRUNE_FOLLOWING_ENABLED: Cell = const { Cell::new(true) }; - static ARE_SET_VISIBILITY_PROPOSALS_ENABLED: Cell = const { Cell::new(true) }; - static ALLOW_ACTIVE_NEURONS_IN_STABLE_MEMORY: Cell = const { Cell::new(true) }; static USE_STABLE_MEMORY_FOLLOWING_INDEX: Cell = const { Cell::new(true) }; @@ -248,22 +246,6 @@ pub fn temporarily_disable_prune_following() -> Temporary { Temporary::new(&IS_PRUNE_FOLLOWING_ENABLED, false) } -pub fn are_set_visibility_proposals_enabled() -> bool { - ARE_SET_VISIBILITY_PROPOSALS_ENABLED.with(|ok| ok.get()) -} - -/// Only integration tests should use this. -#[cfg(any(test, feature = "canbench-rs", feature = "test"))] -pub fn temporarily_enable_set_visibility_proposals() -> Temporary { - Temporary::new(&ARE_SET_VISIBILITY_PROPOSALS_ENABLED, true) -} - -/// Only integration tests should use this. -#[cfg(any(test, feature = "canbench-rs", feature = "test"))] -pub fn temporarily_disable_set_visibility_proposals() -> Temporary { - Temporary::new(&ARE_SET_VISIBILITY_PROPOSALS_ENABLED, false) -} - pub fn allow_active_neurons_in_stable_memory() -> bool { ALLOW_ACTIVE_NEURONS_IN_STABLE_MEMORY.with(|ok| ok.get()) }