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
64
65
66
67
68
69
70
//
// Wildland Project
//
// Copyright © 2022 Golem Foundation
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 3 as published by
// the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.

pub mod catlib_service;
pub mod container;
pub mod container_manager;
pub mod dfs;
mod error;
pub mod forest;
mod identity;
mod lss;
pub mod sfo;
mod storage;

pub use container::*;
pub use container_manager::*;
pub use error::*;
pub use forest::*;
pub use identity::master::*;
pub use identity::wildland::*;
pub use lss::*;
pub use sfo::*;
pub use storage::*;
pub use wildland_crypto::error::CryptoError;
pub use wildland_crypto::identity::encrypting_keypair::EncryptingKeypair;
pub use wildland_crypto::identity::{
    generate_random_mnemonic,
    Identity,
    MnemonicPhrase,
    SigningKeypair,
};
pub use wildland_crypto::utils;

pub type CorexResult<T> = Result<T, CoreXError>;

pub const DEFAULT_FOREST_KEY: &str = "wildland.forest.0";

#[cfg(test)]
pub mod test_utilities {
    use wildland_crypto::identity::SigningKeypair;

    use crate::WildlandIdentity;

    pub static SIGNING_PUBLIC_KEY: &str =
        "1f8ce714b6e52d7efa5d5763fe7412c345f133c9676db33949b8d4f30dc0912f";
    pub static SIGNING_SECRET_KEY: &str =
        "e02cdfa23ad7d94508108ad41410e556c5b0737e9c264d4a2304a7a45894fc57";

    pub fn create_signing_keypair() -> SigningKeypair {
        SigningKeypair::try_from_str(SIGNING_PUBLIC_KEY, SIGNING_SECRET_KEY).unwrap()
    }

    pub fn create_wildland_forest_identity() -> WildlandIdentity {
        WildlandIdentity::Forest(0, create_signing_keypair())
    }
}