Skip to content

Commit

Permalink
Fixing some IX perms (#150)
Browse files Browse the repository at this point in the history
* Fixing inconsistencies with permissions related to performing certain IXes on TM accounts.

* Adding back ignores and fixing tests.
  • Loading branch information
blockiosaurus authored Nov 1, 2024
1 parent 7c95f99 commit 70a0cf2
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 365 deletions.
6 changes: 3 additions & 3 deletions configs/program-scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ for p in ${PROGRAMS[@]}; do
CARGO_TERM_COLOR=always cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} --features padded -- --nocapture 2>&1 | ${SOLFMT} && \
CARGO_TERM_COLOR=always cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} --features padded resize -- --nocapture 2>&1 | ${SOLFMT}
else
cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} -- --nocapture && \
cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} --features padded -- --nocapture && \
cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} --features padded resize -- --nocapture
cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} -- --nocapture --test-threads=1 && \
cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} --features padded -- --nocapture --test-threads=1 && \
cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} --features padded resize -- --nocapture --test-threads=1
fi
done
6 changes: 2 additions & 4 deletions programs/token-metadata/program/src/processor/resize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,8 @@ pub fn process_resize<'a>(
}
// No need to check edition ownership since it is empty for fungibles.

// For fungibles, the update authority is the one who can resize the asset,
// so we need to check that the authority is the update authority of the metadata account.
// Or if the claim period is over, the authority is the resize authority.
if metadata.update_authority != *authority.key && authority.key != &RESIZE_AUTHORITY {
// For fungibles only the resize authority can resize the asset.
if authority.key != &RESIZE_AUTHORITY {
return Err(MetadataError::UpdateAuthorityIncorrect.into());
}
}
Expand Down
Loading

0 comments on commit 70a0cf2

Please sign in to comment.