Skip to content

ScriptPubkey is strange #166

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

Closed
tcharding opened this issue May 14, 2025 · 1 comment · Fixed by #174
Closed

ScriptPubkey is strange #166

tcharding opened this issue May 14, 2025 · 1 comment · Fixed by #174

Comments

@tcharding
Copy link
Member

tcharding commented May 14, 2025

ScriptPubkey is in types/src/lib.rs and used upto v21 in blockchain and wallet. Then in v22/blockchain it changes shape but v22::wallet seems to use the v17 one still.

@tcharding tcharding changed the title getxout is borked ScriptPubkey is strange May 14, 2025
@tcharding tcharding reopened this May 14, 2025
@tcharding
Copy link
Member Author

Related to #156

tcharding added a commit to tcharding/corepc that referenced this issue May 15, 2025
The `ScriptPubkey` type is a type that is returned by Core in various
places. It seems like the Core devs put a fair bit of effort into
it (probably because of this) and when the type changed in v22 it was
changed in a way that was completely backwards compatible.

I failed to fully understand this when first adding the type.

With this patch applied there is now only one `ScriptPubkey` type (in
`libr.s`) and also we add a model type.

The `ScriptPubkey` type is unusual in that its fields can be used to
create `TxOut` if tx value is known - which for example in `GetTxOut` it
is.

So here we also remove the v22 `GetTxOut` type since it only existed
because of the perceived difference in `ScriptPubkey` which no longer
exists.

Fix: rust-bitcoin#166
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 a pull request may close this issue.

1 participant