mining: Add error kinds for auto revocations.

This adds additional mining error kinds that will be used by the
automatic ticket revocations agenda implementation.
This commit is contained in:
Ryan Staudt 2021-08-18 15:28:20 -05:00 committed by Dave Collins
parent 7eae1a1e63
commit 0d455ddc27
2 changed files with 11 additions and 2 deletions

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015-2020 The Decred developers
// Copyright (c) 2015-2021 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
@ -51,6 +51,13 @@ const (
// calculating the associated commitment root for a newly created block
// template failed.
ErrCalcCommitmentRoot = ErrorKind("ErrCalcCommitmentRoot")
// ErrGetTicketInfo indicates that ticket information could not be retreived
// in order to connect a transaction.
ErrGetTicketInfo = ErrorKind("ErrGetTicketInfo")
// ErrSerializeHeader indicates an attempt to serialize a block header failed.
ErrSerializeHeader = ErrorKind("ErrSerializeHeader")
)
// Error satisfies the error interface and prints human-readable errors.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2020 The Decred developers
// Copyright (c) 2020-2021 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
@ -26,6 +26,8 @@ func TestErrorKindStringer(t *testing.T) {
{ErrFraudProofIndex, "ErrFraudProofIndex"},
{ErrFetchTxStore, "ErrFetchTxStore"},
{ErrCalcCommitmentRoot, "ErrCalcCommitmentRoot"},
{ErrGetTicketInfo, "ErrGetTicketInfo"},
{ErrSerializeHeader, "ErrSerializeHeader"},
}
for i, test := range tests {