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

rpcserver: Set script version in raw tx results. #2663

Merged
merged 2 commits into from Jun 15, 2021

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Jun 11, 2021

This ensures the recently-added script version field of types.ScriptPubKeyResult is set in the various RPCs that produce raw
transaction results. Namely, getrawtransaction, decoderawtransaction, searchrawtransaction, and getblock (with the verbose tx flag set).

Note that this is a duplicate of the types.Vout.Version field.

@davecgh davecgh added this to the 1.7.0 milestone Jun 11, 2021
Copy link
Member

@rstaudt2 rstaudt2 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

It looks like the API docs also need to be updated to include the version field everywhere that scriptPubKey is referenced (maybe you are planning on doing that separately since, given the discussion around this, it sounds like you'll also be deprecating the version field at the output level).

Also, just a heads up, the PR title has a typo (rcpserver).

@davecgh davecgh changed the title rcpserver: Set script version in raw tx results. rpcserver: Set script version in raw tx results. Jun 12, 2021
@davecgh
Copy link
Member Author

davecgh commented Jun 12, 2021

@rstaudt2 Commit message updated.

Yes, I was planning to do that as part of the PR to deprecate the version field, but I agree that it more naturally fits here, so I'll add a separate commit to this one to include those changes later today.

@davecgh
Copy link
Member Author

davecgh commented Jun 12, 2021

I've added a commit to update the JSON-RPC API docs as well.

@rstaudt2
Copy link
Member

I've added a commit to update the JSON-RPC API docs as well.

I reviewed the API doc updates, and those look good to me as well.

This ensures the recently-added script version field of
types.ScriptPubKeyResult is set in the various RPCs that produce raw
transaction results.  Namely, getrawtransaction, decoderawtransaction,
searchrawtransaction, and getblock (with the verbose tx flag set).

Note that this is a duplicate of the types.Vout.Version field.
This updates the JSON-RPC API docs to include the version field as part
of the scriptPubKey object for the RPCs that involve it.
@davecgh davecgh merged commit e279168 into decred:master Jun 15, 2021
@davecgh davecgh deleted the rpcserver_vout_script_ver branch June 15, 2021 18:00
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 this pull request may close these issues.

None yet

4 participants