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

Rearrange Relayer Chain interactions interfaces #903

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ilija42
Copy link
Contributor

@ilija42 ilija42 commented Oct 30, 2024

Requires

Supports

pkg/types/relayer.go Outdated Show resolved Hide resolved
pkg/types/relayer.go Outdated Show resolved Hide resolved
@ilija42 ilija42 marked this pull request as draft October 30, 2024 13:01
@ilija42 ilija42 changed the title Extract chain reads from ChainService relayer into Chain Reader Rearrange Relayer Chain interactions interfaces Nov 12, 2024

// NewContractReader returns a new ContractReader.
// The format of contractReaderConfig depends on the implementation.
NewContractReader(ctx context.Context, contractReaderConfig []byte) (types.ContractReader, error)
NewConfigProvider(context.Context, types.RelayArgs) (types.ConfigProvider, error)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should this contain the chainService? Have to check how Relayer interface is used

Comment on lines +14 to 17
type ContractWriter = ChainWriter

// Deprecated: Use ContractWriter instead.
type ChainWriter interface {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Swapping these makes the "correct" type more direct and sets up removal to be a little cleaner later 🤷

Suggested change
type ContractWriter = ChainWriter
// Deprecated: Use ContractWriter instead.
type ChainWriter interface {
// Deprecated: Use ContractWriter instead.
type ChainWriter = ContractWriter
type ContractWriter interface {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, didn't realise that was legal

// LatestHead returns the latest head for the underlying chain.
LatestHead(ctx context.Context) (Head, error)
// GetChainStatus returns the ChainStatus for this Relayer.
GetChainStatus(ctx context.Context) (ChainStatus, error)
// ListNodeStatuses returns the status of RPC nodes.
ListNodeStatuses(ctx context.Context, pageSize int32, pageToken string) (stats []NodeStatus, nextPageToken string, total int, err error)
}

type IChainWriter interface {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a bummer... 🤔 We could rename it later of course - are you planning to do that? Or leave the deprecated type around for a while?

Copy link
Contributor Author

@ilija42 ilija42 Nov 12, 2024

Choose a reason for hiding this comment

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

Everyone that has context on this is slammed with work, I've been chipping away at the backlog when I have time. Maybe I'll do it, or I'll try to somehow reprioritise the backlog.

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