Skip to content

Commit 8a81d36

Browse files
committed
Fixing missing lifecycle impl
1 parent 1968701 commit 8a81d36

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

programs/mpl-core/src/plugins/lifecycle.rs

+24
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ impl PluginType {
196196
}
197197
}
198198

199+
/// Check permissions for the execute lifecycle event.
200+
pub fn check_execute(plugin_type: &PluginType) -> CheckResult {
201+
#[allow(clippy::match_single_binding)]
202+
match plugin_type {
203+
_ => CheckResult::None,
204+
}
205+
}
206+
199207
/// Check permissions for the add external plugin adapter lifecycle event.
200208
pub fn check_add_external_plugin_adapter(plugin_type: &PluginType) -> CheckResult {
201209
#[allow(clippy::match_single_binding)]
@@ -390,6 +398,14 @@ impl Plugin {
390398
plugin.inner().validate_decompress(ctx)
391399
}
392400

401+
/// Validate the execute lifecycle event.
402+
pub(crate) fn validate_execute(
403+
plugin: &Plugin,
404+
ctx: &PluginValidationContext,
405+
) -> Result<ValidationResult, ProgramError> {
406+
plugin.inner().validate_execute(ctx)
407+
}
408+
393409
/// Validate the add external plugin adapter lifecycle event.
394410
pub(crate) fn validate_add_external_plugin_adapter(
395411
plugin: &Plugin,
@@ -626,6 +642,14 @@ pub(crate) trait PluginValidation {
626642
abstain!()
627643
}
628644

645+
/// Validate the execute lifecycle action.
646+
fn validate_execute(
647+
&self,
648+
_ctx: &PluginValidationContext,
649+
) -> Result<ValidationResult, ProgramError> {
650+
abstain!()
651+
}
652+
629653
/// Validate the update_plugin lifecycle action.
630654
fn validate_update_external_plugin_adapter(
631655
&self,

programs/mpl-core/src/processor/update.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,11 @@ fn update<'a>(
205205
if plugin_set.contains(&PluginType::UpdateDelegate) {
206206
// Fetch the update delegate on the new collection.
207207
// Do not ignore the return plugin as we need to check the additional delegates.
208-
let (plugin_authority, fetched_plugin, _) = fetch_plugin::<CollectionV1, UpdateDelegate>(
209-
new_collection_account,
210-
PluginType::UpdateDelegate,
211-
)?;
208+
let (plugin_authority, fetched_plugin, _) =
209+
fetch_plugin::<CollectionV1, UpdateDelegate>(
210+
new_collection_account,
211+
PluginType::UpdateDelegate,
212+
)?;
212213

213214
if (assert_collection_authority(
214215
&new_collection,

0 commit comments

Comments
 (0)