RUSTFLAGS="$RUSTFLAGS -A unused_variables -A unused_macros -A unused_imports -A dead_code" cargo check -p lightning --verbose --color always --features "$FEATURE"
done
+echo -e "\n\nTesting no-std builds"
+for DIR in lightning-invoice; do
+ cargo test -p $DIR --verbose --color always --no-default-features
+ # check if there is a conflict between no-std and the c_bindings cfg
+ RUSTFLAGS="$RUSTFLAGS --cfg=c_bindings" cargo test -p $DIR --verbose --color always --no-default-features
+done
+
echo -e "\n\nTesting no-std flags in various combinations"
-for DIR in lightning lightning-invoice lightning-rapid-gossip-sync; do
+for DIR in lightning lightning-rapid-gossip-sync; do
cargo test -p $DIR --verbose --color always --no-default-features --features no-std
# check if there is a conflict between no-std and the default std feature
cargo test -p $DIR --verbose --color always --features no-std
done
-for DIR in lightning lightning-invoice lightning-rapid-gossip-sync; do
+for DIR in lightning lightning-rapid-gossip-sync; do
# check if there is a conflict between no-std and the c_bindings cfg
RUSTFLAGS="$RUSTFLAGS --cfg=c_bindings" cargo test -p $DIR --verbose --color always --no-default-features --features=no-std
done
cargo test -p lightning --verbose --color always --no-default-features --features=std,_test_vectors
# This one only works for lightning-invoice
# check that compile with no-std and serde works in lightning-invoice
-cargo test -p lightning-invoice --verbose --color always --no-default-features --features no-std --features serde
+cargo test -p lightning-invoice --verbose --color always --no-default-features --features serde
echo -e "\n\nTesting no-std build on a downstream no-std crate"
# check no-std compatibility across dependencies
//!
//! [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
-#[cfg(not(any(feature = "std", feature = "no-std")))]
-compile_error!("at least one of the `std` or `no-std` features must be enabled");
-
extern crate bech32;
extern crate lightning_types;
extern crate alloc;
# Override signing to not include randomness when generating signatures for test vectors.
_test_vectors = []
-no-std = ["hashbrown", "possiblyrandom", "lightning-invoice/no-std", "libm"]
+no-std = ["hashbrown", "possiblyrandom", "libm"]
std = ["lightning-invoice/std", "bech32/std"]
# Generates low-r bitcoin signatures, which saves 1 byte in 50% of the cases
edition = "2021"
[features]
-default = ["lightning/no-std", "lightning-invoice/no-std", "lightning-rapid-gossip-sync/no-std"]
+default = ["lightning/no-std", "lightning-rapid-gossip-sync/no-std"]
[dependencies]
lightning = { path = "../lightning", default-features = false }