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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
use std::hash::Hash;
use datasize::DataSize;
use derive_more::Display;
use serde_repr::{Deserialize_repr, Serialize_repr};
use strum::EnumIter;
/// An identifier for a specific type implementing the `Item` trait. Each different implementing
/// type should have a unique `Tag` variant.
#[derive(
Clone,
Copy,
DataSize,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
Serialize_repr,
Deserialize_repr,
Debug,
Display,
EnumIter,
)]
#[repr(u8)]
pub enum Tag {
/// A transaction identified by its hash and its approvals hash.
#[display(fmt = "transaction")]
Transaction,
/// A legacy deploy identified by its hash alone.
#[display(fmt = "legacy deploy")]
LegacyDeploy,
/// A block.
#[display(fmt = "block")]
Block,
/// A block header.
#[display(fmt = "block header")]
BlockHeader,
/// A trie or chunk of a trie from global state.
#[display(fmt = "trie or chunk")]
TrieOrChunk,
/// A finality signature for a block.
#[display(fmt = "finality signature")]
FinalitySignature,
/// Headers and signatures required to prove that if a given trusted block hash is on the
/// correct chain, then so is a later header, which should be the most recent one according
/// to the sender.
#[display(fmt = "sync leap")]
SyncLeap,
/// The hashes of the finalized deploy approvals sets for a single block.
#[display(fmt = "approvals hashes")]
ApprovalsHashes,
/// The execution results for a single block.
#[display(fmt = "block execution results")]
BlockExecutionResults,
}