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 Transactor into Reader/Writer #832

Merged
merged 4 commits into from
Oct 24, 2024

Conversation

mooselumph
Copy link
Collaborator

Why are these changes needed?

Breaks transactor into reader/writer

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

Copy link
Contributor

@hopeyen hopeyen left a comment

Choose a reason for hiding this comment

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

:shipit:

core/tx.go Outdated
@@ -29,7 +29,7 @@ type OperatorSetParam struct {

type OperatorStakes map[QuorumID]map[OperatorIndex]OperatorStake

type Transactor interface {
type TransactorOld interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

not deleting this yet? I don't think it is used anywhere

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@@ -12,29 +12,29 @@ import (
"github.com/stretchr/testify/mock"
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be split into MockWriter and MockReader?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since the Writer implements Reader, for mocking purposes it seems fine to combine? What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

How about having MockReader embedded into MockWriter just like how Writer embeds Reader?

core/tx.go Outdated
@@ -29,7 +29,7 @@ type OperatorSetParam struct {

type OperatorStakes map[QuorumID]map[OperatorIndex]OperatorStake

type Transactor interface {
type TransactorOld interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

}

func NewChainState(tx core.Transactor, client common.EthClient) *ChainState {
func NewChainState(tx core.Reader, client common.EthClient) *ChainState {
Copy link
Contributor

Choose a reason for hiding this comment

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

will this be part of Reader down the road?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think so. Will be a follow up.

@mooselumph mooselumph merged commit 977308e into Layr-Labs:master Oct 24, 2024
6 checks passed
ian-shim pushed a commit to ian-shim/eigenda that referenced this pull request Oct 25, 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.

3 participants