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

multi: Send empty VSP policy fields #2438

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Conversation

matheusd
Copy link
Member

This changes the call sites of VSP library functions to fill in missing policy choices with empty maps instead of nil maps.

This fixes an issue where certain VSPs will fail to accept the policy calls because those fields are required by the API but not sent.

Fix #2402

@jholdstock
Copy link
Member

Maybe set these fields in updateVSPVoteChoices so it only has to exist in one place?

func (s *Server) updateVSPVoteChoices(ctx context.Context, w *wallet.Wallet, ticketHash *chainhash.Hash,
	choices map[string]string, tspendPolicy map[string]string, treasuryPolicy map[string]string) error {

	if choices == nil {
		choices = map[string]string{}
	}
	if tspendPolicy == nil {
		tspendPolicy = map[string]string{}
	}
	if treasuryPolicy == nil {
		treasuryPolicy = map[string]string{}
	}

This changes the VSP library functions to fill in missing policy choices
with empty maps instead of nil maps.

This fixes an issue where certain VSPs will fail to accept the policy
calls because those fields are required by the API but not sent.
@matheusd
Copy link
Member Author

Updated.

@jrick jrick merged commit 4ec0b8b into decred:master Oct 15, 2024
2 checks passed
@jholdstock
Copy link
Member

I figured this should live in the client rather than consumers having to deal with it decred/vspd#491

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.

Error when calling settreasurypolicy for VSP tickets
3 participants