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

bug: Add recalculateActiveCoverInAsset to Cover contract #1082

Conversation

MilGard91
Copy link
Contributor

@MilGard91 MilGard91 commented Mar 18, 2024

Context

There was a bug before when we did expireCover method, that we removed it from the bucket but didn't update the active cover amount, after that was fixed we have bad data in the contract. Calling this function will recalculate the amount by going through all the buckets and sum all the their amounts. Since year is the max period for cover buy, the 52 week/bucket constant was used.

Issue: #1049

Changes proposed in this pull request

Add new function that will recalculate bad active cover data

Test plan

Tests will be added in the for test

Checklist

  • Rebased the base branch
  • Attached corresponding Github issue
  • Prefixed the name with the type of change (i.e. feat, chore, test)
  • Performed a self-review of my own code
  • Followed the style guidelines of this project
  • Made corresponding changes to the documentation
  • Didn't generate new warnings
  • Didn't generate failures on existing tests
  • Added tests that prove my fix is effective or that my feature works

Review

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

  • 🍰 = Nice to have but not essential.
  • 💡 = Suggestion or a comment based on personal opinion
  • 🔨 = I believe this should be changed.
  • 🤔 = I don’t understand something, do you mind giving me more context?
  • 🚀 = Feedback

@MilGard91 MilGard91 linked an issue Mar 18, 2024 that may be closed by this pull request
@roxdanila roxdanila added enhancement New feature or request in-review labels Mar 22, 2024
@shark0der shark0der force-pushed the feature/cover-products-contract-rebased branch 4 times, most recently from 4d11315 to fce848c Compare April 1, 2024 13:31
@roxdanila roxdanila changed the title Add recalculateActiveCoverInAsset to Cover contract bug: Add recalculateActiveCoverInAsset to Cover contract Apr 2, 2024
@roxdanila roxdanila added bug Something isn't working and removed enhancement New feature or request labels Apr 2, 2024
@MilGard91 MilGard91 force-pushed the feature/cover-products-contract-rebased branch from bf854aa to 8fc3689 Compare April 16, 2024 08:30
@MilGard91 MilGard91 force-pushed the feature/cover-products-contract-rebased branch from 7344e45 to 6d1238d Compare June 11, 2024 16:41
@MilGard91 MilGard91 force-pushed the feature/recalculate-totalCoverAmount branch from 8dcc2cf to 06d20b2 Compare June 12, 2024 06:57
@roxdanila roxdanila merged commit 8934a0e into feature/cover-products-contract-rebased Jun 13, 2024
6 checks passed
@roxdanila roxdanila deleted the feature/recalculate-totalCoverAmount branch June 13, 2024 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cover: Add function to recalculate totalCoverAmount
3 participants