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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#![recursion_limit = "256"]
#![deny(
non_upper_case_globals,
non_camel_case_types,
non_snake_case,
unused_mut,
unused_imports,
dead_code,
)]
#![cfg_attr(test, allow(deprecated))]
#[macro_use]
extern crate amplify;
#[macro_use]
extern crate strict_encoding;
#[macro_use]
extern crate lazy_static;
#[cfg(feature = "serde")]
#[macro_use]
extern crate serde_with;
#[cfg(feature = "serde")]
extern crate serde_crate as serde;
pub use secp256k1zkp;
#[cfg(test)]
#[macro_export]
macro_rules! test_encode {
( $(( $data:ident, $ty:ty )),+ ) => {
$( let _: $ty = ::strict_encoding::test_helpers::test_vec_decoding_roundtrip($data).unwrap(); )+
}
}
#[cfg(test)]
#[macro_export]
macro_rules! test_garbage_exhaustive {
($range:expr; $( ($x:ident, $ty:ty, $err:ident) ),+ ) => (
{$(
let mut cp = $x.clone();
for byte in $range {
cp[0] = byte as u8;
assert_eq!(
<$ty>::strict_decode(&cp[..]).unwrap_err(),
::strict_encoding::Error::EnumValueNotKnown($err, byte)
);
}
)+}
);
}
pub mod bech32;
pub mod contract;
pub mod schema;
pub mod stash;
pub mod validation;
pub mod vm;
#[macro_use]
mod macros;
pub mod prelude {
pub use bp::dbc::{Anchor, AnchorId};
pub use contract::{
data, reveal, seal, value, AllocatedValue, Allocation, AllocationMap, AllocationValueMap,
AllocationValueVec, Assignment, AssignmentVec, AtomicValue, ConcealSeals, ConcealState,
ConfidentialDataError, ConfidentialState, ContractId, DeclarativeStrategy,
EndpointValueMap, Extension, Genesis, HashStrategy, HomomorphicBulletproofGrin,
IntoRevealedSeal, IntoSealValueMap, MergeReveal, Metadata, NoDataError, Node, NodeId,
NodeOutpoint, OutpointValue, OutpointValueMap, OutpointValueVec, OwnedRights,
ParentOwnedRights, ParentPublicRights, PedersenStrategy, PublicRights, RevealedState,
SealEndpoint, SealValueMap, State, StateRetrievalError, StateType, Transition, UtxobValue,
};
pub use schema::{
script, ExtensionSchema, ExtensionType, NodeSubtype, NodeType, PublicRightType,
PublicRightsStructure, Schema, SchemaId, ValidationScript, VmType,
};
pub use stash::{
AnchoredBundles, BundleId, ChainIter, ConcealAnchors, ConcealTransitions, Consignment,
ConsignmentEndpoints, ConsistencyError, Disclosure, ExtensionList, GraphApi, Stash,
TransitionBundle,
};
pub use validation::{Validator, Validity};
pub use vm::Validate;
pub use super::bech32::{Bech32, FromBech32, ToBech32};
use super::*;
pub use super::{bech32, schema, vm};
}
pub use prelude::*;