Skip to content
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

fix: improve budget validation logic and tests, spec doc #110

Merged
merged 6 commits into from
Mar 11, 2022

Conversation

dongsam
Copy link
Contributor

@dongsam dongsam commented Mar 6, 2022

Description

closes: #109

Tasks

  • [5] enhance the logic to only consider overlapping budgets when calculating the total rate for each time slot Incorrect budget validation may reject valid overlapping budget plans #109
  • [7] update spec doc more precisely
  • [18] add a check to the Validate function that ensures that source and destination addresses are different.
  • [12] simplify budget_collected event
  • refactor budget.Collectible to use DateRangeIncludes
  • refactor and add test cases for budgets
  • add omitted ValidateEpochBlocks on params
  • fix budget collection logic more conservatively and safely
  • fix simulation to cover edge cases
  • fix to get balance only spendable on budget source

References

  • Audit Report Budget and Farming Cosmos SDK Modules v0.1

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Appropriate labels applied
  • Targeted PR against correct branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@dongsam dongsam self-assigned this Mar 6, 2022
@dongsam dongsam added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request test and simulation test and simulation labels Mar 6, 2022
@dongsam dongsam marked this pull request as ready for review March 8, 2022 14:05
Copy link
Contributor

@jaybxyz jaybxyz left a comment

Choose a reason for hiding this comment

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

I think all the tasks are covered well. Great work! LGTM

Copy link
Contributor

@hallazzang hallazzang left a comment

Choose a reason for hiding this comment

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

LGTM overall. There's just a minor suggestion.

x/budget/types/params.go Outdated Show resolved Hide resolved
@dongsam dongsam merged commit 63734a6 into main Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request test and simulation test and simulation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect budget validation may reject valid overlapping budget plans
3 participants