-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy patherror.rs
More file actions
27 lines (21 loc) · 1018 Bytes
/
error.rs
File metadata and controls
27 lines (21 loc) · 1018 Bytes
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
use graph::runtime::DeterministicHostError;
use crate::module::IntoTrap;
pub enum DeterminismLevel {
/// This error is known to be deterministic. For example, divide by zero.
/// TODO: For these errors, a further designation should be created about the contents
/// of the actual message.
Deterministic,
/// This error is known to be non-deterministic. For example, an intermittent http failure.
NonDeterministic,
/// The runtime is processing a given block, but there is an indication that the blockchain client
/// might not consider that block to be on the main chain. So the block must be reprocessed.
PossibleReorg,
/// An error has not yet been designated as deterministic or not. This should be phased out over time,
/// and is the default for errors like anyhow which are of an unknown origin.
Unimplemented,
}
impl IntoTrap for DeterministicHostError {
fn determinism_level(&self) -> DeterminismLevel {
DeterminismLevel::Deterministic
}
}