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

Loans: add outstanding principal & interest to runtime API #1482

Merged
merged 4 commits into from Aug 9, 2023

Conversation

lemunozm
Copy link
Contributor

@lemunozm lemunozm commented Aug 8, 2023

Description

Add outstanding_debt loan's property to runtime API
Add outstanding_principal and outstanding_interest to the runtime API.

@lemunozm lemunozm added Q1-easy Can be done by primarily duplicating and adapting code. I3-annoyance The code behaves as expected, but "expected" is an issue. P7-asap Issue should be addressed in the next days. D5-breaks-api Pull request changes public api. Document changes publicly. labels Aug 8, 2023
@lemunozm lemunozm requested a review from hieronx August 8, 2023 16:14
@lemunozm lemunozm self-assigned this Aug 8, 2023
Copy link
Collaborator

@mustermeiszer mustermeiszer left a comment

Choose a reason for hiding this comment

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

Why add the debt to the type itself instead of just computing it on the fly in the API? Api is still missing, right?

@lemunozm
Copy link
Contributor Author

lemunozm commented Aug 9, 2023

the debt to the type itself instead of just computing it on the fly in the API

This is just what is happening, the type where I added interest/present_value/... is a type only used for the Runtime API, and is there where things are computed.

BTW, This PR needs a refactor after a last talk with Jeroen.

hieronx
hieronx previously approved these changes Aug 9, 2023
Copy link
Contributor

@hieronx hieronx left a comment

Choose a reason for hiding this comment

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

LGTM!

pallets/loans/src/entities/loans.rs Outdated Show resolved Hide resolved
@lemunozm lemunozm changed the title Loans: add outstanding debt to runtime API Loans: add outstanding principal & interest to runtime API Aug 9, 2023
@lemunozm lemunozm enabled auto-merge (squash) August 9, 2023 11:22
@lemunozm lemunozm merged commit ef9f6fe into main Aug 9, 2023
11 checks passed
@lemunozm lemunozm deleted the loans/api-outstanding-debt branch August 9, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D5-breaks-api Pull request changes public api. Document changes publicly. I3-annoyance The code behaves as expected, but "expected" is an issue. P7-asap Issue should be addressed in the next days. Q1-easy Can be done by primarily duplicating and adapting code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants