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

fix: ignore triggers from the past when voting #5798

Merged
merged 3 commits into from
Jan 7, 2024

Conversation

UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Jan 2, 2024

Issue being fixed or feature implemented

we should not vote on triggers from the past

What was done?

How Has This Been Tested?

n/a

Breaking Changes

n/a

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

@UdjinM6 UdjinM6 added this to the 20.1 milestone Jan 2, 2024
PastaPastaPasta
PastaPastaPasta previously approved these changes Jan 3, 2024
Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK for squash merge; are there any ideas on how we can create a test for this?

@knst
Copy link
Collaborator

knst commented Jan 5, 2024

there any ideas on how we can create a test for this?

Functional tests have a feature "check a string in logs". So, we can make some triggers to expire; after that assert that logs doesn't have this substring: CGovernanceManager::%s Voting NO-FUNDING - it appears in logs only if trigger is not expired with current implementation.

This feature assert_debug_log is used here and here for example

@knst
Copy link
Collaborator

knst commented Jan 5, 2024

p.s. assert_debug_log can works in 2 modes: expected logs and unexpected logs; both arguments are arrays.
Here's a signature:

    def assert_debug_log(self, expected_msgs, unexpected_msgs=None, timeout=2):

@UdjinM6
Copy link
Author

UdjinM6 commented Jan 5, 2024

there any ideas on how we can create a test for this?

Functional tests have a feature "check a string in logs". So, we can make some triggers to expire; after that assert that logs doesn't have this substring: CGovernanceManager::%s Voting NO-FUNDING - it appears in logs only if trigger is not expired with current implementation.

This feature assert_debug_log is used here and here for example

Good idea! 👍

@UdjinM6 UdjinM6 force-pushed the ignore_outdated_triggers branch from 9dfb5ba to 4d940a5 Compare January 5, 2024 22:57
Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK for squash merge

Copy link
Collaborator

@knst knst left a comment

Choose a reason for hiding this comment

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

utACK

@PastaPastaPasta PastaPastaPasta merged commit 2511126 into dashpay:develop Jan 7, 2024
8 checks passed
knst pushed a commit to knst/dash that referenced this pull request Jan 10, 2024
## Issue being fixed or feature implemented
we should not vote on triggers from the past

## What was done?

## How Has This Been Tested?
n/a

## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
@UdjinM6 UdjinM6 modified the milestones: 20.1, 20.0.4 Jan 10, 2024
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