Skip to content

Update period end calculation to permission end on overflow #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

ilikesymmetry
Copy link
Contributor

@ilikesymmetry ilikesymmetry commented Oct 21, 2024

This does not change any functionality, but maintains our data clarity when the final period exceeds the permission's end. The largest a PermissionSpend.end will ever be is equivalent to SpendPermission.end which follows the intended use case. Prior, we were letting PermissionSpend.end > SpendPermission.end theoretically which was misleading because other logic enforces SpendPermission.end as the absolute end of using a permission, regardless of period spend ranges.

Copy link
Contributor

@amiecorso amiecorso left a comment

Choose a reason for hiding this comment

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

nice, this actually makes the logic in getPeriodSpend more intuitive to read too

@ilikesymmetry ilikesymmetry merged commit 4976741 into main Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants