-
Notifications
You must be signed in to change notification settings - Fork 188
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core/tx.go
Outdated
@@ -29,7 +29,7 @@ type OperatorSetParam struct { | |||
|
|||
type OperatorStakes map[QuorumID]map[OperatorIndex]OperatorStake | |||
|
|||
type Transactor interface { | |||
type TransactorOld interface { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Why are these changes needed?
Breaks transactor into reader/writer
Checks