Skip to content

fix: ignore triggers from the past when voting - #5798

Merged
PastaPastaPasta merged 3 commits into
dashpay:developfrom
UdjinM6:ignore_outdated_triggers
Jan 7, 2024
Merged

PastaPastaPasta merged 3 commits into
dashpay:developfrom
UdjinM6:ignore_outdated_triggers

Conversation

@UdjinM6

@UdjinM6 UdjinM6 commented Jan 2, 2024

Copy link
Copy Markdown

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

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Member

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

knst commented Jan 5, 2024

Copy link
Copy Markdown
Collaborator

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

knst commented Jan 5, 2024

Copy link
Copy Markdown
Collaborator

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

UdjinM6 commented Jan 5, 2024

Copy link
Copy Markdown
Author

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

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

utACK for squash merge

@knst knst left a comment

Copy link
Copy Markdown
Collaborator

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
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