Skip to content

NONEVM-5256: MCMS cap object transfer fix#409

Draft
FelixFan1992 wants to merge 6 commits into
developfrom
nonevm-5256
Draft

NONEVM-5256: MCMS cap object transfer fix#409
FelixFan1992 wants to merge 6 commits into
developfrom
nonevm-5256

Conversation

@FelixFan1992

Copy link
Copy Markdown
Collaborator

Describe your changes

..

Issue ticket number and link

..

Describe highly relevant files or code snippets that are critical in the review

..

Are there other PRs that should be merged first?

..

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the MCMS deployer to support releasing an UpgradeCap by an explicit package address (to handle cases where the cap is re-keyed after commit_upgrade), and expands unit tests and generated Go bindings accordingly.

Changes:

  • Add release_upgrade_cap_at and refactor release_upgrade_cap into a wrapper (in both mcms and fast_mcms Move packages).
  • Update MCMS deployer tests to register caps under a separate “package key” and add coverage for release behavior before/after commit_upgrade.
  • Regenerate Go bindings to include release_upgrade_cap_at.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
contracts/mcms/mcms/sources/mcms_deployer.move Adds release_upgrade_cap_at and updates release_upgrade_cap wrapper/docs.
contracts/mcms/fast_mcms/sources/mcms_deployer.move Mirrors the deployer changes in the fast_mcms package.
contracts/mcms/mcms/tests/mcms_deployer_test.move Updates existing tests and adds new tests for release_upgrade_cap_at behavior.
contracts/mcms/fast_mcms/tests/mcms_deployer_test.move Mirrors the test updates for fast_mcms.
bindings/generated/mcms/mcms_deployer/mcms_deployer.go Adds binding support for release_upgrade_cap_at.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 169 to 173
assert!(proof_type == expected_proof_type, EWrongProofType);

let package_address = address::from_ascii_bytes(&proof_account_address.into_bytes());
assert!(state.upgrade_caps.contains(package_address), EPackageAddressNotRegistered);

let upgrade_cap = state.upgrade_caps.remove(package_address);
Comment on lines 169 to 173
assert!(proof_type == expected_proof_type, EWrongProofType);

let package_address = address::from_ascii_bytes(&proof_account_address.into_bytes());
assert!(state.upgrade_caps.contains(package_address), EPackageAddressNotRegistered);

let upgrade_cap = state.upgrade_caps.remove(package_address);

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 6 comments.

Comment on lines +151 to 155
public fun release_upgrade_cap_at<T: drop>(
state: &mut DeployerState,
registry: &Registry,
package_address: address,
_proof: T,
Comment on lines +151 to 155
public fun release_upgrade_cap_at<T: drop>(
state: &mut DeployerState,
registry: &Registry,
package_address: address,
_proof: T,
ts::next_tx(scenario, @0xA);
let ctx = ts::ctx(scenario);
let publisher = package::test_claim(MCMS_DEPLOYER_TEST {}, ctx);
let package_address = address::from_ascii_bytes(&(*publisher.package()).into_bytes());
ts::next_tx(&mut scenario, @0xA);
let ctx = ts::ctx(&mut scenario);
let publisher = package::test_claim(MCMS_DEPLOYER_TEST {}, ctx);
let package_address = address::from_ascii_bytes(&(*publisher.package()).into_bytes());
ts::next_tx(scenario, @0xA);
let ctx = ts::ctx(scenario);
let publisher = package::test_claim(MCMS_DEPLOYER_TEST {}, ctx);
let package_address = address::from_ascii_bytes(&(*publisher.package()).into_bytes());
ts::next_tx(&mut scenario, @0xA);
let ctx = ts::ctx(&mut scenario);
let publisher = package::test_claim(MCMS_DEPLOYER_TEST {}, ctx);
let package_address = address::from_ascii_bytes(&(*publisher.package()).into_bytes());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants