Skip to content

fix(kaspa): add serde aliases for flat-cased config keys#445

Merged
danwt merged 1 commit intomain-dymfrom
danwt/claude/fix-kaspa-validator-config-parsing
Jan 22, 2026
Merged

fix(kaspa): add serde aliases for flat-cased config keys#445
danwt merged 1 commit intomain-dymfrom
danwt/claude/fix-kaspa-validator-config-parsing

Conversation

@danwt
Copy link
Copy Markdown

@danwt danwt commented Jan 22, 2026

Summary

  • Adds serde aliases for escrowpub and ismaddress to handle flat-cased config keys
  • Fixes validator config parsing failure when loading configs via the config library's CaseAdapter

Problem

The config library's CaseAdapter converts all JSON keys to flat case (e.g., escrowPubescrowpub), but the KaspaValidatorEscrow and KaspaValidatorIsm structs expect camelCase keys via #[serde(rename_all = "camelCase")]. This caused the error:

error: failed to parse kaspaValidatorsEscrow array
Caused by: missing field `escrowPub`

Test plan

  • Built validator with fix
  • Tested with Victor's validator config that previously failed
  • Confirmed all 15 escrow public keys are parsed correctly

🤖 Generated with Claude Code

The config library's CaseAdapter converts all JSON keys to flat case
(e.g., escrowPub -> escrowpub), but the KaspaValidatorEscrow and
KaspaValidatorIsm structs expect camelCase keys via serde rename_all.

Adding serde aliases allows the structs to deserialize correctly when
keys are flat-cased by the config library.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@danwt danwt merged commit 26ff291 into main-dym Jan 22, 2026
7 of 11 checks passed
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.

1 participant