-
Notifications
You must be signed in to change notification settings - Fork 311
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
Expose identity earnings to SSE state #1916
Conversation
b9bb8b7
to
028757d
Compare
} | ||
|
||
// GetBalance returns a pre-defined balance. | ||
func (mbp *mockBalanceProvider) GetBalance(_ identity.Identity) uint64 { |
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.
This is identical to mocks.BalanceProvider
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 moved mocks next to tests, because keeping them global packages causes circular dependencies: pingpong -> mocks -> connections -> pingpong
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.
There is no dependency on connections
in the mocks package. Either way, mocks should have minimal dependencies.
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 added similar mock EarningsProvider.SettlementState(_ identity.Identity) pingpong.SettlementState
and mocks
package starts to be interdependent.
Lets agree on having mocks next to package we're testing.
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.
Such widely used types as identity.Identity
or in this case pingpong.SettlementState
could be in a leaf package with minimal dependencies - that will solve the package cycle. If it's a one-off mock - then it's good to have it next to the test. If it's used multiple times, then the maintenance becomes a burden and it should be in mocks
.
b3f26f1
to
ffeb620
Compare
ffeb620
to
59f21cc
Compare
Updates: #1731
Web UI now can interactively show increasing earnings