Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature use-serde renamed to serde #1006

Merged
merged 1 commit into from Jun 1, 2022

Conversation

Kixunil
Copy link
Collaborator

@Kixunil Kixunil commented May 25, 2022

Features activating external crates are supposed to have same name as
those crates. However we depend on same feature in other crates so we
need a separate feature. After MSRV bump it is possible to rename the
crates and features so we can now fix this inconsistency.

Sadly, derive can't see that the crate was renamed so all derives must
be told to use the other one.

Replaces #373

Cargo.toml Outdated
@@ -18,7 +18,7 @@ default = [ "std", "secp-recovery" ]
base64 = [ "base64-compat" ]
unstable = []
rand = ["secp256k1/rand-std"]
use-serde = ["serde", "bitcoin_hashes/serde", "secp256k1/serde"]
serde = ["actual_serde", "bitcoin_hashes/serde", "secp256k1/serde"]
Copy link
Member

Choose a reason for hiding this comment

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

nit: Perhaps use - instead of _ to be consistent with other names?

Copy link
Member

Choose a reason for hiding this comment

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

+1 from me (I often wish we had bitcoin-hashes too but its probably too much churn to replace bitcoin_hashes).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My naming is usually _ where I would've put space and - where I would've put - in normal text. Although it sometimes isn't a clear cut - e.g. bitcoin_hashes :D

Anyway, will rename, I also forgot to document people must not rely on the name.

Copy link
Member

@tcharding tcharding May 26, 2022

Choose a reason for hiding this comment

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

I like - because it reminds me of writing Lisp :)

Looks like you changed it in the manifest but did not change all the actual_serde instances in the derives. Was that intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it has to be _ in the code since extern crate actual-serde; wouldn't compile.

Cargo.toml Outdated
@@ -18,7 +18,7 @@ default = [ "std", "secp-recovery" ]
base64 = [ "base64-compat" ]
unstable = []
rand = ["secp256k1/rand-std"]
use-serde = ["serde", "bitcoin_hashes/serde", "secp256k1/serde"]
serde = ["actual_serde", "bitcoin_hashes/serde", "secp256k1/serde"]
Copy link
Member

Choose a reason for hiding this comment

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

+1 from me (I often wish we had bitcoin-hashes too but its probably too much churn to replace bitcoin_hashes).

@@ -41,6 +41,7 @@ use crate::VarInt;
/// the actual transactions
#[derive(Copy, PartialEq, Eq, Clone, Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(crate = "actual_serde"))]
Copy link
Member

Choose a reason for hiding this comment

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

Ahh, that is what was needed. Thanks for figuring this bit out.

@Kixunil Kixunil added the API break This PR requires a version bump for the next release label May 26, 2022
Features activating external crates are supposed to have same name as
those crates. However we depend on same feature in other crates so we
need a separate feature. After MSRV bump it is possible to rename the
crates and features so we can now fix this inconsistency.

Sadly, derive can't see that the crate was renamed so all derives must
be told to use the other one.
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 2e7effc

@apoelstra
Copy link
Member

I agree with comments preferring - over _. I apologize for bitcoin_hashes. I don't remember what I was thinking.

@Kixunil Kixunil added the one ack PRs that have one ACK, so one more can progress them label May 27, 2022
Copy link
Member

@sanket1729 sanket1729 left a comment

Choose a reason for hiding this comment

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

ACk 2e7effc. @tcharding's nit has also been addressed.

@sanket1729 sanket1729 merged commit 471f909 into rust-bitcoin:master Jun 1, 2022
@Kixunil Kixunil deleted the rename-features branch June 2, 2022 06:32
ChallengeDev210 pushed a commit to ChallengeDev210/rust-bitcoin that referenced this pull request Aug 1, 2022
…`serde`

2e7effc Feature `use-serde` renamed to `serde` (Martin Habovstiak)

Pull request description:

  Features activating external crates are supposed to have same name as
  those crates. However we depend on same feature in other crates so we
  need a separate feature. After MSRV bump it is possible to rename the
  crates and features so we can now fix this inconsistency.

  Sadly, derive can't see that the crate was renamed so all derives must
  be told to use the other one.

  Replaces #373

ACKs for top commit:
  apoelstra:
    ACK 2e7effc

Tree-SHA512: b20364b9e8f30c2269bef915e821b2b2ec929e71dd0e88af2bc3a021821f87011d35e095cb8efe99add77a23dde940a17537eb387fb4582b05c57c8679969eb0
@Kixunil Kixunil added this to the 0.29.0 milestone Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API break This PR requires a version bump for the next release one ack PRs that have one ACK, so one more can progress them release notes mention
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants