Skip to content
Open
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
feat: pr review changes
  • Loading branch information
stranzhay committed Aug 1, 2025
commit 336f0bd13ae4040760dc02c2d17e2ddc48e60cd7
28 changes: 14 additions & 14 deletions clients/js/src/generated/types/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ export type Plugin =
| { __kind: 'VerifiedCreators'; fields: [VerifiedCreators] }
| { __kind: 'Autograph'; fields: [Autograph] }
| { __kind: 'BubblegumV2'; fields: [BubblegumV2] }
| { __kind: 'Groups'; fields: [Groups] }
| { __kind: 'FreezeExecute'; fields: [FreezeExecute] };
| { __kind: 'FreezeExecute'; fields: [FreezeExecute] }
| { __kind: 'Groups'; fields: [Groups] };

export type PluginArgs =
| { __kind: 'Royalties'; fields: [BaseRoyaltiesArgs] }
Expand All @@ -111,8 +111,8 @@ export type PluginArgs =
| { __kind: 'VerifiedCreators'; fields: [VerifiedCreatorsArgs] }
| { __kind: 'Autograph'; fields: [AutographArgs] }
| { __kind: 'BubblegumV2'; fields: [BubblegumV2Args] }
| { __kind: 'Groups'; fields: [GroupsArgs] }
| { __kind: 'FreezeExecute'; fields: [FreezeExecuteArgs] };
| { __kind: 'FreezeExecute'; fields: [FreezeExecuteArgs] }
| { __kind: 'Groups'; fields: [GroupsArgs] };

export function getPluginSerializer(): Serializer<PluginArgs, Plugin> {
return dataEnum<Plugin>(
Expand Down Expand Up @@ -213,18 +213,18 @@ export function getPluginSerializer(): Serializer<PluginArgs, Plugin> {
['fields', tuple([getBubblegumV2Serializer()])],
]),
],
[
'Groups',
struct<GetDataEnumKindContent<Plugin, 'Groups'>>([
['fields', tuple([getGroupsSerializer()])],
]),
],
[
'FreezeExecute',
struct<GetDataEnumKindContent<Plugin, 'FreezeExecute'>>([
['fields', tuple([getFreezeExecuteSerializer()])],
]),
],
[
'Groups',
struct<GetDataEnumKindContent<Plugin, 'Groups'>>([
['fields', tuple([getGroupsSerializer()])],
]),
],
],
{ description: 'Plugin' }
) as Serializer<PluginArgs, Plugin>;
Expand Down Expand Up @@ -298,14 +298,14 @@ export function plugin(
kind: 'BubblegumV2',
data: GetDataEnumKindContent<PluginArgs, 'BubblegumV2'>['fields']
): GetDataEnumKind<PluginArgs, 'BubblegumV2'>;
export function plugin(
kind: 'Groups',
data: GetDataEnumKindContent<PluginArgs, 'Groups'>['fields']
): GetDataEnumKind<PluginArgs, 'Groups'>;
export function plugin(
kind: 'FreezeExecute',
data: GetDataEnumKindContent<PluginArgs, 'FreezeExecute'>['fields']
): GetDataEnumKind<PluginArgs, 'FreezeExecute'>;
export function plugin(
kind: 'Groups',
data: GetDataEnumKindContent<PluginArgs, 'Groups'>['fields']
): GetDataEnumKind<PluginArgs, 'Groups'>;
export function plugin<K extends PluginArgs['__kind']>(
kind: K,
data?: any
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/types/pluginType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export enum PluginType {
VerifiedCreators,
Autograph,
BubblegumV2,
Groups,
FreezeExecute,
Groups,
}

export type PluginTypeArgs = PluginType;
Expand Down
2 changes: 1 addition & 1 deletion clients/rust/src/generated/types/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ pub enum Plugin {
VerifiedCreators(VerifiedCreators),
Autograph(Autograph),
BubblegumV2(BubblegumV2),
Groups(Groups),
FreezeExecute(FreezeExecute),
Groups(Groups),
}
2 changes: 1 addition & 1 deletion clients/rust/src/generated/types/plugin_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ pub enum PluginType {
VerifiedCreators,
Autograph,
BubblegumV2,
Groups,
FreezeExecute,
Groups,
}
2 changes: 1 addition & 1 deletion clients/rust/src/hooked/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ impl From<&Plugin> for PluginType {
Plugin::VerifiedCreators(_) => PluginType::VerifiedCreators,
Plugin::Autograph(_) => PluginType::Autograph,
Plugin::BubblegumV2(_) => PluginType::BubblegumV2,
Plugin::Groups(_) => PluginType::Groups,
Plugin::FreezeExecute(_) => PluginType::FreezeExecute,
Plugin::Groups(_) => PluginType::Groups,
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions idls/mpl_core.json
Original file line number Diff line number Diff line change
Expand Up @@ -5331,18 +5331,18 @@
]
},
{
"name": "Groups",
"name": "FreezeExecute",
"fields": [
{
"defined": "Groups"
"defined": "FreezeExecute"
}
]
},
{
"name": "FreezeExecute",
"name": "Groups",
"fields": [
{
"defined": "FreezeExecute"
"defined": "Groups"
}
]
}
Expand Down Expand Up @@ -5403,10 +5403,10 @@
"name": "BubblegumV2"
},
{
"name": "Groups"
"name": "FreezeExecute"
},
{
"name": "FreezeExecute"
"name": "Groups"
}
]
}
Expand Down
26 changes: 13 additions & 13 deletions programs/mpl-core/src/plugins/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ pub enum Plugin {
Autograph(Autograph),
/// The Bubblegum V2 plugin allows a Core collection to contain Compressed NFTs (cNFTs) from the Bubblegum program.
BubblegumV2(BubblegumV2),
/// Groups plugin stores parent group memberships of a collection for taxonomy purposes
Groups(Groups),
/// Freeze Execute plugin.
FreezeExecute(FreezeExecute),
/// Groups plugin stores parent group memberships of a collection for taxonomy purposes
Groups(Groups),
}

impl Plugin {
Expand Down Expand Up @@ -110,8 +110,8 @@ impl Plugin {
Plugin::VerifiedCreators(inner) => inner,
Plugin::Autograph(inner) => inner,
Plugin::BubblegumV2(inner) => inner,
Plugin::Groups(inner) => inner,
Plugin::FreezeExecute(inner) => inner,
Plugin::Groups(inner) => inner,
}
}
}
Expand Down Expand Up @@ -142,10 +142,10 @@ impl DataBlob for Plugin {
Plugin::AddBlocker(add_blocker) => add_blocker.len(),
Plugin::ImmutableMetadata(immutable_metadata) => immutable_metadata.len(),
Plugin::VerifiedCreators(verified_creators) => verified_creators.len(),
Plugin::Autograph(autograph) => autograph.len(),
Plugin::BubblegumV2(bubblegum_v2) => bubblegum_v2.len(),
Plugin::Groups(groups) => groups.len(),
Plugin::FreezeExecute(freeze_execute) => freeze_execute.len(),
Plugin::Autograph(autograph) => autograph.len(),
Plugin::BubblegumV2(bubblegum_v2) => bubblegum_v2.len(),
Plugin::FreezeExecute(freeze_execute) => freeze_execute.len(),
Plugin::Groups(groups) => groups.len(),
}
}
}
Expand Down Expand Up @@ -200,10 +200,10 @@ pub enum PluginType {
Autograph,
/// Bubblegum V2 plugin.
BubblegumV2,
/// Groups plugin.
Groups,
/// Freeze Execute plugin.
FreezeExecute,
/// Groups plugin.
Groups,
}

impl PluginType {
Expand Down Expand Up @@ -243,8 +243,8 @@ impl From<&Plugin> for PluginType {
Plugin::VerifiedCreators(_) => PluginType::VerifiedCreators,
Plugin::Autograph(_) => PluginType::Autograph,
Plugin::BubblegumV2(_) => PluginType::BubblegumV2,
Plugin::Groups(_) => PluginType::Groups,
Plugin::FreezeExecute(_) => PluginType::FreezeExecute,
Plugin::Groups(_) => PluginType::Groups,
}
}
}
Expand All @@ -271,8 +271,8 @@ impl PluginType {
PluginType::BubblegumV2 => Authority::Address {
address: mpl_bubblegum::ID,
},
PluginType::Groups => Authority::UpdateAuthority,
PluginType::FreezeExecute => Authority::Owner,
PluginType::Groups => Authority::UpdateAuthority,
}
}
}
Expand Down Expand Up @@ -324,8 +324,8 @@ mod test {
Plugin::VerifiedCreators(VerifiedCreators { signatures: vec![] }),
Plugin::Autograph(Autograph { signatures: vec![] }),
Plugin::BubblegumV2(BubblegumV2 {}),
Plugin::Groups(Groups { groups: vec![] }),
Plugin::FreezeExecute(FreezeExecute { frozen: false }),
Plugin::Groups(Groups { groups: vec![] }),
];

assert_eq!(
Expand Down Expand Up @@ -442,10 +442,10 @@ mod test {
}],
})],
vec![Plugin::BubblegumV2(BubblegumV2 {})],
vec![Plugin::FreezeExecute(FreezeExecute { frozen: true })],
vec![Plugin::Groups(Groups {
groups: vec![Pubkey::default()],
})],
vec![Plugin::FreezeExecute(FreezeExecute { frozen: true })],
];

assert_eq!(
Expand Down
5 changes: 0 additions & 5 deletions programs/mpl-core/src/processor/add_assets_to_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ pub(crate) fn add_assets_to_group_v1<'a>(

// Iterate over each asset account in remaining_accounts.
for asset_info in remaining_accounts.iter() {
if !asset_info.is_writable {
msg!("Error: Asset account must be writable");
return Err(ProgramError::InvalidAccountData);
}

// authority must be valid for asset
is_valid_asset_authority(asset_info, authority_info)?;

Expand Down
5 changes: 0 additions & 5 deletions programs/mpl-core/src/processor/add_group_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ pub(crate) fn add_group_plugin<'a>(
return Err(MplCoreError::InvalidPlugin.into());
}

// Disallow owner-managed plugins **except** Autograph (which is explicitly allowed above).
if plugin_type != PluginType::Autograph && args.plugin.manager() == Authority::Owner {
return Err(MplCoreError::InvalidAuthority.into());
}

// Plugin-specific validation (best-effort, mirrors AddCollectionPlugin)
let default_authority = args.plugin.manager();
let target_plugin_authority = args.init_authority.as_ref().unwrap_or(&default_authority);
Expand Down