Skip to content
New issue

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

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

Already on GitHub? # to your account

feat!: Add informative response fields for leverage messages #1236

Merged
merged 27 commits into from
Aug 15, 2022
Merged

Conversation

toteki
Copy link
Member

@toteki toteki commented Aug 10, 2022

Main changes:

  • Leverage Message types now return any sdk.Coins representing effects achieved that are not equal to input fields. This includes uTokens received when supplying, and base tokens received when withdrawing.

And some miscellaneous changes:

  • Reorder make proto-all for ideal execution. (Format first, then lint, then generate, then swagger)
  • Standardized Coin -> Asset in MsgCollateralize and MsgDecollateralize
  • Event repay_borrowed_asset is now just repay
  • Event supply attribute amount removed, now has supplied and received
  • Event withdraw attribute amount removed, now has redeemed and received

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • added appropriate labels to the PR
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@toteki toteki changed the title chore!: Add informative response fields for leverage messages feat!: Add informative response fields for leverage messages Aug 10, 2022
@toteki toteki marked this pull request as ready for review August 10, 2022 20:27
@toteki toteki requested review from a team as code owners August 10, 2022 20:27
Copy link
Member

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

many good updates.

  • let's don't store in response a copy of input - no need to pollute storage
  • proto messages should follow the API language - we decided to use Assest rather than coin / token. If we want to change the language of API, then it's better to firstly discuss it on Slack, rather than in PR (unless something is small) to avoid going too much back and forth.

@codecov-commenter
Copy link

codecov-commenter commented Aug 11, 2022

Codecov Report

Merging #1236 (fb37977) into main (4702557) will decrease coverage by 0.06%.
The diff coverage is 22.97%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1236      +/-   ##
==========================================
- Coverage   50.53%   50.46%   -0.07%     
==========================================
  Files          67       67              
  Lines        6831     6838       +7     
==========================================
- Hits         3452     3451       -1     
- Misses       3135     3143       +8     
  Partials      244      244              
Impacted Files Coverage Δ
x/leverage/keeper/msg_server.go 0.81% <0.00%> (-0.03%) ⬇️
x/leverage/types/tx.go 0.00% <0.00%> (ø)
x/leverage/keeper/keeper.go 40.62% <44.11%> (-0.24%) ⬇️
x/leverage/simulation/operations.go 94.94% <100.00%> (ø)

@toteki
Copy link
Member Author

toteki commented Aug 11, 2022

Note: I intend to write some newly possible tests in keeper_test.go, so no need to look at this again until then. Other files are complete though.

Copy link
Member

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

Pre-approving.

  • please add at least one test with a new response
  • create an issue to add more tests.

@toteki
Copy link
Member Author

toteki commented Aug 15, 2022

Initial tests added. Test improvement issue created at #1242

@toteki toteki merged commit 012c412 into main Aug 15, 2022
@toteki toteki deleted the adam/msg branch August 15, 2022 18:01
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants