Running as sub-tests has the benefit of automatically logging the test name, no need to include it in failure messages manually. It even works if the test panics.
* Remove global cache variable.
Rather than maintaining cached data in a global variable, instantiate a cache struct and keep it in the `Server` struct.
* Store net params in RPC clients.
This means net params only need to be supplied once at startup, and also removes a global instance of net params in `background.go`.
- Rather than manually downloading and invoking golangci-lint, use the GitHub
action provided by the developers.
- Configure golangci with a config file rather than passing command line args.
This enables the same config to be used locally and on CI without introducing
duplication. It also allows much more flexibililty in configuration than using
CLI args alone.
GitHub is now capable of rendering mermaid.js diagrams, so we don't need to maintain a separate source and rendered .png file. The mermaid source can be embedded directly into the documentation itself.
This allows both tspend and treasury policies to be set by clients on a per-ticket basis. Preferences can be set when initially registering a ticket with `/payfee`, and can be later updated using `/setvotechoices`.
Any requests which alter treasury/tspend policy will be stored in the database using the existing accountability system.
**Note:** This does not include consistency checking, it will need to be added later when dcrwallet has an RPC to retrieve policies in batches.
vspd will now call dcrd RPC `getblockchaininfo` to determine if DCP-0010 is active, and take that information into consideration when calculating ticket registration fee.
This pulls a fix which enables vspd to determine remote client IP using header `X-Forwarded-For` or `X-Real-Ip`.
This depends on the reverse proxy setting those headers appropriately, which can be achieved in nginx 1.20 using the following:
```
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
```
This is an unfortunate workaround which is necessary because an instance of dcrwallet will only recognise a ticket as revoked if it has done the revoke itself. If another wallet broadcasts the revoke then the ticket will forever be reported as missed/expired. This causes problems for vspd when a wallet outside of the vspd deployment revokes a ticket (eg. a users ticketbuyer wallet).
I'm happy to include this slightly dirty workaround because this should no longer be an issue when the auto-revoke work in DCP-0009 lands.
This renames "Voting wallet status" to "VSP status" and it now includes the status of the local dcrd instance. This change impacts both the /admin page of the UI, and the response of the /admin/status API endpoint.
Errors generated during dcrd client creation were previously handled in middleware, and request handling was terminated immediately.
Now the error handling is delayed by adding the error details to the request context. This enables downstream handlers to decide what to do with the error.
If an alternate address exists for this ticket, check it first and fall
back to the commitment address if validation fails. Alternate address
failure is allowed so that other endpoints do not need to add a field to
all requests specifying whether this is the alternate address's
signature or the commitment address's signature.
To allow signing with addresses other than the commitment address, add
an alternate signature address. In order to continue to prove that the
address was chosen by the user, add an alternate signature history. Only
allow one record per ticket to be saved to cap needed db space.
This commit marks the point at which vspd will stop working against dcrd 1.6 and start to target master.
The dcrwallet RPC version has not changed, so vspd continues to work with dcrwallet 1.6 or master.