-
Notifications
You must be signed in to change notification settings - Fork 291
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 CreateRevocationFromTicket. #2707
multi: Add CreateRevocationFromTicket. #2707
Conversation
f8f44b5
to
a9a2f64
Compare
a9a2f64
to
30f6a42
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.
Also tried it out on simnet and was able to revoke a ticket.
30f6a42
to
4a358b4
Compare
This adds a new function, CreateRevocationFromTicket, and associated tests for creating a revocation transaction for a given ticket.
This reworks the createrawssrtx handler to use the CreateRevocationFromTicket function from the stake package rather than creating the transaction directly. It also adds additional error handling on the transaction input: - The input must be a ticket submission output (output index 0) - The input amount must equal the ticket submission amount
4a358b4
to
98608fb
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.
The updates look good now. The code in the RPC handler is much cleaner and the test additions to ensure proper creation of the revocation are nice to see.
This adds a new function,
CreateRevocationFromTicket
, and associated tests for creating a revocation transaction for a given ticket.Additionally, it reworks the
createrawssrtx
rpcserver
handler to use theCreateRevocationFromTicket
function from thestake
package rather than creating the transaction directly.It also adds additional error handling on the transaction input:
This function will also be used from the mining template generation code to create revocations as part of the automatic ticket revocations agenda.