Skip to content

Fix unused arg in PSBT impl_psbt_get_pair macro#786

Merged
apoelstra merged 1 commit intorust-bitcoin:masterfrom
BP-WG:psbt/macro_fix
Jan 17, 2022
Merged

Fix unused arg in PSBT impl_psbt_get_pair macro#786
apoelstra merged 1 commit intorust-bitcoin:masterfrom
BP-WG:psbt/macro_fix

Conversation

@dr-orlovsky
Copy link
Copy Markdown
Collaborator

Closes #754

@dr-orlovsky dr-orlovsky added the code quality Makes code easier to understand and less likely to lead to problems label Jan 15, 2022
@dr-orlovsky dr-orlovsky added this to the 0.28.0 milestone Jan 15, 2022
apoelstra
apoelstra previously approved these changes Jan 15, 2022
Copy link
Copy Markdown
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 e8a06fd41d29607f7eca5074581d010fe5428d37

@dr-orlovsky dr-orlovsky added the one ack PRs that have one ACK, so one more can progress them label Jan 15, 2022
Copy link
Copy Markdown
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.

Suggested another style which I think is probably a bit clearer and cleaner. It's just a really nit, so I can ACK this if you don't feel strongly about this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: Remove the Option everywhere?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can also remove the BTreeMap here, and change this to rv.push and the above can be rv.push_map. The above types Option and BTreeMap are merely matching the syntax and not used in the macro.

If you do the above suggestions, the code might look simpler:

            rv.push(self.witness_script as PSBT_OUT_WITNESS_SCRIPT)
            rv.push_map(self.bip32_derivation as PSBT_OUT_BIP32_DERIVATION)

@dr-orlovsky dr-orlovsky mentioned this pull request Jan 16, 2022
@dr-orlovsky
Copy link
Copy Markdown
Collaborator Author

@sanket1729 simplified as you suggested - also removed unnecessary/confusing as part

Copy link
Copy Markdown
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 1b77e36

Good idea @sanket1729 !

Copy link
Copy Markdown
Collaborator

@RCasatta RCasatta left a comment

Choose a reason for hiding this comment

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

utACK 1b77e36

much simpler

@apoelstra
Copy link
Copy Markdown
Member

Let's get one more ACK just in case others have opinions about these macros.

Copy link
Copy Markdown
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 1b77e36

Potentially for future nit PR rename $slf to $this which should be more readable.

@apoelstra apoelstra merged commit 8acdb1a into rust-bitcoin:master Jan 17, 2022
apoelstra added a commit that referenced this pull request Jan 18, 2022
1b2dbd7 0.28.0-rc.1 release (Dr Maxim Orlovsky)

Pull request description:

  We still have quite a few issues and PRs pending to be addressed/merged before full 0.28 release: see https://github.com/rust-bitcoin/rust-bitcoin/milestone/10

  Most important, we have to find a way to address #777; additionally it will be desirable to get #587, #786, #776.

  We also have quite of work to write CHANGELOG in #785

  Nevertheless I propose to start with a `beta-1` subrelease to unlock ability for `miniscript` release and downstream testing. The Taproot API looks final, and the pending PRs are addresses internal issues/bugs which is perfectly fine for beta releases.

ACKs for top commit:
  Kixunil:
    ACK 1b2dbd7

Tree-SHA512: a7bd6dd3e7a489f7fd758fb0d7a60103bfe0cdf88997b2163f163841fa1c12e7b31fa8f03b9f817a671379578dbc10a2ca583f49b64d2d2de4a9ebb57b2b9bd5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality Makes code easier to understand and less likely to lead to problems one ack PRs that have one ACK, so one more can progress them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove unused last argument in impl_psbt_get_pair macro

5 participants