test(#60,#61): topic-0 keccak guards + EthFlow 429/malformed-body tests#312
Open
lgahdl wants to merge 1 commit into
Open
test(#60,#61): topic-0 keccak guards + EthFlow 429/malformed-body tests#312lgahdl wants to merge 1 commit into
lgahdl wants to merge 1 commit into
Conversation
Fixes #60: both twap-monitor and ethflow-watcher now assert at test time that the hardcoded topic-0 in module.toml equals keccak256 of the canonical event ABI string via alloy_sol_types::SolEvent::SIGNATURE_HASH. Fixes #61: adds two missing coverage paths in ethflow-watcher — - 429 rate-limit: verify Warn is emitted and no observed: marker is written (distinguishes from the 404 indexer-lag path) - malformed JSON body with HTTP 200: verify the strategy writes the observed: marker because it treats Ok(_) as confirmation without parsing the response body Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TfSsJPYDQ1GQGbnSVFxATx
jean-neiverth
approved these changes
Jul 10, 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.
What
Closes #60 — topic-0 keccak guards
Closes #61 — EthFlow 429 + malformed-body error-path tests
Why
#60: Both modules pin a hardcoded
event_signature(topic-0) inmodule.toml. A typo or upstream ABI change would silently suppress every log delivery with no runtime error. The new tests compare the constant againstalloy_sol_types::SolEvent::SIGNATURE_HASH, which is computed by the ABI encoder at compile time, so the assert catches any drift.#61: The existing test suite covered 200, 404, and a generic non-404 error (502). Missing paths:
Err(err)branch (Warn + no marker), not accidentally collapse into the 404 branch (Info + no marker — which suppresses the warning).Ok(_)as confirmation; it does not parse the body. The test documents this invariant so a future refactor that adds body parsing knows to keep the marker write unconditional.Changes
modules/twap-monitor/src/strategy.rstopic0_matches_conditional_order_created_canonical_signaturemodules/ethflow-watcher/src/strategy.rs