refactor(cold-sql): eliminate intermediate row structs#27
Merged
Conversation
Remove HeaderRow, TxRow, ReceiptRow, LogRow, SignetEventRow, and ZenithHeaderRow structs from convert.rs, replacing them with direct row-to-domain-type conversion functions in backend.rs. This reduces indirection and simplifies the read path by building domain types directly from sqlx AnyRow values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
|
supersedes #25 |
…dead code - Add columns.rs with pub(crate) constants for all SQL column names used in r.get() calls, preventing typo-induced runtime panics - Require chain_id for EIP-2930/1559/4844/7702 (was silently defaulting to 0), blob_versioned_hashes for EIP-4844, and authorization_list for EIP-7702 - Make decode_b256_vec return Result and error on truncated data instead of silently dropping entries - Inline header_from_row_with/tx_from_row_with into their only callers, removing unused column-name parameterization - Extract blob/opt_blob closures into module-level free functions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
HeaderRow,TxRow,ReceiptRow,LogRow,SignetEventRow, andZenithHeaderRowstructs fromconvert.rs, replacing with direct row-to-domain-type conversion functions inbackend.rscolumns.rsmodule withpub(crate)constants for all ~35 SQL column names used inr.get()calls, preventing typo-induced runtime panicschain_idfor EIP-2930/1559/4844/7702 (was silently defaulting to 0),blob_versioned_hashesfor EIP-4844, andauthorization_listfor EIP-7702decode_b256_vecreturnResultand error on truncated data (was silently dropping entries)header_from_row_with/tx_from_row_withinto their only callers, removing unused column-name parameterizationblob/opt_blobclosures into module-level free functionsTest plan
cargo clippy --all-featurescleancargo clippy --no-default-featuresclean./scripts/test-postgres.sh)🤖 Generated with Claude Code