Skip to content

Conversation

@r-near
Copy link
Contributor

@r-near r-near commented Mar 5, 2025

Purpose

Enhances migration documentation and adds tests for migrating from single manager_roles to separate pause_roles/unpause_roles in the Pausable plugin.

Changes

  1. Updated Migration Guide:

    • Added warnings about preserving enum variant order in #[derive(AccessControlRole)]
    • Emphasized adding new roles at enum end to maintain permission bitflag mapping
    • Provided migration code examples for both separation and backward compatibility
  2. Added Migration Tests:

    • Created test contracts demonstrating old/new implementations
    • Implemented test verifying permission behavior through upgrade process
    • Demonstrated safe role addition with maintained permissions

Testing

  • Added test contracts (pausable_old, pausable_new)
  • Implemented pausable_migration.rs test that:
    • Validates both pre/post-migration behaviors
    • Verifies proper permission inheritance
    • Tests role separation after migration

@r-near r-near marked this pull request as ready for review March 5, 2025 17:37
@r-near r-near requested a review from a team March 8, 2025 06:14
@r-near r-near enabled auto-merge (squash) March 8, 2025 06:14
Copy link
Contributor

@kiseln kiseln left a comment

Choose a reason for hiding this comment

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

Feeling dejavu like I already reviewed this

@r-near r-near merged commit 25cb486 into master Apr 8, 2025
2 checks passed
@r-near r-near deleted the pausable-migration branch April 8, 2025 05:51
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.

5 participants