Skip to content

Commit

Permalink
Merge branch 'main' of github.com:metaplex-foundation/mpl-asset
Browse files Browse the repository at this point in the history
* 'main' of github.com:metaplex-foundation/mpl-asset:
  Add comment for approval order of operations
  • Loading branch information
nhanphan committed Mar 12, 2024
2 parents db95b41 + f088080 commit 0c8b9f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions programs/mpl-core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ pub fn validate_asset_permissions<'a>(
};
solana_program::msg!("approved: {:#?}", approved);

// Validations by plugins can both approve and deny an action (e.g. the Freeze plugin can reject
// a transfer because the token is frozen) so we always want to evaluate. That is why existing
// `approved` value is second in the OR statement.
approved = validate_plugin_checks(
Key::Collection,
&checks,
Expand All @@ -296,6 +299,7 @@ pub fn validate_asset_permissions<'a>(

solana_program::msg!("approved: {:#?}", approved);

// Again we always want to evaluate the plugin checks so order of operations is important.
approved = validate_plugin_checks(
Key::Asset,
&checks,
Expand Down

0 comments on commit 0c8b9f2

Please sign in to comment.