GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — rpc: fix SendRawTransaction_Result.Reason json tag, add tag-hygiene tests by DHEBP · Pull Request #75 · DEROFDN/derohe ConversationSendRawTransaction_Result.Reason is tagged Impact today is nil rather than data loss. Reason is never assigned anywhere in I corrected the tag rather than removing the field. Whether to populate it or The second half is a guard so this class does not recur. rpc/jsontag_test.go
It runs under Verification: the first check fails on the unfixed tree, naming the exact Every type in this package is part of derod's or the wallet's public wire
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…ests
SendRawTransaction_Result.Reason was tagged `json:"string"` instead of
`json:"reason"`, so every DERO.SendRawTransaction response carries an
undocumented "string" key and a client reading "reason" finds nothing.
Impact today is nil rather than data loss: Reason is never assigned anywhere in
the tree, so the field is always "". The two soft-failure paths in
rpc_dero_sendrawtransaction.go report via result.Status, and real rejections
return a Go error that becomes a JSON-RPC error object, so the failure text a
client sees is unaffected either way. The tag is corrected rather than the field
removed; whether to populate it or delete it is an API decision for maintainers,
and populating it would mean changing the rejection branch to return a result
instead of an error, which IS a breaking change and should not ride along here.
rpc/jsontag_test.go adds three checks over the whole package, parsing the source
so no one has to remember to register a type:
- no json tag named after a Go builtin type (this is what the above defect
looks like mechanically: the field's TYPE written where its NAME belongs)
- no duplicate json tag within a struct, where one field silently never
reaches the wire and the winner depends on field order
- json tags are lowercase, matching the rest of the wire format
These run with `go test ./rpc/` -- no new dependency, no CI job required. The
first check fails on the unfixed tree and passes after, while the other two pass
in both states, so the suite is not merely failing everything.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |