blockchain: Add auto revocation error kinds.

This adds additional blockchain error kinds that will be used by the
automatic ticket revocations agenda implementation.
This commit is contained in:
Ryan Staudt 2021-08-18 13:15:03 -05:00 committed by Dave Collins
parent 90308ef7c2
commit a69e816489
2 changed files with 23 additions and 0 deletions

View File

@ -607,6 +607,9 @@ const (
// block which is not allowed.
ErrInvalidateGenesisBlock = ErrorKind("ErrInvalidateGenesisBlock")
// ErrSerializeHeader indicates an attempt to serialize a block header failed.
ErrSerializeHeader = ErrorKind("ErrSerializeHeader")
// ------------------------------------------
// Errors related to the UTXO backend.
// ------------------------------------------
@ -627,6 +630,22 @@ const (
// a UTXO backend transaction that has already had one of those operations
// performed.
ErrUtxoBackendTxClosed = ErrorKind("ErrUtxoBackendTxClosed")
// -----------------------------------------------------------------
// Errors related to the automatic ticket revocations agenda.
// -----------------------------------------------------------------
// ErrInvalidRevocationTxVersion indicates that the revocation is the wrong
// transaction version.
ErrInvalidRevocationTxVersion = ErrorKind("ErrInvalidRevocationTxVersion")
// ErrNoExpiredTicketRevocation indicates that the block does not contain a
// revocation for a ticket that is becoming expired as of that block.
ErrNoExpiredTicketRevocation = ErrorKind("ErrNoExpiredTicketRevocation")
// ErrNoMissedTicketRevocation indicates that the block does not contain a
// revocation for a ticket that is becoming missed as of that block.
ErrNoMissedTicketRevocation = ErrorKind("ErrNoMissedTicketRevocation")
)
// Error satisfies the error interface and prints human-readable errors.

View File

@ -157,10 +157,14 @@ func TestErrorKindStringer(t *testing.T) {
{ErrNoFilter, "ErrNoFilter"},
{ErrNoTreasuryBalance, "ErrNoTreasuryBalance"},
{ErrInvalidateGenesisBlock, "ErrInvalidateGenesisBlock"},
{ErrSerializeHeader, "ErrSerializeHeader"},
{ErrUtxoBackend, "ErrUtxoBackend"},
{ErrUtxoBackendCorruption, "ErrUtxoBackendCorruption"},
{ErrUtxoBackendNotOpen, "ErrUtxoBackendNotOpen"},
{ErrUtxoBackendTxClosed, "ErrUtxoBackendTxClosed"},
{ErrInvalidRevocationTxVersion, "ErrInvalidRevocationTxVersion"},
{ErrNoExpiredTicketRevocation, "ErrNoExpiredTicketRevocation"},
{ErrNoMissedTicketRevocation, "ErrNoMissedTicketRevocation"},
}
t.Logf("Running %d tests", len(tests))