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
57
58
59
60
61
62
63
use crate::modules;

use super::MODULE_NAME;

/// Errors emitted by the module.
#[derive(thiserror::Error, Debug, oasis_runtime_sdk_macros::Error)]
pub enum Error {
    #[error("invalid argument")]
    #[sdk_error(code = 1)]
    InvalidArgument,

    #[error("unknown application")]
    #[sdk_error(code = 2)]
    UnknownApp,

    #[error("tx not signed by RAK")]
    #[sdk_error(code = 3)]
    NotSignedByRAK,

    #[error("tx not signed by extra key")]
    #[sdk_error(code = 4)]
    NotSignedByExtraKey,

    #[error("unknown enclave")]
    #[sdk_error(code = 5)]
    UnknownEnclave,

    #[error("unknown node")]
    #[sdk_error(code = 6)]
    UnknownNode,

    #[error("endorsement from given node not allowed")]
    #[sdk_error(code = 7)]
    NodeNotAllowed,

    #[error("registration expired")]
    #[sdk_error(code = 8)]
    RegistrationExpired,

    #[error("extra key update not allowed")]
    #[sdk_error(code = 9)]
    ExtraKeyUpdateNotAllowed,

    #[error("application already exists")]
    #[sdk_error(code = 10)]
    AppAlreadyExists,

    #[error("forbidden")]
    #[sdk_error(code = 11)]
    Forbidden,

    #[error("unknown instance")]
    #[sdk_error(code = 12)]
    UnknownInstance,

    #[error("core: {0}")]
    #[sdk_error(transparent)]
    Core(#[from] modules::core::Error),

    #[error("accounts: {0}")]
    #[sdk_error(transparent)]
    Accounts(#[from] modules::accounts::Error),
}