fix(node): preserve camelCase keys for webhook template args#37
Merged
Merged
Conversation
The Node binding's node_ta_to_core was snake-casing the inner `args`
object before deserializing into core::webhooks::TemplateArgs. Core's
EvmContractEventsTemplate carries #[serde(rename_all = "camelCase")]
and expects `eventHashes` on input, so the snake-cased `event_hashes`
was treated as an unknown key and silently dropped. With the field
gone, the outbound serializer omitted it (skip_serializing_if =
"Option::is_none"), and the API rejected the request with HTTP 500
("Expected array for arg eventHashes") whether or not the caller
supplied the field.
Webhook template inner structs are modeled around the API wire format
and don't need per-field case conversion (unlike streams destinations,
whose core structs use plain Rust snake_case). All other template
structs only have single-word fields where the two cases are
identical, so removing the conversion is safe across templates.
Adds a regression test in the Node crate that exercises
node_ta_to_core directly with eventHashes input and asserts the
outbound JSON contains "eventHashes" with the expected value, plus
end-to-end coverage of TemplateArgs::EvmContractEvents in the
webhooks examples for all four languages.
Also adds a CLAUDE.md note discouraging blanket clippy::panic /
clippy::unreachable allowances in tests; prefer matches! /
let-else-unreachable.
AlejandroFabianCampos
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
node_ta_to_corewas snake-casing the innerargsobject before deserializing intocore::webhooks::TemplateArgs. Core'sEvmContractEventsTemplatecarries#[serde(rename_all = "camelCase")]and expectseventHashes, so the snake-casedevent_hasheswas silently dropped during deserialization. The outbound serializer then omitted the now-Nonefield (skip_serializing_if), and the API rejected the request withHTTP 500: "Expected array for arg eventHashes"— independent of whether the caller actually supplied the field.crates/node/src/webhooks_template.rscovering theevmContractEvents+eventHashespath (deserialize and re-serialize), plus end-to-end coverage ofEvmContractEventsin thewebhooks_e2eexamples for all four languages.CLAUDE.mdnot to silenceclippy::panic/clippy::unreachablein tests by default — preferassert!(matches!(...))orlet ... else { unreachable!() }.Test plan
cargo test -p sdk-node --lib— new regression test passescargo test -p quicknode-sdk --lib— 203 core tests still passjust lint— clippy + tests,-D warningscargo fmt --checkjust node-build— Node binding compiles and smoke test runsevm-contract-events(requiresQN_API_KEY; manual)