|
1 | | -// Copyright (c) 2022-2024 The Decred developers |
| 1 | +// Copyright (c) 2022-2025 The Decred developers |
2 | 2 | // Use of this source code is governed by an ISC |
3 | 3 | // license that can be found in the LICENSE file. |
4 | 4 |
|
@@ -66,8 +66,11 @@ func (c *Client) FeeAddress(ctx context.Context, req types.FeeAddressRequest, |
66 | 66 | func (c *Client) PayFee(ctx context.Context, req types.PayFeeRequest, |
67 | 67 | commitmentAddr stdaddr.Address) (*types.PayFeeResponse, error) { |
68 | 68 |
|
69 | | - // TSpendPolicy and TreasuryPolicy are optional but must be an empty map |
70 | | - // rather than nil. |
| 69 | + // VoteChoices, TSpendPolicy and TreasuryPolicy are optional but must be an |
| 70 | + // empty map rather than nil. |
| 71 | + if req.VoteChoices == nil { |
| 72 | + req.VoteChoices = map[string]string{} |
| 73 | + } |
71 | 74 | if req.TSpendPolicy == nil { |
72 | 75 | req.TSpendPolicy = map[string]string{} |
73 | 76 | } |
@@ -119,8 +122,11 @@ func (c *Client) TicketStatus(ctx context.Context, req types.TicketStatusRequest |
119 | 122 | func (c *Client) SetVoteChoices(ctx context.Context, req types.SetVoteChoicesRequest, |
120 | 123 | commitmentAddr stdaddr.Address) (*types.SetVoteChoicesResponse, error) { |
121 | 124 |
|
122 | | - // TSpendPolicy and TreasuryPolicy are optional but must be an empty map |
123 | | - // rather than nil. |
| 125 | + // VoteChoices, TSpendPolicy and TreasuryPolicy are optional but must be an |
| 126 | + // empty map rather than nil. |
| 127 | + if req.VoteChoices == nil { |
| 128 | + req.VoteChoices = map[string]string{} |
| 129 | + } |
124 | 130 | if req.TSpendPolicy == nil { |
125 | 131 | req.TSpendPolicy = map[string]string{} |
126 | 132 | } |
|
0 commit comments