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

refactor: rename inner field names #393

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

reez
Copy link
Collaborator

@reez reez commented Aug 16, 2023

Description

Rename non-public inner struct fields as "inner"

Notes to the reviewers

Linked Issue and description

Describe the enhancement
In a few places we need to "wrap" a bdk or rust-bitcoin struct in a bkd-ffi struct and make the original type a non-public "inner" field. We've used different names for these inner fields but should standardize on the name "inner" for consistency and readability. Examples of stucts that need to be changed:
Transaction.internal
Address.address
Script.script
Blockchain.blockchain_mutex
Mnemonic.internal
DerivationPath.derivation_path_mutex
DescriptorPublicKey.descriptor_public_key_mutex
DescriptorSecretKey.descriptor_secret_key_mutex
Input._inner
PartiallySignedTransaction.internal
Wallet.wallet_mutex

Use case
Users won't see this change.

Additional context
The name "inner" is common in other libraries like rust-bitcoin.

I looked thru the list of items referenced in the Issue that needed to be changed:

  • Transaction.internal
  • Address.address
  • Script.script
  • Blockchain.blockchain_mutex
  • Mnemonic.internal
  • DerivationPath.derivation_path_mutex
  • DescriptorPublicKey.descriptor_public_key_mutex
  • DescriptorSecretKey.descriptor_secret_key_mutex
  • Input._inner
  • PartiallySignedTransaction.internal
  • Wallet.wallet_mutex

The only item from that list I didn't change was Input._inner because I couldn't find Input. I tried to do some digging to see if Input was changed to something else but I didn't quite find it.

I did not make any changes to the bdk.udl file

Let me know if there is anything that should/shouldn't be changed that I missed.

Also if this gets approved I'm totally happy to wait on it being merged if #392 needs to be merged first or anything.

Changelog notice

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@reez reez linked an issue Aug 16, 2023 that may be closed by this pull request
@reez reez force-pushed the issue-366 branch 3 times, most recently from ab1bd51 to 7f22631 Compare August 16, 2023 18:50
@notmandatory
Copy link
Member

I couldn't find where that Input._inner was either, so don't worry about it.

bdk-ffi/src/keys.rs Outdated Show resolved Hide resolved
bdk-ffi/src/keys.rs Outdated Show resolved Hide resolved
bdk-ffi/src/keys.rs Outdated Show resolved Hide resolved
@reez
Copy link
Collaborator Author

reez commented Aug 16, 2023

Thanks for the helpful review and guiding on this @notmandatory , I updated the code to reflect the changes requested (CI + tests pass).

@reez reez marked this pull request as ready for review August 16, 2023 21:06
@reez reez requested a review from thunderbiscuit August 16, 2023 21:06
Copy link
Member

@thunderbiscuit thunderbiscuit left a comment

Choose a reason for hiding this comment

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

Tested ACK 7717ebb. I like the idea of identifying the mutexes by naming them inner_mutex.

Good to go IMO. I'll rebase #392.

@thunderbiscuit thunderbiscuit merged commit 7717ebb into bitcoindevkit:master Aug 18, 2023
@reez reez deleted the issue-366 branch August 18, 2023 18:21
@notmandatory notmandatory added this to the Release 0.30.0 milestone Aug 18, 2023
@notmandatory notmandatory assigned reez and unassigned thunderbiscuit Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Rename non-public inner struct fields as "inner"
3 participants