wildland_corex/
lib.rs

1//
2// Wildland Project
3//
4// Copyright © 2022 Golem Foundation
5//
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License version 3 as published by
8// the Free Software Foundation.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program.  If not, see <https://www.gnu.org/licenses/>.
17
18pub mod catlib_service;
19pub mod container_manager;
20pub mod dfs;
21mod error;
22mod identity;
23mod lss;
24mod storage;
25
26pub use catlib_service::*;
27pub use container_manager::*;
28pub use entities::*;
29pub use error::*;
30pub use identity::master::*;
31pub use identity::wildland::*;
32pub use lss::*;
33pub use storage::*;
34pub use wildland_crypto::error::CryptoError;
35pub use wildland_crypto::identity::encrypting_keypair::EncryptingKeypair;
36pub use wildland_crypto::identity::{
37    generate_random_mnemonic,
38    Identity,
39    MnemonicPhrase,
40    SigningKeypair,
41};
42pub use wildland_crypto::utils;
43
44pub type CorexResult<T> = Result<T, CoreXError>;
45
46pub const DEFAULT_FOREST_KEY: &str = "wildland.forest.0";
47
48#[cfg(test)]
49pub mod test_utilities {
50    use wildland_crypto::identity::SigningKeypair;
51
52    use crate::WildlandIdentity;
53
54    pub static SIGNING_PUBLIC_KEY: &str =
55        "1f8ce714b6e52d7efa5d5763fe7412c345f133c9676db33949b8d4f30dc0912f";
56    pub static SIGNING_SECRET_KEY: &str =
57        "e02cdfa23ad7d94508108ad41410e556c5b0737e9c264d4a2304a7a45894fc57";
58
59    pub fn create_signing_keypair() -> SigningKeypair {
60        SigningKeypair::try_from_str(SIGNING_PUBLIC_KEY, SIGNING_SECRET_KEY).unwrap()
61    }
62
63    pub fn create_wildland_forest_identity() -> WildlandIdentity {
64        WildlandIdentity::Forest(0, create_signing_keypair())
65    }
66}