Skip to content

Remove concrete types from types/src/vXY#514

Open
jamillambert wants to merge 4 commits intorust-bitcoin:masterfrom
jamillambert:0218-remove-concrete-types
Open

Remove concrete types from types/src/vXY#514
jamillambert wants to merge 4 commits intorust-bitcoin:masterfrom
jamillambert:0218-remove-concrete-types

Conversation

@jamillambert
Copy link
Collaborator

@jamillambert jamillambert commented Feb 18, 2026

Concrete bitcoin types should only be used in the modelled type.

Go through every module file in types/src/vXY remove the bitcoin::x imports and fix the issues that causes or put back if required for other reasons:

  • Move GetBlockchainInfo::into_model() to the into module to be consistent with other types.
  • Remove concrete bitcoin type from GetOrphanTxs: Use String instead of Txid, add the error type and fix into_model().
  • Move bitcoin imports to into module: Some bitcoin types are only used in the into module but are imported in the main module. Move the imports to make it clearer that no concrete bitcoin types are used until the conversion into the modeled type.
  • Remove concrete bitcoin type from GetTransaction: Use String instead of Transaction in GetTransaction and fix into_model().

Closes #511

@jamillambert jamillambert force-pushed the 0218-remove-concrete-types branch from 94d5a27 to f9fb6c2 Compare February 18, 2026 14:40
@jamillambert jamillambert force-pushed the 0218-remove-concrete-types branch 2 times, most recently from 258dded to 3c7bbf7 Compare February 18, 2026 15:26
tcharding
tcharding previously approved these changes Feb 18, 2026
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 3c7bbf7

@tcharding
Copy link
Member

Needs rebase because of #513

To be consistent with other types move the into_model function to the
into module.
Use String instead of Txid in GetOrphanTxs.

Add the error type for conversion into a Txid.

Fix the into_model function to convert the String to a Txid.
The bitcoin types are only used in the into module.

Move the imports to make it clearer that no concrete bitcoin types are
used until the conversion into the modeled type.
Use String instead of Transaction in GetTransaction.

Fix the into_model function to convert the String into a Transaction.
@jamillambert
Copy link
Collaborator Author

Rebased to remove merge conflicts. No changes, conflicts were due to adjacent line changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vXY::wallet has concrete bitcoin type

2 participants

Comments