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(core, sequencer): Create price feed enum action and nest relevant actions inside #1900

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

Fraser999
Copy link
Contributor

Summary

This unflattens the two closely-related price feed actions into a new enum.

Background

We want to be consistent with other existing actions where we group related actions under a parent enum. This will help avoid the main action enum becoming too cluttered over time.

Changes

  • Provided PriceFeed action enum, in anticipation of another variant (MarketMap) being added soon to support actions affecting the market map.
  • Provided CurrencyPairsChange enum which subsumes the recently-added AddCurrencyPairs and RemoveCurrencyPairs action structs.
  • Changed how action groups are defined (but not the actual definitions themselves). This is in anticipation of the new PriceFeed action belonging to more than one group when the market map actions are included.
  • No business logic should have changed, likewise for test logic. This is a pure refactor.

Testing

No new tests required, existing tests refactored as required.

Changelogs

No updates required.

Related Issues

Closes #1896.

@Fraser999 Fraser999 requested review from a team and joroshiba as code owners January 8, 2025 22:29
@github-actions github-actions bot added proto pertaining to the Astria Protobuf spec sequencer pertaining to the astria-sequencer crate labels Jan 8, 2025
Comment on lines 258 to 264
message CurrencyPairsToAdd {
repeated connect.types.v2.CurrencyPair pairs = 1;
}

message RemoveCurrencyPairs {
message CurrencyPairsToRemove {
repeated connect.types.v2.CurrencyPair pairs = 1;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit but since these two are the same type, can we use just one type CurrencyPairs and determine addition or removal based on enum variant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Done in 1180e60.

@Fraser999 Fraser999 merged commit c223c28 into feat/oracle Jan 16, 2025
45 checks passed
@Fraser999 Fraser999 deleted the fraser/1896-refactor-oracle-actions branch January 16, 2025 17:09
@Fraser999 Fraser999 restored the fraser/1896-refactor-oracle-actions branch January 16, 2025 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proto pertaining to the Astria Protobuf spec sequencer pertaining to the astria-sequencer crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants