-
Notifications
You must be signed in to change notification settings - Fork 296
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
multi: Add tx inputs treasurybase RPC support. #2470
multi: Add tx inputs treasurybase RPC support. #2470
Conversation
c0687ab
to
b15e118
Compare
This adds a new field to the Vin and VinPrevOut fields of json/rpc/types to identify if the input is a treasurybase or not and updates both the marshalling code as well as the relevant rpcserver results accordingly. Since a treasurybase does not have a signature script like a coinbase and stakebase, the new field is a boolean versus a string like the others. In addition, it updates the rpcserver help to document the new field. At a high level, this means the verbose output of decoderawtransaction, getblock, getrawtransaction, searchrawtransactions, and websocket transaction accepted notifications will now identify treasurybase inputs. Finally, it bumps the rpcserver to version 6.2.0 to signal support for the new features.
This updates the JSON-RPC API documentation for decoderawtransaction, getrawtransaction, and searchrawtransactions to make them match reality and also to add the new treasurybase output.
b15e118
to
804e47f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one question for my own understanding.
// NOTE: This check MUST come before the coinbase check because a | ||
// treasurybase will be identified as a coinbase as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell standalone.IsCoinBaseTx
will not identify treasurybase as coinbase if isTreasuryEnabled
is accurate because of the treasury-like checks in IsCoinBaseTx
(the isTreasurySpendLike
closure), but I think it's prudent to check treasurybase first regardless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will. It won't identify treasury spends as coinbases, but it will identify a treasurybase as a coinbase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, spends. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment on something preexisting. I uploaded these changes to my master to check out the formatting. While everything looks fine, I'm not sure redirection is working completely as intended. Everything is redirected back to decred/dcrd
. For example, if you start at https://github.com/JoeGruffins/dcrd and click on the docs
link, it takes you to https://github.com/decred/dcrd/tree/master/docs although I was expecting to go to my repository's docs.
@JoeGruffins: You can see the rendered without putting it in your own repo here. The links from the README are absolute (and really should be so they work to go the primary repo from anywhere). |
This requires #2469.
This adds a new field to the
Vin
andVinPrevOut
fields ofjson/rpc/types
to identify if the input is a treasurybase or not and updates both the marshalling code as well as the relevant rpcserver results accordingly. Since a treasurybase does not have a signature script like a coinbase and stakebase, the new field is a boolean versus a string like the others.In addition, it updates the rpcserver help to document the new field.
At a high level, this means the verbose output of
decoderawtransaction
,getblock
,getrawtransaction
,searchrawtransactions
, and websocket transaction accepted notifications will now identify treasurybase inputs.It also bumps the rpcserver to version 6.2.0 to signal support for the new features.
Finally, a separate commit updates the JSON-RPC API documentation for
decoderawtransaction
,getrawtransaction
, andsearchrawtransactions
to make them match reality and also to add the new treasurybase output.