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

SYS-3941 add log lowered claimed event #373

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

MBrozhko34
Copy link
Contributor

Proposed changes

Added LogLoweredClaimed event to primitives, add event handling and update token manager to consume the event.

Type of change/Merge

🚨What type of change is this PR?

Put an x in the boxes that apply

  • Release
    • Increase versions
    • Baseline tests passed
    • Release type:
      • Major release
      • Minor release
      • Patch release

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR.

  • You describe the purpose of the PR, e.g.:
    • What does it do?
    • Highlight what important points reviewers should know about;
    • Indicates if there is something left for follow-up PRs.
  • Documentation updated
  • Business logic tested successfully
  • Verify First, Write Last: In Substrate development, it is important that you always ensure preconditions are met and return errors at the beginning. After these checks have completed, then you may begin the function's computation.

@MBrozhko34 MBrozhko34 requested a review from thadouk April 3, 2024 15:37
@MBrozhko34 MBrozhko34 changed the title Sys 3941 add log lowered claimed event SYS-3941 add log lowered claimed event Apr 4, 2024
@MBrozhko34 MBrozhko34 marked this pull request as ready for review April 4, 2024 13:23
@MBrozhko34 MBrozhko34 force-pushed the SYS-3941-add-LogLoweredClaimed-event branch from 213bd66 to b8024f3 Compare April 4, 2024 13:31
Comment on lines +992 to +999
return match &event.event_data {
EventData::LogLifted(d) => return Self::process_lift(event, d),
EventData::LogAvtGrowthLifted(d) => return Self::process_avt_growth_lift(event, d),
EventData::LogLowerClaimed(d) => return Self::process_lower_claim(event, d),

// Event handled or it is not for us, in which case ignore it.
_ => Ok(()),
}
Copy link
Contributor

Choose a reason for hiding this comment

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

💯

@MBrozhko34 MBrozhko34 force-pushed the SYS-3941-add-LogLoweredClaimed-event branch from 04413f9 to 0322ccb Compare April 5, 2024 10:56
@MBrozhko34 MBrozhko34 force-pushed the SYS-3941-add-LogLoweredClaimed-event branch from 0322ccb to 8eceeaf Compare April 5, 2024 11:27
@MBrozhko34 MBrozhko34 merged commit 728949b into main Apr 5, 2024
5 checks passed
@MBrozhko34 MBrozhko34 deleted the SYS-3941-add-LogLoweredClaimed-event branch April 5, 2024 13:59

assert_ok!(TokenManager::on_event_processed(&mock_event));

assert!(System::events().iter().any(|a| a.event ==
Copy link
Contributor

Choose a reason for hiding this comment

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

might as well add that the lower is not present in the storage item ReadyToClaim

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.

3 participants