clean up macro impl_bytesn_repr and remove export#1829
Merged
mootz12 merged 3 commits intostellar:mainfrom Apr 8, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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_bytessplit and keep a single internalimpl_bytesn_reprmacro (nofrom_bytes). - Import macros from
bytesinto the crate root with#[macro_use]so internal modules can useimpl_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. |
mootz12
approved these changes
Apr 8, 2026
Contributor
mootz12
left a comment
There was a problem hiding this comment.
[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
Contributor
Author
fixed. sorry about that |
mootz12
approved these changes
Apr 8, 2026
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.
What
clean up impl_bytesn_repr and remove its macro_export, it was intended as an internal helper macro.