NexusMutual / smart-contracts

GNU General Public License v3.0
170 stars 60 forks source link

Fix: skip deallocations when burning in grace period #1203

Closed shark0der closed 1 month ago

shark0der commented 1 month ago

Context

When a burn is triggered while the cover is in grace period the deallocation is redundant since it will be done when the bucket expiration is processed.

Changes proposed in this pull request

The newly added code skips deallocations if the cover is expired.

Test plan

Added a test to ensure the allocations stay the same.

Checklist

Review

When reviewing a PR, please indicate intention in comments using the following emojis:

rackstar commented 1 month ago

marking as draft so it won't be accidentally merged while on audit