docs: document SAC decoder test coverage and conventions - #350
docs: document SAC decoder test coverage and conventions#350joan-bisbal wants to merge 3 commits into
Conversation
| @@ -0,0 +1,3 @@ | |||
| # SAC Decoder Unit Tests | |||
|
|
|||
| Test coverage for SAC event decoding and asset symbol parsing. | |||
There was a problem hiding this comment.
This is test: add unit tests for SAC decoder module, but the diff contains no tests — just a three-line file describing them. A test PR needs actual #[test] functions.
The SAC decoder already has unit tests as well: crates/indexer/src/parser/sac.rs has a mod tests with 11 cases covering registry lookup and asset-context attachment, and crates/indexer/src/parser/token_events.rs covers the SEP-41 event decoding alongside it.
If you want to strengthen coverage there, the useful contribution would be additional cases against the existing module — malformed XDR, unusual asset codes, contracts that are not in the registry — as real Rust tests that run in CI. Please target dev rather than main, and drop the UTF-8 BOM on any new file.
|
Hey @joan-bisbal — same story as #347, and this one needs the most reframing of the three. The title is Worth knowing too — that module is already covered. Could you retitle to
If you'd rather this PR actually added tests, that'd be even better — the one real gap I can see is boundary coverage for truncated XDR streams, which your doc mentions but the existing suite doesn't fully exercise. Either direction works; just let the title match whichever you pick. |
|
Thanks for the review. All changes done:
Ready for re-review. |
Documents the testing conventions for SAC event decoding: what the existing suite covers (registry resolution, XDR payload decoding, asset context attachment) and what a new test for an additional token standard should assert.
Intended as a guide for contributors extending the decoder, not as new coverage -- sac.rs and token_events.rs already carry 42 tests between them.
No code changes -- documentation only.