8000 transaction: Rename is_coin_base to is_coinbase by stevenroose · Pull Request #1796 · rust-bitcoin/rust-bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

transaction: Rename is_coin_base to is_coinbase #1796

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

Merged
merged 3 commits into from
Apr 24, 2023

Conversation

stevenroose
Copy link
Collaborator

Alternative to #1795.

Keep the old method as deprecated and add doc alias. Also change internal usage of the method.

Kixunil
Kixunil previously approved these changes Apr 13, 2023
Copy link
Collaborator
@Kixunil Kixunil left a comment

Choose a reason for hiding this comment

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

ACK b2e90eaabfa7c7683882484ae5dfc137f787190f

I prefer this to the alternative.

@Kixunil Kixunil added API break This PR requires a version bump for the next release 1.0 Issues and PRs required or helping to stabilize the API labels Apr 13, 2023
@apoelstra
Copy link
Member
apoelstra commented Apr 13, 2023

Lolll looks like we need to stick allow(clippy::deprecated_semver) on the crate to use the NEXT_VERSION trick. Or use something like 0.0.0-NEXT_VERSION.

tcharding
tcharding previously approved these changes Apr 13, 2023
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 5ad3da256ba221f945be275ac2e6dba0398f6950

@@ -981,10 +981,19 @@ impl Transaction {
/// transaction. It is impossible to check if the transaction is first in the block, so this
/// function checks the structure of the transaction instead - the previous output must be
/// all-zeros (creates satoshis "out of thin air").
pub fn is_coin_base(&self) -> bool {
#[doc(alias = "is_coin_base")] // method previously had this name
Copy link
Member

Choose a reason for hiding this comment

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

Interesting, is the idea to remove this when we remove the deprecated function? I've never used this attribute myself.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd keep it for as long as we can tolerate it. Anyone might remember the old name and search for it. It doesn't hurt I guess, it only makes it show up in search when you search for that name.

Copy link
Collaborator
@Kixunil Kixunil Apr 19, 2023

Choose a reason for hiding this comment

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

Yeah, I wouldn't mind keeping it forever. Not just because it had this name but also that it's a name someone might think of.

@tcharding
Copy link
Member

Looks like "NEXT_RELEASE" will need to go in in the "note = NEXT RELEASE" field. We should grep for "NEXT.RELEASE" too so we don't miss "NEXT-RELEASE" or "NEXT RELEASE", and leave that in released code which would be pretty embarrassing.

@Kixunil
Copy link
Collaborator
Kixunil commented Apr 14, 2023

We could also allow the lint in non-release PRs and enable it in release PRs.

@apoelstra
Copy link
Member

We could also allow the lint in non-release PRs and enable it in release PRs.

I like this. I think we do it by cargo clippy -- -D clippy::deprecated_semver ... though I tried to test this, and we don't have any globally-allowed lints I can test this on, and it seems like it doesn't override locally-allowed ones.

@stevenroose
Copy link
Collaborator Author

Grrrr at clippy enforcement, it's so unproductive! So I will try to silence clippy for non-release CI then? Is that the consensus? Let me see if I can figure out how to do that.

Keep the old method as deprecated and add doc alias.
Also change internal usage of the method.
@stevenroose
Copy link
Collaborator Author

Hmm, I'm not sure how the CI is built, but running clippy in the release job would require having nightly cargo in that job and I don't think we want that?

I went for what Tobin suggested instead, renaming to NEXT-RELEASE and matching for that. That seems to be accepted by overlord clippy nightly as a valid semver version. Tbh I think I've seen underscores in semvers, I don't see the issue. I tested the grep and for me it worked.

@Kixunil
Copy link
Collaborator
Kixunil commented Apr 19, 2023

Why would nightly be a problem? Sure there's a risk that release gets stalled a bit due to a nightly bug but worst case we could turn it off.

@stevenroose
Copy link
Collaborator Author

Why would nightly be a problem? Sure there's a risk that release gets stalled a bit due to a nightly bug but worst case we could turn it off.

Nightly is generally a problem, right? What if a regression in nightly actually makes the release go through while it shouldn't? In fact I'd say it makes most sense to test the release in MSRV. Idk exactly what the release command checks for 8000 and how it differs from cargo build, but I can imagine things like new manifest fields or something be a thing. We don't have Cargo.lock, so that should be ok.

Anyway, I think like it's done in my latest commit should make sense.

@Kixunil
Copy link
Collaborator
Kixunil commented Apr 19, 2023

I believe we should test on all versions.

tcharding
tcharding previously approved these changes Apr 19, 2023
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 38d11ce

@tcharding
Copy link
Member
tcharding commented Apr 19, 2023

CI fail is a formatting issue in patch 1 bro. Your favourite :)

@stevenroose
Copy link
Collaborator Author

pushed a fix

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 a54e1ce

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 a54e1ce

@apoelstra apoelstra merged commit 84a075d into rust-bitcoin:master Apr 24, 2023
@tcharding
Copy link
Member

Lol, just noticed the author of the last commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0 Issues and PRs required or helping to stabilize the API API break This PR requires a version bump for the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0