8000 Move and rename TxOut default trait to a const called NULL by yancyribbens · Pull Request #1838 · rust-bitcoin/rust-bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Move and rename TxOut default trait to a const called NULL #1838

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 1 commit into from
May 9, 2023

Conversation

yancyribbens
Copy link
Contributor
@yancyribbens yancyribbens commented May 5, 2023

Create an associated constant const TxOut::NULL for consensus signing code and remove the default trait. Note I tried to deprecate the default() fn instead of just removing it but it doesn't seem to be possible. Also because TxOut::NULL is const, ScriptBuf::new() needed to be changed to const fn.

@yancyribbens
Copy link
Contributor Author

This change is a followup from #1811

@yancyribbens yancyribbens force-pushed the tx-out-null branch 2 times, most recently from 0530c83 to 933f060 Compare May 5, 2023 09:16
@yancyribbens
Copy link
Contributor Author

Address sanitizer test fail seems unrelated

@apoelstra
Copy link
Member

Yeah, asan failure looks like it's some nighly-related thing.

You are correct that there is no way to deprecate a Default impl :(. I suggest that we just delete it and put a warning in the CHANGELOG.

apoelstra
apoelstra previously approved these changes May 5, 2023
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 933f06014e4bd55924a327d6cc8b16763c023871

@yancyribbens
Copy link
Contributor Author

Updated CHANGELOG.md

tcharding
tcharding previously approved these changes May 5, 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 cff5c302cdf8ad56971110a65e867f8e320aaa37

@yancyribbens yancyribbens force-pushed the tx-out-null branch 2 times, most recently from 02ea7c3 to f33445a Compare May 6, 2023 08:09
apoelstra
apoelstra previously approved these changes May 6, 2023
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 f33445a7d930a97157d85c1ebf45cb51dd53ac89

@Kixunil
Copy link
Collaborator
Kixunil commented May 7, 2023

Note that if we change Amount to be bounded by MAX_MONEY this will have to go away. However, this is still an improvement so I won't block this.

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.

Other than incorrect changelog, this is good.

@apoelstra
Copy link
Member

Note that if we change Amount to be bounded by MAX_MONEY this will have to go away. However, this is still an improvement so I won't block this.

So, it basically can't "go away" since it's used in the legacy sighashing algorithm. We'd have to think carefully about that.

@Kixunil
Copy link
Collaborator
Kixunil commented May 7, 2023

it basically can't "go away" since it's used in the legacy sighashing algorithm

It can by refactoring that single piece of code that uses it to serialize directly into hasher rather than creating intermediate transaction - which would also improve speed so it's nice to do regardless.

@apoelstra
Copy link
Member

Ok, yeah, I agree with that. Though I also think this PR is a step in the right direction.

@tcharding
Copy link
Member
tcharding commented May 8, 2023

We sometimes use an "unreleased" section at the top of the changlog, you can always add that if you'd like to make sure your PRs get a mention, saves me having to decide if something is mention-worthy also which is great :)

@tcharding tcharding requested a review from apoelstra May 8, 2023 00:27
@tcharding
Copy link
Member

I re-requested review to remove your "approve" @apoelstra since I was momentarily confused by the approve but the changlog thing stlil there.

tcharding
tcharding previously approved these changes May 8, 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.

With changelog fix: ACK f33445a7d930a97157d85c1ebf45cb51dd53ac89

@yancyribbens
Copy link
Contributor Author
yancyribbens commented May 8, 2023

A different version of nightly is now available 1.71 07-05 which is causing a test failure for nightly now.

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 75b3f19

sanket1729 added a commit that referenced this pull request May 9, 2023
639c548 docs: Add doc comments for external crates (yancy)

Pull request description:

  A new version of rust nightly is causing a test failure for external crates that are not documented.  This is currently causing a failure on my branch here: #1838

  As a side note, it feels like this should be locked to a specific version of nightly in the CI tests and then updated as a choir instead of having it create a new problem in a branch that's not related.

ACKs for top commit:
  apoelstra:
    ACK 639c548
  tcharding:
    ACK 639c548

Tree-SHA512: 764999edc448bff88013301bef287b16ac750af560931470257f2b4475747d52546e73d7fd9a7bdf2cedb18178f370150351e40f176f3da929edf686f02f5c1a
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 75b3f19

@apoelstra apoelstra merged commit d93e781 into rust-bitcoin:master May 9, 2023
@stevenroose
Copy link
Collaborator

ACK :)

@apoelstra apoelstra mentioned this pull request May 15, 2023
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.

5 participants
0