Skip to content

chore(internals): drop no-std supp in internals#519

Open
ZocoLini wants to merge 1 commit intov0.42-devfrom
chore/drop-nostd-internals
Open

chore(internals): drop no-std supp in internals#519
ZocoLini wants to merge 1 commit intov0.42-devfrom
chore/drop-nostd-internals

Conversation

@ZocoLini
Copy link
Collaborator

@ZocoLini ZocoLini commented Mar 12, 2026

Summary by CodeRabbit

  • Refactor
    • Simplified feature configuration across crates by removing conditional feature gates for standard library and allocation support.
    • Hex display methods (to_lower_hex_string, to_upper_hex_string, to_hex_string, append_hex_to_string) are now always available instead of being conditionally compiled.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 12, 2026

📝 Walkthrough

Walkthrough

The PR removes no_std support and simplifies feature flags across the internals crate and its dependents. Feature-gated std and alloc are eliminated from internals/Cargo.toml, feature references are removed from dash and hashes Cargo.toml files, and conditional compilation gates are removed from internals source code to make alloc/std functionality unconditional.

Changes

Cohort / File(s) Summary
Cargo Feature Configuration
dash/Cargo.toml, hashes/Cargo.toml, internals/Cargo.toml
Removed internals/std and internals/alloc feature dependencies; eliminated std and alloc feature definitions from internals/Cargo.toml, converting from feature-gated to always-enabled setup.
Conditional Compilation Removal
internals/src/hex/display.rs, internals/src/lib.rs
Removed \#\[cfg(feature = "alloc")\] gates from DisplayHex methods and tests; removed no_std attribute and internal prelude module; simplified type paths from alloc::vec::Vec<u8> to Vec<u8>; flattened test module structure.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 We've tidied up the feature gates,
No more no_std allocates!
The internals now stand clear,
With std support sincere,
Simpler code, as futures awaits! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing no_std support from the internals crate, which is the primary objective across all modified files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/drop-nostd-internals

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internals/src/hex/display.rs`:
- Around line 272-324: Add a unit test that exercises the newly added impl
DisplayHex for &Vec<u8> directly (current tests only call the &[u8] path via
check_encoding), e.g., add a test function (similar to existing tests like
single/two) that constructs a Vec<u8> and calls check_encoding on a reference to
it so the &Vec<u8> impl is used; reference the check_encoding helper and the
DisplayHex impl for &Vec<u8> when locating where to add the test in this file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b1841341-591e-49c0-b65d-57d7bc2ef026

📥 Commits

Reviewing files that changed from the base of the PR and between 9959201 and 4410fb6.

📒 Files selected for processing (5)
  • dash/Cargo.toml
  • hashes/Cargo.toml
  • internals/Cargo.toml
  • internals/src/hex/display.rs
  • internals/src/lib.rs
💤 Files with no reviewable changes (2)
  • internals/Cargo.toml
  • internals/src/lib.rs

@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.14%. Comparing base (9959201) to head (4410fb6).

Additional details and impacted files
@@              Coverage Diff              @@
##           v0.42-dev     #519      +/-   ##
=============================================
+ Coverage      66.82%   67.14%   +0.32%     
=============================================
  Files            313      313              
  Lines          64756    64757       +1     
=============================================
+ Hits           43272    43484     +212     
+ Misses         21484    21273     -211     
Flag Coverage Δ *Carryforward flag
core 74.93% <100.00%> (ø)
dash-network 74.89% <ø> (-0.04%) ⬇️ Carriedforward from 9959201
dash-network-ffi 34.74% <ø> (ø) Carriedforward from 9959201
dash-spv 68.28% <ø> (ø) Carriedforward from 9959201
dash-spv-ffi 34.74% <ø> (ø) Carriedforward from 9959201
dashcore 74.89% <ø> (-0.04%) ⬇️ Carriedforward from 9959201
dashcore-private 74.89% <ø> (-0.04%) ⬇️ Carriedforward from 9959201
dashcore-rpc 19.92% <ø> (ø) Carriedforward from 9959201
dashcore-rpc-json 19.92% <ø> (ø) Carriedforward from 9959201
dashcore_hashes 74.89% <ø> (-0.04%) ⬇️ Carriedforward from 9959201
ffi 40.32% <ø> (+5.07%) ⬆️
key-wallet 65.69% <ø> (ø) Carriedforward from 9959201
key-wallet-ffi 34.74% <ø> (ø) Carriedforward from 9959201
key-wallet-manager 65.69% <ø> (ø) Carriedforward from 9959201
rpc 19.92% <ø> (ø)
spv 81.12% <ø> (-0.03%) ⬇️
wallet 65.69% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
internals/src/hex/display.rs 87.50% <100.00%> (+0.10%) ⬆️

... and 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant