Trait gear_common::gas_provider::Error
source · pub trait Error {
Show 16 methods
// Required methods
fn node_already_exists() -> Self;
fn parent_is_lost() -> Self;
fn parent_has_no_children() -> Self;
fn node_not_found() -> Self;
fn node_was_consumed() -> Self;
fn insufficient_balance() -> Self;
fn forbidden() -> Self;
fn unexpected_consume_output() -> Self;
fn unexpected_node_type() -> Self;
fn value_is_not_caught() -> Self;
fn value_is_blocked() -> Self;
fn value_is_not_blocked() -> Self;
fn consumed_with_lock() -> Self;
fn consumed_with_system_reservation() -> Self;
fn total_value_is_overflowed() -> Self;
fn total_value_is_underflowed() -> Self;
}
Expand description
Errors stating that gas tree has been invalidated.
Contains constructors for all existing errors.
Required Methods§
sourcefn node_already_exists() -> Self
fn node_already_exists() -> Self
Gas (gas tree) has already been created for the provided key.
sourcefn parent_is_lost() -> Self
fn parent_is_lost() -> Self
Parent must be in the tree, but not found.
This differs from node_not_found
, because parent
node for local node types must be found, but was not. Thus,
tree is invalidated.
sourcefn parent_has_no_children() -> Self
fn parent_has_no_children() -> Self
Parent node must have children, but they weren’t found.
If node is a parent to some other node it must have at least one child, otherwise it’s id can’t be used as a parent for local nodes in the tree.
sourcefn node_not_found() -> Self
fn node_not_found() -> Self
Value node doesn’t exist for a key.
sourcefn node_was_consumed() -> Self
fn node_was_consumed() -> Self
Procedure can’t be called on consumed node.
sourcefn insufficient_balance() -> Self
fn insufficient_balance() -> Self
Account doesn’t have enough funds to complete operation.
sourcefn unexpected_consume_output() -> Self
fn unexpected_consume_output() -> Self
Output of Tree::consume
procedure that wasn’t expected.
Outputs of consumption procedure are determined. The error is returned when unexpected one occurred. That signals, that algorithm works wrong and expected invariants are not correct.
sourcefn unexpected_node_type() -> Self
fn unexpected_node_type() -> Self
Node type that can’t occur if algorithm work well
sourcefn value_is_not_caught() -> Self
fn value_is_not_caught() -> Self
Value must have been caught, but was missed or blocked
(see TreeImpl::catch_value
for details).
sourcefn value_is_blocked() -> Self
fn value_is_blocked() -> Self
Value must have been caught or moved upstream, but was blocked
(see TreeImpl::catch_value
for details).
sourcefn value_is_not_blocked() -> Self
fn value_is_not_blocked() -> Self
Value must have been blocked, but was either moved or caught
(see TreeImpl::catch_value
for details).
sourcefn consumed_with_lock() -> Self
fn consumed_with_lock() -> Self
GasTree::consume
called on node, which has some balance locked.
sourcefn consumed_with_system_reservation() -> Self
fn consumed_with_system_reservation() -> Self
GasTree::consume
called on node, which has some system reservation.
sourcefn total_value_is_overflowed() -> Self
fn total_value_is_overflowed() -> Self
GasTree::create
called with some value amount leading to
the total value overflow.
sourcefn total_value_is_underflowed() -> Self
fn total_value_is_underflowed() -> Self
Either GasTree::consume
or GasTree::spent
called on a node creating
negative imbalance which leads to the total value drop below 0.