Skip to content

test(client): bar-raising coverage for GovParamChangeTask (PLT-487)#204

Merged
bdchatham merged 1 commit into
mainfrom
plt-487-client-tests
Jun 13, 2026
Merged

test(client): bar-raising coverage for GovParamChangeTask (PLT-487)#204
bdchatham merged 1 commit into
mainfrom
plt-487-client-tests

Conversation

@bdchatham

Copy link
Copy Markdown
Contributor

Follow-up to #203. The gov-param-change handler was tested, but the client GovParamChangeTask builder had no coverage (flagged in cross-review). Adds:

  • Validate() table — valid + every failure branch.
  • ToTaskRequest() — type + required param keys + memo-omitted-when-empty.
  • ValueSingleEncodedOnWire — the client-side half of the single-encode contract: the per-change value survives ToTaskRequest + the HTTP json.Marshal byte-identical for object/string/number/bool, complementing the handler-side regression guard. This is the full client→wire path the prior unit test bypassed.

Test-only; no behavior change.

🤖 Generated with Claude Code

The gov-param-change handler was tested (#203) but the client task builder had
no coverage. Adds:
- Validate() table — valid + every failure branch (missing chainId/keyName/
  title/description, empty changes/subspace/key/value, missing deposit/fees,
  zero gas)
- ToTaskRequest() — Type + required param keys + memo-omitted-when-empty
- ValueSingleEncodedOnWire — the client-side half of the single-encode contract:
  the per-change value survives ToTaskRequest + the HTTP json.Marshal
  byte-identical for object/string/number/bool shapes (prop-252 regression guard
  at the client boundary, complementing the handler-side guard).
@cursor

cursor Bot commented Jun 13, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
New unit tests only; no production code or runtime behavior changes.

Overview
Adds sidecar/client/gov_param_change_test.go to cover the client GovParamChangeTask builder, which previously had no tests while the handler was already covered.

Validate() — asserts a valid fixture passes and table-driven cases fail for each required field (chain, key, title, description, changes, deposits, fees, gas).

ToTaskRequest() — checks task type, required param keys, and that empty memo is omitted like sibling tasks.

ValueSingleEncodedOnWire — marshals params as the HTTP client would and asserts each change value stays byte-identical for object/string/number/bool JSON, guarding the client-side single-encode contract (complement to handler tests for the prop-252 double-encode issue).

Test-only; no runtime behavior change.

Reviewed by Cursor Bugbot for commit f5d85b6. Bugbot is set up for automated code reviews on this repo. Configure here.

@bdchatham bdchatham merged commit 862945d into main Jun 13, 2026
3 checks passed
@bdchatham bdchatham deleted the plt-487-client-tests branch June 13, 2026 16:06
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