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

Feature/add refresh obligation #56

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

SadMouseDev
Copy link

Currently, it's impossible for users to refresh their obligations without triggering borrow/withdraw/liquidate operations. Adding a separate function within lending_market allows users to trigger obligation refreshes.

Changes made:

  • Added public fun refresh_obligation<P> within the lending_market module. This follows the same coding patterns as other functions. I chose obligation_owner_cap as the argument so that only users themselves can trigger this refresh. It might also be useful to accept obligation_id instead, so that anyone could trigger this function. However, I'm using obligation_owner_cap because it doesn't open doors for potential abuse.
  • In lending_market_tests.move: Added test_refresh_obligation() for the happy path and test_refresh_obligation_stale_oracle() for the unhappy path.

- Add refresh_obligation function to lending_market.move
- Add test cases for successful refresh and stale oracle scenarios
- Add refresh_obligation function to lending_market.move
- Add test cases for successful refresh and stale oracle scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant