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: simplify indexer package #14

Merged
merged 2 commits into from
Jan 24, 2024

Conversation

0xpanoramix
Copy link
Contributor

Description

This PR simplifies the indexer package by moving sub-services into more appropriate packages:

  • client -> HTTP clients to perform external requests
  • common -> common data types used in various sub-services
  • data -> relay data sub-services
  • events -> ethereum events sub-services
  • storage -> database sub-services

Changes include

  • Bugfix (non-breaking change that solves an issue).
  • Hotfix (change that solves an urgent issue, and requires immediate attention).
  • New feature (non-breaking change that adds functionality).
  • Breaking change (change that is not backwards-compatible and/or changes current functionality).
  • Documentation update (change added to any kind of documentation).

Checklist

  • I have assigned this PR to myself.
  • I have added at least 1 reviewer.
  • I have added the relevant labels.
  • I have updated the official documentation.
  • I have added sufficient documentation in code.

Testing

  • I have tested this code with the official test suite.
  • I have tested this code manually.

Signed-off-by: Luca Georges Francois <luca@quartz.technology>
Signed-off-by: Luca Georges Francois <luca@quartz.technology>
@0xpanoramix 0xpanoramix added the refactor A code change that neither fixes a bug nor adds a feature label Jan 24, 2024
@0xpanoramix 0xpanoramix requested a review from TomChv January 24, 2024 18:12
@0xpanoramix 0xpanoramix self-assigned this Jan 24, 2024
Copy link
Member

@TomChv TomChv left a comment

Choose a reason for hiding this comment

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

LGTM, nice refactor, I prefer that way!

Comment on lines +10 to +16
// RelayAPI is used to collect data from a relay.
type RelayAPI interface {
// GetRelayDataForSlot retrieves the bids received and delivered to a relay for a specific slot.
GetRelayDataForSlot(ctx context.Context, slot phase0.Slot) (*common.RelayData, error)
// GetRelayAPIURL returns the API URL of the relay this client makes request to.
GetRelayAPIURL() string
}
Copy link
Member

Choose a reason for hiding this comment

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

I like that

@0xpanoramix 0xpanoramix merged commit 663aea3 into main Jan 24, 2024
2 checks passed
@0xpanoramix 0xpanoramix deleted the refactor/simplify-indexer-packages branch January 24, 2024 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor A code change that neither fixes a bug nor adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants