Skip to content

Conversation

@rustaceanrob
Copy link
Contributor

Discussion #5331 suggested removing bitcoin as a direct dependency could be a reasonable goal for the p2p crate. One conflict along the way is the use of this macro in bip152 to implement the array-like traits for the short IDs. Because bitcoin depends on internals, as does p2p, we can move this macro into internals to help detangle p2p and bitcoin.

Does it make sense to also remove the deprecated method?

@github-actions github-actions bot added C-bitcoin PRs modifying the bitcoin crate C-internals PRs modifying the internals crate labels Nov 26, 2025
@rustaceanrob rustaceanrob mentioned this pull request Nov 26, 2025
@tcharding
Copy link
Member

Does it make sense to also remove the deprecated method?

Perhaps remove it from the macro but put an impl block on each type that calls the macro with the deprecated function.

I was hesitant when I read the PR title because of my distrust of macros, but this one is pretty good. So FWIW concept ACK that. Will review.

@rustaceanrob
Copy link
Contributor Author

Moved deprecated method to impl blocks in 697789d

I neglected the method in bip152 since it should be going to p2p anyway

Copy link
Contributor

@rockcoolsaint rockcoolsaint left a comment

Choose a reason for hiding this comment

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

The changes moved without breaking existing tests

@apoelstra
Copy link
Member

Agreed, this macro seems okay. Importantly it does not use anything from other crates except core/std. concept ACK.

apoelstra
apoelstra previously approved these changes Nov 29, 2025
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 697789d; successfully ran local tests

@nyonson
Copy link
Contributor

nyonson commented Nov 29, 2025

ACK 697789d

@apoelstra
Copy link
Member

@tcharding when you get a moment, you said "will review" so I'll hold off on merging til you do.

@tcharding
Copy link
Member

Oooph, sorry I meant to do it that day.

tcharding
tcharding previously approved these changes Nov 30, 2025
Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

ACK 697789d

Comment on lines 42 to 43
internal_macros::impl_array_newtype!(ChainCode, u8, 32);
impl_array_newtype!(ChainCode, u8, 32);
Copy link
Member

Choose a reason for hiding this comment

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

nit: I'd prefer one level of path, wi have been working towards doing so for macros repo wide.

internals::impl_arry_newtyp! ...

Discussion rust-bitcoin#5331 suggested removing `bitcoin` as a direct dependency
could be a reasonable goal for the `p2p` crate. One conflict along the
way is the use of this macro in `bip152` to implement the array-like
traits for the short IDs. Because `bitcoin` depends on `internals`, as
does `p2p`, we can move this macro into `internals` to help detangle
`p2p` and `bitcoin`.

Moves the deprecated methods to the `impl` blocks.
@rustaceanrob
Copy link
Contributor Author

Addressed all the imports in 20cd232

Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

ACK 20cd232

@tcharding
Copy link
Member

Thanks mate.

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 20cd232; successfully ran local tests

@apoelstra apoelstra merged commit 616d0a1 into rust-bitcoin:master Dec 2, 2025
27 checks passed
@rustaceanrob rustaceanrob deleted the 11-26-mv-nt branch December 4, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bitcoin PRs modifying the bitcoin crate C-internals PRs modifying the internals crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants