From 0d455ddc276b6072ddfec5ca8f46f860b453d73a Mon Sep 17 00:00:00 2001 From: Ryan Staudt Date: Wed, 18 Aug 2021 15:28:20 -0500 Subject: [PATCH] mining: Add error kinds for auto revocations. This adds additional mining error kinds that will be used by the automatic ticket revocations agenda implementation. --- internal/mining/error.go | 9 ++++++++- internal/mining/error_test.go | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/internal/mining/error.go b/internal/mining/error.go index bac239bf..a72b62be 100644 --- a/internal/mining/error.go +++ b/internal/mining/error.go @@ -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. diff --git a/internal/mining/error_test.go b/internal/mining/error_test.go index 93ba29cf..520ffd00 100644 --- a/internal/mining/error_test.go +++ b/internal/mining/error_test.go @@ -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 {