Skip to content

Commit f569292

Browse files
committed
Merge branch 'main' of github.com:metaplex-foundation/mpl-core
2 parents f232f90 + 37b719c commit f569292

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

.github/.env

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CARGO_TERM_COLOR=always
2-
NODE_VERSION=16.x
2+
NODE_VERSION=20.x
33
PROGRAMS=["mpl-core"]
44
RUST_VERSION=1.75.0
55
SOLANA_VERSION=1.17.25

.github/workflows/test-js-client.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
node: ["16.x", "18.x"]
18+
node: ["20.x", "22.x"]
1919
steps:
2020
- name: Git checkout
2121
uses: actions/checkout@v4

Cargo.lock

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/rust/Cargo.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ version = "0.8.1-beta.1"
1111
crate-type = ["cdylib", "lib"]
1212

1313
[features]
14-
anchor = ["dep:anchor-lang"]
14+
anchor = ["dep:anchor-lang", "kaigan/anchor"]
1515
serde = ["dep:serde", "dep:serde_with"]
1616
test-sbf = []
1717

1818
[dependencies]
1919
anchor-lang = { version = "0.30.0", optional = true }
2020
base64 = "0.22.0"
2121
borsh = "^0.10"
22-
kaigan = { version = "0.2.5", features = ["serde"] }
2322
modular-bitfield = "0.11.2"
2423
num-derive = "^0.3"
2524
num-traits = "^0.2"
@@ -30,6 +29,8 @@ serde_with = { version = "^3.0", optional = true }
3029
solana-program = "> 1.14"
3130
thiserror = "^1.0"
3231

32+
kaigan = { version = "0.2.6", features = ["serde"], optional = false }
33+
3334
[dev-dependencies]
3435
assert_matches = "1.5.0"
3536
solana-program-test = "> 1.14"

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

+11-4
Original file line numberDiff line numberDiff line change
@@ -201,26 +201,33 @@ fn update<'a>(
201201
return Err(MplCoreError::PermanentDelegatesPreventMove.into());
202202
}
203203

204+
// Create a default update delegate to be updated with the fetched plugin.
205+
let mut plugin: UpdateDelegate = UpdateDelegate::default();
206+
204207
// Make sure the authority has authority to add the asset to the new collection.
205208
if plugin_set.contains(&PluginType::UpdateDelegate) {
206209
// Fetch the update delegate on the new collection.
207-
let (plugin_authority, _, _) = fetch_plugin::<CollectionV1, UpdateDelegate>(
210+
// Do not ignore the return plugin as we need to check the additional delegates.
211+
let (plugin_authority, fetched_plugin, _) = fetch_plugin::<CollectionV1, UpdateDelegate>(
208212
new_collection_account,
209213
PluginType::UpdateDelegate,
210214
)?;
211215

212-
if assert_collection_authority(
216+
plugin = fetched_plugin;
217+
218+
if (assert_collection_authority(
213219
&new_collection,
214220
authority,
215221
&plugin_authority,
216222
)
217223
.is_err()
218-
&& authority.key != &new_collection.update_authority
224+
&& authority.key != &new_collection.update_authority)
225+
&& !plugin.additional_delegates.contains(&authority.key)
219226
{
220227
solana_program::msg!("UA: Rejected");
221228
return Err(MplCoreError::InvalidAuthority.into());
222229
}
223-
} else if authority.key != &new_collection.update_authority {
230+
} else if authority.key != &new_collection.update_authority && !plugin.additional_delegates.contains(&authority.key) {
224231
solana_program::msg!("UA: Rejected");
225232
return Err(MplCoreError::InvalidAuthority.into());
226233
}

0 commit comments

Comments
 (0)