You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: move the Seismic tx test helpers into their own crate (#483)
Fixes SEI-343
reth-seismic-primitives exported 458 lines of test helpers as `pub mod
test_utils` — transaction builders, client-side encryption, signing
fixtures with hardcoded private keys — from the default public API of a
crate every consumer depends on, the production node included. They now
live in crates/seismic/test-utils
(`reth-seismic-test-utils`), reached only through a `[dev-dependencies]`
line. `[dev-dependencies]` are in scope for the listing crate's test,
bench, and example targets, so `use reth_seismic_test_utils::…` from a
crate's `src/` does not resolve.
Nothing marks a crate dev-only workspace-wide — someone can always move
the line into `[dependencies]` — but that is one visible line in the
manifest of the crate doing it, caught in review. What a dev-dependency
rules out is the leak a feature cannot avoid: features unify across a
build and dev-dependency features fold in whenever test targets are
built, so under a `test-utils` feature on the primitives crate, one
crate's dev-dependency would turn the module on for every crate in the
same `cargo test --workspace`. Production code in reth-seismic-node
could import the helpers, compile clean in CI's test job, and break only
in a later `cargo build` of the binary — an error in a crate nobody
touched.
The file moves verbatim. reth-seismic-primitives drops the module and
the ten dependencies only those helpers used: seismic-crypto,
seismic-alloy-network, seismic-alloy-rpc-types, alloy-signer-local,
alloy-rpc-types, alloy-dyn-abi, alloy-network, enr, k256, and anyhow.
Its manifest now lists what the primitives actually need. secp256k1 is
the one that stays: the rest of the crate reaches it only from the
`arbitrary` impl, so it becomes optional under the `arbitrary` feature
and a dev-dependency for the crate's own tests, the shape rand_08
already has there.
Call sites take the new import path with a dev-dependency:
primitives/src/transaction/signed.rs, rpc/src/eth/receipt.rs,
rpc/src/eth/utils.rs, txpool/src/transaction.rs, and
txpool/benches/eviction_scan.rs. reth-seismic-node's `utils::test_utils`
re-export goes away — its only consumers are that crate's own e2e tests,
which depend on the new crate directly — and the module keeps
`get_nonce` behind the node's `test-utils` feature.
primitives dev-depends on a crate that depends on primitives. Cargo
allows dev-dependency cycles: dev edges do not participate in the lib
build graph, and this repo already leans on the self-cycle
reth-seismic-node dev-depending on itself with `features =
["test-utils"]`.
0 commit comments