Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix rust client and change to wrong file
  • Loading branch information
blockiosaurus committed Sep 16, 2025
commit b99bb6b1979ad8ec98234e8c09635938dc3d66a5
11 changes: 9 additions & 2 deletions clients/rust/src/hooked/advanced_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use crate::{
Edition, ExternalCheckResult, ExternalPluginAdapter, ExternalPluginAdapterKey,
FreezeDelegate, FreezeExecute, ImmutableMetadata, Key, LifecycleHook, LinkedAppData,
LinkedLifecycleHook, MasterEdition, Oracle, PermanentBurnDelegate, PermanentFreezeDelegate,
PermanentTransferDelegate, PluginAuthority, Royalties, TransferDelegate, UpdateDelegate,
VerifiedCreators,
PermanentFreezeExecute, PermanentTransferDelegate, PluginAuthority, Royalties,
TransferDelegate, UpdateDelegate, VerifiedCreators,
},
};

Expand Down Expand Up @@ -173,6 +173,12 @@ pub struct FreezeExecutePlugin {
pub freeze_execute: FreezeExecute,
}

#[derive(Debug, Eq, PartialEq, Clone)]
pub struct PermanentFreezeExecutePlugin {
pub base: BasePlugin,
pub permanent_freeze_execute: PermanentFreezeExecute,
}

#[derive(Debug, Default)]
pub struct PluginsList {
pub royalties: Option<RoyaltiesPlugin>,
Expand All @@ -192,6 +198,7 @@ pub struct PluginsList {
pub autograph: Option<AutographPlugin>,
pub bubblegum_v2: Option<BubblegumV2Plugin>,
pub freeze_execute: Option<FreezeExecutePlugin>,
pub permanent_freeze_execute: Option<PermanentFreezeExecutePlugin>,
}

#[derive(Debug, Default)]
Expand Down
1 change: 1 addition & 0 deletions clients/rust/src/hooked/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ impl From<&Plugin> for PluginType {
Plugin::Autograph(_) => PluginType::Autograph,
Plugin::BubblegumV2(_) => PluginType::BubblegumV2,
Plugin::FreezeExecute(_) => PluginType::FreezeExecute,
Plugin::PermanentFreezeExecute(_) => PluginType::PermanentFreezeExecute,
}
}
}
Expand Down
13 changes: 10 additions & 3 deletions clients/rust/src/hooked/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ use crate::{
BasePlugin, BubblegumV2Plugin, BurnDelegatePlugin, DataBlob, DataSectionWithData,
EditionPlugin, ExternalPluginAdaptersList, ExternalRegistryRecordSafe, FreezeDelegatePlugin,
FreezeExecutePlugin, ImmutableMetadataPlugin, LifecycleHookWithData, MasterEditionPlugin,
PermanentBurnDelegatePlugin, PermanentFreezeDelegatePlugin, PermanentTransferDelegatePlugin,
PluginRegistryV1Safe, PluginsList, RegistryRecordSafe, RoyaltiesPlugin, SolanaAccount,
TransferDelegatePlugin, UpdateDelegatePlugin, VerifiedCreatorsPlugin,
PermanentBurnDelegatePlugin, PermanentFreezeDelegatePlugin, PermanentFreezeExecutePlugin,
PermanentTransferDelegatePlugin, PluginRegistryV1Safe, PluginsList, RegistryRecordSafe,
RoyaltiesPlugin, SolanaAccount, TransferDelegatePlugin, UpdateDelegatePlugin,
VerifiedCreatorsPlugin,
};

/// Fetch the plugin from the registry.
Expand Down Expand Up @@ -354,6 +355,12 @@ pub(crate) fn registry_records_to_plugin_list(
freeze_execute,
})
}
Plugin::PermanentFreezeExecute(permanent_freeze_execute) => {
acc.permanent_freeze_execute = Some(PermanentFreezeExecutePlugin {
base,
permanent_freeze_execute,
})
}
}
}
Ok(acc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use borsh::{BorshDeserialize, BorshSerialize};
use solana_program::program_error::ProgramError;

use crate::{
plugins::{reject, Plugin, PluginType},
plugins::{reject, PluginType},
state::DataBlob,
};

Expand Down Expand Up @@ -81,13 +81,11 @@ impl PluginValidation for PermanentFreezeDelegate {
&self,
ctx: &PluginValidationContext,
) -> Result<ValidationResult, ProgramError> {
if let Some(Plugin::PermanentFreezeExecute(stored)) = ctx.target_plugin {
// Only block removal if the stored plugin is frozen.
if stored.frozen {
return reject!();
}
if ctx.target_plugin.is_some() && self.frozen {
reject!()
} else {
abstain!()
}
abstain!()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use borsh::{BorshDeserialize, BorshSerialize};
use solana_program::program_error::ProgramError;

use crate::{
plugins::{reject, PluginType},
plugins::{reject, Plugin, PluginType},
state::DataBlob,
};

Expand Down Expand Up @@ -72,11 +72,13 @@ impl PluginValidation for PermanentFreezeExecute {
&self,
ctx: &PluginValidationContext,
) -> Result<ValidationResult, ProgramError> {
if ctx.target_plugin.is_some() && self.frozen {
reject!()
} else {
abstain!()
if let Some(Plugin::PermanentFreezeExecute(stored)) = ctx.target_plugin {
// Only block removal if the stored plugin is frozen.
if stored.frozen {
return reject!();
}
}
abstain!()
}
}

Expand Down