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

Move VSP closed check to middleware. #369

Merged
merged 3 commits into from Feb 17, 2023
Merged

Conversation

jholdstock
Copy link
Member

Checking this in middleware not only removes duplicated code from each of the handlers, but also makes things more efficient. Previously, dcrd/dcrwallet/database clients were initialized (and could possibly cause errors) before checking if the VSP is closed. Now the check happens before those other things.

This PR is also bundled with some improvements to setaltsignaddr_test.go which I implemented along the way.

Don't just check HTTP status, also ensure errors can be properly unmarshaled and code/message are as expected.
Checking this in middleware not only removes duplicated code from each of the handlers, but also makes things more efficient. Previously, dcrd/dcrwallet/database clients were initialized (and could possibly cause errors) **before** checking if the VSP is closed. Now the check happens before those other things.
@jholdstock jholdstock merged commit 7718476 into decred:master Feb 17, 2023
@jholdstock jholdstock deleted the middleware branch September 20, 2023 08:23
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.

None yet

2 participants