Skip to content

blockchain: Test auto revocation input index. - #3787

Open
matthawkins90 wants to merge 1 commit into
decred:masterfrom
matthawkins90:test_autorevocation_input_index
Open

blockchain: Test auto revocation input index.#3787
matthawkins90 wants to merge 1 commit into
decred:masterfrom
matthawkins90:test_autorevocation_input_index

Conversation

@matthawkins90

Copy link
Copy Markdown
Contributor

In #3786 I added a test for this consensus rule for the pre-DCP0009 case. This PR covers the live consensus code, where automatic ticket revocations are active.

The new case extends TestAutoRevocations, which already activates the agenda and creates version 2 revocations for missed tickets.

Part of the test coverage work for #1182.

This adds a test case to TestAutoRevocations for the consensus rule
that requires the first input of a revocation to reference the ticket
submission output.  The rule applies when automatic ticket revocations
are active.

The new case modifies the version 2 revocation for a missed ticket so
that its ticket input references the ticket change output at index 2.
It then ensures the block is rejected due to the invalid input.  The
case uses index 2 rather than index 1 since the commitment output at
index 1 is an OP_RETURN output that is never part of the utxo set.  A
revocation that references it fails with a missing utxo error before the
input index check.
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.

1 participant