-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathblock_tree_error.hpp
42 lines (38 loc) · 1.18 KB
/
block_tree_error.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <outcome/outcome.hpp>
namespace kagome::blockchain {
/**
* Errors of the block tree are here, so that other modules can use them, for
* example, to compare a received error with those
*/
enum class BlockTreeError : uint8_t {
NO_PARENT = 1,
BLOCK_EXISTS,
// target block number is past the given maximum number
TARGET_IS_PAST_MAX,
// block resides on a dead fork
BLOCK_ON_DEAD_END,
// block exists in chain but not found when following all
// leaves backwards
EXISTING_BLOCK_NOT_FOUND,
// non-finalized block is not found
NON_FINALIZED_BLOCK_NOT_FOUND,
// justification is not found in block storage
JUSTIFICATION_NOT_FOUND,
// block body is not found in block storage
BODY_NOT_FOUND,
// block header is not found in block storage
HEADER_NOT_FOUND,
// some block in the requested chain is missing
SOME_BLOCK_IN_CHAIN_NOT_FOUND,
// block is not a leaf
BLOCK_IS_NOT_LEAF,
BLOCK_NOT_EXISTS
};
} // namespace kagome::blockchain
OUTCOME_HPP_DECLARE_ERROR(kagome::blockchain, BlockTreeError)