diff --git a/programs/mpl-core/src/plugins/lifecycle.rs b/programs/mpl-core/src/plugins/lifecycle.rs index e8b0461a..84998626 100644 --- a/programs/mpl-core/src/plugins/lifecycle.rs +++ b/programs/mpl-core/src/plugins/lifecycle.rs @@ -49,7 +49,7 @@ impl ExternalCheckResult { /// Bitfield representation of lifecycle permissions for external plugin adapter, third party plugins. #[bitfield(bits = 32)] -#[derive(Eq, PartialEq, Copy, Clone, Debug)] +#[derive(Eq, PartialEq, Copy, Clone, Debug, Default)] pub struct ExternalCheckResultBits { pub can_listen: bool, pub can_approve: bool, @@ -1016,22 +1016,6 @@ pub(crate) trait PluginValidation { abstain!() } - /// Validate the add_authority lifecycle action. - fn validate_add_authority( - &self, - _ctx: &PluginValidationContext, - ) -> Result { - abstain!() - } - - /// Validate the add_authority lifecycle action. - fn validate_remove_authority( - &self, - _ctx: &PluginValidationContext, - ) -> Result { - abstain!() - } - /// Validate the update_plugin lifecycle action. fn validate_update_external_plugin_adapter( &self, diff --git a/programs/mpl-core/src/plugins/plugin_registry.rs b/programs/mpl-core/src/plugins/plugin_registry.rs index e2c9f6cd..24730269 100644 --- a/programs/mpl-core/src/plugins/plugin_registry.rs +++ b/programs/mpl-core/src/plugins/plugin_registry.rs @@ -134,13 +134,15 @@ impl ExternalRegistryRecord { ExternalPluginAdapterUpdateInfo::LifecycleHook(update_info) => { if let Some(checks) = &update_info.lifecycle_checks { validate_lifecycle_checks(checks, false)?; - self.lifecycle_checks = update_info.lifecycle_checks.clone() + self.lifecycle_checks + .clone_from(&update_info.lifecycle_checks) } } ExternalPluginAdapterUpdateInfo::Oracle(update_info) => { if let Some(checks) = &update_info.lifecycle_checks { validate_lifecycle_checks(checks, true)?; - self.lifecycle_checks = update_info.lifecycle_checks.clone() + self.lifecycle_checks + .clone_from(&update_info.lifecycle_checks) } } _ => (), diff --git a/programs/mpl-core/src/plugins/utils.rs b/programs/mpl-core/src/plugins/utils.rs index d124862f..a0dd8543 100644 --- a/programs/mpl-core/src/plugins/utils.rs +++ b/programs/mpl-core/src/plugins/utils.rs @@ -413,7 +413,7 @@ pub fn initialize_external_plugin_adapter<'a, T: DataBlob + SolanaAccount>( } pub(crate) fn validate_lifecycle_checks( - lifecycle_checks: &Vec<(HookableLifecycleEvent, ExternalCheckResult)>, + lifecycle_checks: &[(HookableLifecycleEvent, ExternalCheckResult)], can_reject_only: bool, ) -> ProgramResult { if lifecycle_checks.is_empty() { diff --git a/programs/mpl-core/src/processor/burn.rs b/programs/mpl-core/src/processor/burn.rs index 98dae2c1..0a125d3f 100644 --- a/programs/mpl-core/src/processor/burn.rs +++ b/programs/mpl-core/src/processor/burn.rs @@ -9,7 +9,7 @@ use crate::{ state::{AssetV1, CollectionV1, CompressionProof, Key, SolanaAccount, Wrappable}, utils::{ close_program_account, load_key, rebuild_account_state_from_proof_data, resolve_authority, - validate_asset_permissions, validate_collection_permissions, verify_proof, + validate_asset_permissions, verify_proof, }, };