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

chore(sequencer): consolidate all action handling to one module #1759

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ethanoroshiba
Copy link
Contributor

@ethanoroshiba ethanoroshiba commented Oct 28, 2024

Summary

Moved all action and transaction handling to single module.

Background

Previously, all implementations of ActionHandler were done separately in components which corresponded to their given actions (or groups of actions, such as in bridge). While this may make sense from an action-centered point of view, it is confusing to an outsider to have to look many different places to find where stateless/stateful checks and execution occur. This PR consolidates all of the implementations as well as their testing.

Changes

  • Created new action_handler module and moved the corresponding ActionHandler trait as well as all of its impls into this module.
  • Renamed some moved tests for clarity.
  • Categorized tests by action in submodule tests.
  • Categorized impls by action in submodule impls.

Testing

Passing all tests.

Changelogs

Changelogs updated

Related Issues

closes #1657

@github-actions github-actions bot added the sequencer pertaining to the astria-sequencer crate label Oct 28, 2024
@ethanoroshiba ethanoroshiba changed the title chore(sequencer): consolidate all action handling to one component chore(sequencer): consolidate all action handling to one module Oct 28, 2024
@ethanoroshiba ethanoroshiba marked this pull request as ready for review October 29, 2024 13:23
@ethanoroshiba ethanoroshiba requested a review from a team as a code owner October 29, 2024 13:23
Copy link
Contributor

@Fraser999 Fraser999 left a comment

Choose a reason for hiding this comment

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

Could the unit tests for each action be moved from the common action_handler::tests module back into the modules specific to each individual unit under test please?

Generally I think it's good practice to keep unit tests as close to the unit under test as possible, but it will probably also help with this review since we'll see mostly files being moved with minimal changes, whereas just now we see a lot of files being added and deleted.

I'm also not sure that we need the impls submodule - I'd be inclined to just flatten this into action_handler, but I don't feel very strongly about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality sequencer pertaining to the astria-sequencer crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sequencer: move all ActionHandler impls to a central location
2 participants