Skip to content

runtime-sdk/consensus_accounts: Include shares and epoch in delegation events #2226

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

Merged
merged 3 commits into from
May 26, 2025

Conversation

ptrus
Copy link
Member

@ptrus ptrus commented May 23, 2025

  • DelegateEvent also returns the amount of new shares received by the delegation.
  • UndelegateDoneEvent includes the undelegation epoch.
  • Added queries to return all {un}delegations

Made it optional so it's backwards compatible (old events can still be deserialized with the type).

Ensure Nexus deployments are updated first, before a paratime with this change is released.

Copy link

netlify bot commented May 23, 2025

Deploy Preview for oasisprotocol-oasis-sdk canceled.

Name Link
🔨 Latest commit 114ff20
🔍 Latest deploy log https://app.netlify.com/projects/oasisprotocol-oasis-sdk/deploys/68347cab9c09260008841b0f

Copy link

codecov bot commented May 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.36%. Comparing base (0ed23eb) to head (f223b77).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2226      +/-   ##
==========================================
- Coverage   55.37%   55.36%   -0.02%     
==========================================
  Files         155      155              
  Lines       11725    11749      +24     
==========================================
+ Hits         6493     6505      +12     
- Misses       5232     5244      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ptrus ptrus force-pushed the ptrus/feature/delegation-shares branch from f223b77 to 7cd481f Compare May 23, 2025 11:13
@ptrus ptrus changed the title runtime-sdk/consensus_accounts: Include shares in DelegateEvent runtime-sdk/consensus_accounts: Include shares in DelegateEvent and epoch in UndelegateDoneEvent May 23, 2025
@ptrus ptrus force-pushed the ptrus/feature/delegation-shares branch from 7cd481f to a0dddda Compare May 23, 2025 11:15
@ptrus ptrus changed the title runtime-sdk/consensus_accounts: Include shares in DelegateEvent and epoch in UndelegateDoneEvent runtime-sdk/consensus_accounts: Include shares and epoch in delegation events May 23, 2025
@ptrus ptrus force-pushed the ptrus/feature/delegation-shares branch 6 times, most recently from 23216a2 to e3aaa50 Compare May 23, 2025 12:58
@ptrus ptrus marked this pull request as ready for review May 23, 2025 13:30
@ptrus ptrus requested review from kostko, pro-wh and peternose as code owners May 23, 2025 13:30
@ptrus ptrus force-pushed the ptrus/feature/delegation-shares branch from e3aaa50 to 08406d0 Compare May 23, 2025 13:34
@@ -199,6 +214,8 @@ type DelegateEvent struct {
To types.Address `json:"to"`
Amount types.BaseUnits `json:"amount"`
Error *ConsensusError `json:"error,omitempty"`
// Added in runtime-sdk v0.15.0.
Copy link
Contributor

Choose a reason for hiding this comment

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

Will these comments be removed in the future?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure. As far as I'm concerned, I can also remove the comment now. But for someone looking at the code without this comment, it won't be obvious why this field is potentially empty.

@ptrus ptrus force-pushed the ptrus/feature/delegation-shares branch from 08406d0 to 114ff20 Compare May 26, 2025 14:37
@ptrus ptrus merged commit 595e8b2 into main May 26, 2025
26 checks passed
@ptrus ptrus deleted the ptrus/feature/delegation-shares branch May 26, 2025 15:32
github-actions bot added a commit that referenced this pull request May 26, 2025
…trus/feature/delegation-shares

runtime-sdk/consensus_accounts: Include shares and epoch in delegation events 595e8b2
github-actions bot added a commit that referenced this pull request May 26, 2025
…/ptrus/feature/delegation-shares

runtime-sdk/consensus_accounts: Include shares and epoch in delegation events 595e8b2
github-actions bot added a commit to OasisUnofficial/oasis-sdk that referenced this pull request May 26, 2025
…sisprotocol/ptrus/feature/delegation-shares

runtime-sdk/consensus_accounts: Include shares and epoch in delegation events 595e8b2
github-actions bot added a commit to OasisUnofficial/oasis-sdk that referenced this pull request May 26, 2025
…oasisprotocol/ptrus/feature/delegation-shares

runtime-sdk/consensus_accounts: Include shares and epoch in delegation events 595e8b2
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.

2 participants