Skip to content

Commit 90e5291

Browse files
jholdstockjrick
authored andcommitted
[release-v2.0] jsonrpc: Let client handle empty VSP policy fields
Changing nil to empty map is handled in VSP client v4.0.1 so this behaviour is no longer required in dcrwallet. Backport of ce5dae7.
1 parent 61e7fbc commit 90e5291

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ require (
2828
github.com/decred/dcrd/wire v1.7.0
2929
github.com/decred/go-socks v1.1.0
3030
github.com/decred/slog v1.2.0
31-
github.com/decred/vspd/client/v4 v4.0.0
31+
github.com/decred/vspd/client/v4 v4.0.1
3232
github.com/decred/vspd/types/v3 v3.0.0
3333
github.com/gorilla/websocket v1.5.1
3434
github.com/jessevdk/go-flags v1.5.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ github.com/decred/go-socks v1.1.0 h1:dnENcc0KIqQo3HSXdgboXAHgqsCIutkqq6ntQjYtm2U
7777
github.com/decred/go-socks v1.1.0/go.mod h1:sDhHqkZH0X4JjSa02oYOGhcGHYp12FsY1jQ/meV8md0=
7878
github.com/decred/slog v1.2.0 h1:soHAxV52B54Di3WtKLfPum9OFfWqwtf/ygf9njdfnPM=
7979
github.com/decred/slog v1.2.0/go.mod h1:kVXlGnt6DHy2fV5OjSeuvCJ0OmlmTF6LFpEPMu/fOY0=
80-
github.com/decred/vspd/client/v4 v4.0.0 h1:8qFB3t5CyBFuUU0LarJFsq/+twfUMPALwzOsB99r818=
81-
github.com/decred/vspd/client/v4 v4.0.0/go.mod h1:jhqu4KGGOskQcPVZ3XZLVZ1Wgkc9GQo+oEipr3gGODg=
80+
github.com/decred/vspd/client/v4 v4.0.1 h1:eoFWCoaqEMLBODRQrVABGcpFrFdOSPLiMWpPO+RVvi0=
81+
github.com/decred/vspd/client/v4 v4.0.1/go.mod h1:jhqu4KGGOskQcPVZ3XZLVZ1Wgkc9GQo+oEipr3gGODg=
8282
github.com/decred/vspd/types/v3 v3.0.0 h1:jHlQIpp6aCjIcFs8WE3AaVCJe1kgepNTq+nkBKAyQxk=
8383
github.com/decred/vspd/types/v3 v3.0.0/go.mod h1:hwifRZu6tpkbhSg2jZCUwuPaO/oETgbSCWCYJd4XepY=
8484
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=

internal/rpc/jsonrpc/methods.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4841,18 +4841,6 @@ func (s *Server) setVoteChoice(ctx context.Context, icmd any) (any, error) {
48414841
func (s *Server) updateVSPVoteChoices(ctx context.Context, w *wallet.Wallet, ticketHash *chainhash.Hash,
48424842
choices map[string]string, tspendPolicy map[string]string, treasuryPolicy map[string]string) error {
48434843

4844-
// Ensure empty (as opposed to nil) choices on every category (required
4845-
// by the contract of the VSP API).
4846-
if choices == nil {
4847-
choices = map[string]string{}
4848-
}
4849-
if tspendPolicy == nil {
4850-
tspendPolicy = map[string]string{}
4851-
}
4852-
if treasuryPolicy == nil {
4853-
treasuryPolicy = map[string]string{}
4854-
}
4855-
48564844
if ticketHash != nil {
48574845
vspHost, err := w.VSPHostForTicket(ctx, ticketHash)
48584846
if err != nil {

0 commit comments

Comments
 (0)