Skip to content

clean up macro impl_bytesn_repr and remove export#1829

Merged
mootz12 merged 3 commits intostellar:mainfrom
jayz22:v26-main
Apr 8, 2026
Merged

clean up macro impl_bytesn_repr and remove export#1829
mootz12 merged 3 commits intostellar:mainfrom
jayz22:v26-main

Conversation

@jayz22
Copy link
Copy Markdown
Contributor

@jayz22 jayz22 commented Apr 8, 2026

What

clean up impl_bytesn_repr and remove its macro_export, it was intended as an internal helper macro.

Copilot AI review requested due to automatic review settings April 8, 2026 00:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes the impl_bytesn_repr helper macro internal-only (removing its #[macro_export]), and updates internal crypto types to use the cleaned-up internal macro via crate-level macro import.

Changes:

  • Remove the exported impl_bytesn_repr/impl_bytesn_repr_without_from_bytes split and keep a single internal impl_bytesn_repr macro (no from_bytes).
  • Import macros from bytes into the crate root with #[macro_use] so internal modules can use impl_bytesn_repr! without exporting it.
  • Update BN254 and BLS12-381 wrapper types to use impl_bytesn_repr! and drop the old macro import.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
soroban-sdk/src/lib.rs Imports bytes macros into the crate root to enable internal macro use without exporting.
soroban-sdk/src/crypto/bn254.rs Switches to impl_bytesn_repr! and removes the old macro import.
soroban-sdk/src/crypto/bls12_381.rs Switches to impl_bytesn_repr! and removes the old macro import.
soroban-sdk/src/bytes.rs Consolidates the helper macro and removes #[macro_export] to keep it internal.

Copy link
Copy Markdown
Contributor

@mootz12 mootz12 left a comment

Choose a reason for hiding this comment

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

[picky] can we fix the unused deps warnings in the tests?

warning: unused import: `crate::bytesn`
   --> soroban-sdk/src/crypto/bls12_381.rs:810:9
    |
810 |     use crate::bytesn;
    |         ^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

@jayz22
Copy link
Copy Markdown
Contributor Author

jayz22 commented Apr 8, 2026

[picky] can we fix the unused deps warnings in the tests?

fixed. sorry about that

@mootz12 mootz12 added this pull request to the merge queue Apr 8, 2026
Merged via the queue into stellar:main with commit c7e915a Apr 8, 2026
108 checks passed
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.

3 participants