Skip to content

Comments

fix(fuses): correct checkPccBurned logic to check for burned fuse#294

Open
madisoncarter1234 wants to merge 1 commit intoensdomains:mainfrom
madisoncarter1234:fix/check-pcc-burned-logic
Open

fix(fuses): correct checkPccBurned logic to check for burned fuse#294
madisoncarter1234 wants to merge 1 commit intoensdomains:mainfrom
madisoncarter1234:fix/check-pcc-burned-logic

Conversation

@madisoncarter1234
Copy link

Summary

  • Fixed checkPccBurned function which was returning the opposite of its intended result
  • The function was checking === 0n (true when fuse is NOT set) instead of === PARENT_CANNOT_CONTROL (true when fuse IS set/burned)
  • Added unit tests to prevent regression

The Bug

// Before (wrong): returns true when fuse is NOT burned
(fuses & ParentFuses.PARENT_CANNOT_CONTROL) === 0n

// After (correct): returns true when fuse IS burned
(fuses & ParentFuses.PARENT_CANNOT_CONTROL) === ParentFuses.PARENT_CANNOT_CONTROL

Test Plan

  • Added 4 unit tests for checkPccBurned function
  • All tests pass locally

Fixes #268

The function was checking === 0n which returns true when the fuse is
NOT set. Fixed to check === PARENT_CANNOT_CONTROL to correctly return
true when the fuse IS burned.

Added tests to prevent regression.

Fixes ensdomains#268
@sonarqubecloud
Copy link

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.

checkPccBurned is incorrectly named

1 participant