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

REFACTOR: daily data tracker #1658

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

REFACTOR: daily data tracker #1658

wants to merge 1 commit into from

Conversation

narumiruna
Copy link
Collaborator

@narumiruna narumiruna commented Jun 18, 2024

This pull request refactors the FeeBudget class to replace the State structure with a new DailyDataTracker utility class for better code organization and functionality. The changes also include updates to the corresponding test cases to align with the new structure.

Refactoring FeeBudget class:

  • Replaced the State structure with the DailyDataTracker class for tracking daily fee budgets and accumulated fees. (pkg/strategy/common/fee_budget.go)
  • Updated methods in FeeBudget to use DailyDataTracker for checking and resetting fee data. (pkg/strategy/common/fee_budget.go) [1] [2]

Test updates:

  • Modified test cases to use DailyDataTracker instead of State for validating fee budget logic. (pkg/strategy/common/fee_budget_test.go)

New utility class:

  • Introduced DailyDataTracker class in pkg/util/daily_data_tracker.go to encapsulate the logic for tracking and resetting daily data. (pkg/util/daily_data_tracker.go)

@narumiruna narumiruna requested review from c9s and kbearXD June 18, 2024 10:41
Base automatically changed from narumi/fee-budget to main June 20, 2024 13:26
log "github.com/sirupsen/logrus"
)

type Countdown struct {
Copy link
Owner

Choose a reason for hiding this comment

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

DailyDataTracker or PeriodicDataTracker

@narumiruna narumiruna force-pushed the narumi/countdown branch 2 times, most recently from a57b663 to 8fc643e Compare July 9, 2024 07:50
@narumiruna narumiruna changed the title REFACTOR: countdown util REFACTOR: daily data tracker Jul 9, 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.

2 participants