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

x/lockup: Get updated lock for events #1184

Merged
merged 3 commits into from
Apr 4, 2022
Merged

x/lockup: Get updated lock for events #1184

merged 3 commits into from
Apr 4, 2022

Conversation

giansalex
Copy link
Contributor

@giansalex giansalex commented Mar 31, 2022

Current endtime in logs (MsgBeginUnlocking) is wrong: 0001-01-01 00:00:00 +0000 UTC because it is updated inside BeginUnlock and eventManager uses outdated lock, i wanted to return the updated lock from that function but it has many references, a quick fix is to get the lock again.

this also includes verifying the owner conditional before BeginUnlock is executed.

endtime field could also be added to MsgBeginUnlockingResponse.


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@codecov-commenter
Copy link

Codecov Report

Merging #1184 (e02a323) into main (cc0ec41) will increase coverage by 0.00%.
The diff coverage is 20.00%.

@@           Coverage Diff           @@
##             main    #1184   +/-   ##
=======================================
  Coverage   21.06%   21.06%           
=======================================
  Files         196      196           
  Lines       25302    25305    +3     
=======================================
+ Hits         5330     5331    +1     
- Misses      19011    19012    +1     
- Partials      961      962    +1     
Impacted Files Coverage Δ
x/lockup/keeper/msg_server.go 82.50% <20.00%> (-1.92%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc0ec41...e02a323. Read the comment docs.

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

We should add a changelog entry for this too please 🙏

x/lockup/keeper/msg_server.go Outdated Show resolved Hide resolved
Copy link
Member

@mattverse mattverse left a comment

Choose a reason for hiding this comment

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

Thanks for this PR + the extra check for unlocking! LGTM!

Copy link
Member

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

LGTM! I wonder if its worth reconsidering at some point how we do events. It does feel a bit silly that we have to do a second GetLockById in the main method. Maybe we should move towards k.createUnlockEvent(ctx, lockId) ? Or move events into the keeper methods rather than msg server?

@ValarDragon ValarDragon merged commit 526749a into osmosis-labs:main Apr 4, 2022
@giansalex giansalex deleted the fix-unlock-end-time-log branch April 4, 2022 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants