dubp_wallet/
lib.rs

1//  Copyright (C) 2020  Éloïs SANCHEZ.
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as
5// published by the Free Software Foundation, either version 3 of the
6// License, or (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program.  If not, see <https://www.gnu.org/licenses/>.
15
16//! Define DUBP Wallet.
17
18#![deny(
19    clippy::expect_used,
20    clippy::unwrap_used,
21    missing_debug_implementations,
22    missing_copy_implementations,
23    trivial_casts,
24    trivial_numeric_casts,
25    unsafe_code,
26    unstable_features,
27    unused_import_braces
28)]
29
30mod script;
31mod source;
32
33// re-export crates
34pub use dubp_common;
35pub use smallvec;
36
37// prelude
38pub mod prelude {
39    pub use crate::script::v10::{
40        ScriptNeverUnlockableError, WalletConditionV10, WalletScriptNodesV10, WalletScriptV10,
41        WalletSubScriptV10, WalletUnlockProofV10,
42    };
43    pub use crate::source::v10::{
44        SourceIdV10, SourceV10, SourceV10NotUnlockableError, UdSourceIdV10, UtxoIdV10,
45    };
46    pub use crate::source::SourceAmount;
47}
48
49// Crate imports
50pub(crate) use crate::prelude::*;
51pub(crate) use dubp_common::crypto::hashs::Hash;
52pub(crate) use dubp_common::crypto::keys::ed25519::PublicKey;
53pub(crate) use dubp_common::prelude::*;
54pub(crate) use serde::{Deserialize, Serialize};
55pub(crate) use smallvec::SmallVec;
56pub(crate) use std::{
57    collections::{BTreeSet, HashSet},
58    fmt::Debug,
59    iter::Sum,
60    ops::{Add, Sub},
61};
62pub(crate) use thiserror::Error;