Skip to content

types: Drop model newtype on Rust primitive types#666

Open
Abeeujah wants to merge 3 commits into
rust-bitcoin:masterfrom
Abeeujah:nomodel-primitives
Open

types: Drop model newtype on Rust primitive types#666
Abeeujah wants to merge 3 commits into
rust-bitcoin:masterfrom
Abeeujah:nomodel-primitives

Conversation

@Abeeujah

@Abeeujah Abeeujah commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Drops the following types in model which do not model a concrete rust-bitcoin type

  • GetBlockCount: newtype on u64
  • GetDifficulty: newtype on f64
  • RescanBlockchain: both struct fields (start_height, stop_height) are u32

@jamillambert jamillambert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The changes in total look good, but the commit sequence is a bit confusing to me. For example when you go through them the first one changes a test, but why? the reason that the test needs to be changed hasn't happened yet. And patch 2 doesn't pass verify because the verify fix is in a later patch. The work as a whole is good though. I would be happy if it was one patch, but if you want more for personal/green dots in github reasons I am cool with that too, but they need to make sense in order.

@Abeeujah

Copy link
Copy Markdown
Contributor Author

I would be happy if it was one patch

Would be squashing right away!

Abeeujah added 2 commits July 17, 2026 00:06
- Drop model::GetBlockCount type and into_model impl
- Remove model verification from GetBlockCount test
- Update getblockcount docs to version-only
- Update GetBlockCount verification to no-model
- Drop model::GetDifficulty type and into_model impl
- Remove model verification from GetDifficulty test
- Update GetDifficulty docs to version-only
- Update GetDifficulty verification to use no-model
@Abeeujah
Abeeujah force-pushed the nomodel-primitives branch from 48e8cc7 to 623a4ff Compare July 16, 2026 23:25
@Abeeujah Abeeujah changed the title types: Drop blockchain model newtypes on Rust primitive types types: Drop model newtype on Rust primitive types Jul 16, 2026

@jamillambert jamillambert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • RescanBlockchain: both struct fields (start_height, stop_height) are u32

They are both still i64 in types. I assume since everything worked with the conversion to the model where they were u32 means they can be changed from i64 to u32 in types.

- Drop model::RescanBlockchain type and into_model impl
- Remove model verification from RescanBlockchain test
- Update RescanBlockchain fields (start_height, stop_height) to be `u32`
- Update RescanBlockchain docs to version-only
- Update RescanBlockchain verification to use no-model
@Abeeujah
Abeeujah force-pushed the nomodel-primitives branch from 623a4ff to e9dba92 Compare July 17, 2026 16:26
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.

2 participants