bee_block/output/
state_transition.rs1use crate::semantic::ValidationContext;
5
6#[allow(missing_docs)]
8#[derive(Debug, Eq, PartialEq)]
9pub enum StateTransitionError {
10 InconsistentCreatedFoundriesCount,
11 InconsistentFoundrySerialNumber,
12 InconsistentNativeTokensFoundryCreation,
13 InconsistentNativeTokensFoundryDestruction,
14 InconsistentNativeTokensMint,
15 InconsistentNativeTokensTransition,
16 InconsistentNativeTokensMeltBurn,
17 IssuerNotUnlocked,
18 MissingAliasForFoundry,
19 MutatedFieldWithoutRights,
20 MutatedImmutableField,
21 NonMonotonicallyIncreasingNativeTokens,
22 NonZeroCreatedId,
23 NonZeroCreatedFoundryCounter,
24 NonZeroCreatedStateIndex,
25 UnsortedCreatedFoundries,
26 UnsupportedStateIndexOperation { current_state: u32, next_state: u32 },
27 UnsupportedStateTransition,
28}
29
30pub trait StateTransitionVerifier {
32 fn creation(next_state: &Self, context: &ValidationContext) -> Result<(), StateTransitionError>;
34
35 fn transition(
37 current_state: &Self,
38 next_state: &Self,
39 context: &ValidationContext,
40 ) -> Result<(), StateTransitionError>;
41
42 fn destruction(current_state: &Self, context: &ValidationContext) -> Result<(), StateTransitionError>;
44}