Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fast-usdc): disallow all non-positive integer counts in Multiset (#…
…11079) _Incidental_ refs: #11066 ## Description A negative or zero value is not a non-positive value. Even in values that are verified `typeof number`, `NaN` doesn't satisfy the former check but should be excluded as a non-positive. For removal, if a missing value returns `false` for any requested removal count, for consistency so should a removal request for a count larger than the current count. After feedback, also fail if the count is not an integer. ### Security Considerations Avoiding corrupted `currentCount` state if an unexpected value finds its way to the add / remove. ### Scaling Considerations None ### Documentation Considerations I don't believe this has any ### Testing Considerations Updated unit tests ### Upgrade Considerations This changes the behavior in 2 ways: - Refusing currently unexpected values that would result in a corrupted state - Allowing but returning false for removal of counts larger than current value. For existing valid usages it should have no effective impact. This change would only be picked up by an upgrade of fast-usdc.
- Loading branch information