-
Notifications
You must be signed in to change notification settings - Fork 27
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
pool: decouple components. #143
Conversation
This updates the client hash calculation threshold to 30 seconds. Tests have also been added for the various client processes.
6ac8118
to
c8c9c31
Compare
This reactors functionality from various structs namely shares, db, hub and payments. This also fixes lint related issues.
c13a97e
to
8fd7900
Compare
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've reviewed this and dropped some comments, but I cannot make any promises about the completeness of the review. This is a massive changeset and was very painful to review.
Please consider breaking future changes into multiple, smaller PRs for ease of reviewing and to reduce likelihood of defects sneaking through.
Also, please do not rebase/squash/force-push this PR, because it will make reviewing further changes even more painful.
Hmm, I mostly split the commits based on the introduced component or its associated tests. I'm curious to know what made reviewing each commit difficult. |
This simplifies payment requests by only requiring the address of an account instead of an account id.
pool/paymentmgr.go
Outdated
// addPaymentRequest creates a payment request from the provided account | ||
// if not already requested. | ||
func (pm *PaymentMgr) addPaymentRequest(addr string) error { | ||
_, err := dcrutil.DecodeAddress(addr, pm.cfg.ActiveNet) |
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 are three places where Account()
is preceeded by a call to DecodeAddress()
.
Perhaps DecodeAddress
can be moved inside of Account()
? It would remove duplication and ensure the a new caller of Account
doesnt forget to call DecodeAddress
first
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.
Good catch, rectifying.
This updates AccountID to check the provided address is valid for the active network before generating an id.
This decouples components initially bundled with the pool hub in order to better test them and ultimately improve test coverage for the pool.