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
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use thiserror::Error;

#[derive(Copy, Clone, Debug, Error, Eq, PartialEq)]
#[error("actor has been deleted")]
pub struct StateReadError;

#[derive(Copy, Clone, Debug, Error, Eq, PartialEq)]
pub enum StateUpdateError {
    #[error("actor has been deleted")]
    ActorDeleted,
    #[error("current execution context is read-only")]
    ReadOnly,
}

#[derive(Copy, Clone, Debug, Error, Eq, PartialEq)]
pub enum ActorDeleteError {
    #[error("cannot self-destruct when read-only")]
    ReadOnly,
    #[error("actor did not request unspent funds to be burnt")]
    UnspentFunds,
}

#[derive(Copy, Clone, Debug, Error, Eq, PartialEq)]
pub enum EpochBoundsError {
    #[error("the requested epoch isn't valid")]
    Invalid,
    #[error("the requested epoch exceeds the maximum lookback")]
    ExceedsLookback,
}