Skip to content

Commit 37b719c

Browse files
committed
Revert "Updated mod.rs to check UpdateDelegate in asset"
This reverts commit 40eeaa2.
1 parent 066dee9 commit 37b719c

File tree

1 file changed

+5
-33
lines changed
  • programs/mpl-core/src/utils

1 file changed

+5
-33
lines changed

programs/mpl-core/src/utils/mod.rs

+5-33
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ pub(crate) use compression::*;
77
use crate::{
88
error::MplCoreError,
99
plugins::{
10-
fetch_plugin, list_plugins, validate_external_plugin_adapter_checks, validate_plugin_checks,
11-
CheckResult, ExternalCheckResultBits, ExternalPluginAdapter, ExternalPluginAdapterKey,
12-
ExternalRegistryRecord, HookableLifecycleEvent, Plugin, PluginHeaderV1, PluginRegistryV1,
13-
PluginType, PluginValidationContext, RegistryRecord, UpdateDelegate, ValidationResult
10+
validate_external_plugin_adapter_checks, validate_plugin_checks, CheckResult,
11+
ExternalCheckResultBits, ExternalPluginAdapter, ExternalPluginAdapterKey,
12+
ExternalRegistryRecord, HookableLifecycleEvent, Plugin, PluginHeaderV1, PluginRegistryV1,
13+
PluginType, PluginValidationContext, RegistryRecord, ValidationResult,
1414
},
1515
state::{
1616
AssetV1, Authority, CollectionV1, CoreAsset, DataBlob, Key, SolanaAccount, UpdateAuthority,
@@ -22,9 +22,7 @@ use solana_program::{
2222
account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError,
2323
pubkey::Pubkey,
2424
};
25-
use std::collections::{
26-
BTreeMap, HashSet
27-
};
25+
use std::collections::BTreeMap;
2826

2927
/// Load the one byte key from the account data at the given offset.
3028
pub fn load_key(account: &AccountInfo, offset: usize) -> Result<Key, ProgramError> {
@@ -228,32 +226,6 @@ pub(crate) fn validate_asset_permissions<'a>(
228226
}
229227
};
230228

231-
let plugin_set: HashSet<_> =
232-
if asset.data_len() > deserialized_asset.len() {
233-
let plugin_list = list_plugins::<AssetV1>(asset)?;
234-
plugin_list.into_iter().collect()
235-
}
236-
else {
237-
HashSet::new()
238-
};
239-
240-
if plugin_set.contains(&PluginType::UpdateDelegate) {
241-
let (plugin_authority, _, _) = fetch_plugin::<AssetV1, UpdateDelegate>(
242-
asset,
243-
PluginType::UpdateDelegate,
244-
)?;
245-
246-
if assert_authority::<AssetV1>(
247-
&deserialized_asset,
248-
authority_info,
249-
&plugin_authority
250-
).is_ok()
251-
&& rejected == false
252-
{
253-
approved = true;
254-
}
255-
}
256-
257229
if collection_check != CheckResult::None {
258230
match collection_validate_fp(
259231
&CollectionV1::load(collection.ok_or(MplCoreError::MissingCollection)?, 0)?,

0 commit comments

Comments
 (0)