"cfg(debug_assertions)",
"cfg(c_bindings)",
"cfg(ldk_bench)",
+ "cfg(ldk_test_vectors)",
"cfg(taproot)",
"cfg(async_signing)",
"cfg(require_route_graph_test)",
echo -e "\n\nTesting other crate-specific builds"
# Note that outbound_commitment_test only runs in this mode because of hardcoded signature values
-cargo test -p lightning --verbose --color always --no-default-features --features=std,_test_vectors
+RUSTFLAGS="$RUSTFLAGS --cfg=ldk_test_vectors" cargo test -p lightning --verbose --color always --no-default-features --features=std
# 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 serde
# Allow signing of local transactions that may have been revoked or will be revoked, for functional testing (e.g. justice tx handling).
# This is unsafe to use in production because it may result in the counterparty publishing taking our funds.
unsafe_revoked_tx_signing = []
-# Override signing to not include randomness when generating signatures for test vectors.
-_test_vectors = []
no-std = ["hashbrown", "possiblyrandom", "libm"]
std = ["lightning-invoice/std", "bech32/std"]
break sig;
}
};
- #[cfg(all(not(feature = "grind_signatures"), not(feature = "_test_vectors")))]
+ #[cfg(all(not(feature = "grind_signatures"), not(ldk_test_vectors)))]
let sig = ctx.sign_ecdsa_with_noncedata(msg, sk, &entropy_source.get_secure_random_bytes());
- #[cfg(all(not(feature = "grind_signatures"), feature = "_test_vectors"))]
+ #[cfg(all(not(feature = "grind_signatures"), ldk_test_vectors))]
let sig = sign(ctx, msg, sk);
sig
}
}
}
- #[cfg(all(feature = "_test_vectors", not(feature = "grind_signatures")))]
+ #[cfg(ldk_test_vectors)]
fn public_from_secret_hex(secp_ctx: &Secp256k1<bitcoin::secp256k1::All>, hex: &str) -> PublicKey {
+ assert!(cfg!(not(feature = "grind_signatures")));
PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&<Vec<u8>>::from_hex(hex).unwrap()[..]).unwrap())
}
assert_eq!(decoded_chan.context.holding_cell_htlc_updates, holding_cell_htlc_updates);
}
- #[cfg(all(feature = "_test_vectors", not(feature = "grind_signatures")))]
+ #[cfg(ldk_test_vectors)]
#[test]
fn outbound_commitment_test() {
+ assert!(cfg!(not(feature = "grind_signatures")));
+
use bitcoin::sighash;
use bitcoin::consensus::encode::serialize;
use bitcoin::sighash::EcdsaSighashType;
}
}
impl HTLCSource {
- #[cfg(all(feature = "_test_vectors", not(feature = "grind_signatures")))]
- #[cfg(test)]
+ #[cfg(all(ldk_test_vectors, test))]
pub fn dummy() -> Self {
+ assert!(cfg!(not(feature = "grind_signatures")));
HTLCSource::OutboundRoute {
path: Path { hops: Vec::new(), blinded_tail: None },
session_priv: SecretKey::from_slice(&[1; 32]).unwrap(),
do_test_anchors_monitor_fixes_counterparty_payment_script_on_reload(true);
}
-#[cfg(not(feature = "_test_vectors"))]
+#[cfg(not(ldk_test_vectors))]
fn do_test_monitor_claims_with_random_signatures(anchors: bool, confirm_counterparty_commitment: bool) {
// Tests that our monitor claims will always use fresh random signatures (ensuring a unique
// wtxid) to prevent certain classes of transaction replacement at the bitcoin P2P layer.
}
}
-#[cfg(not(feature = "_test_vectors"))]
+#[cfg(not(ldk_test_vectors))]
#[test]
fn test_monitor_claims_with_random_signatures() {
do_test_monitor_claims_with_random_signatures(false, false);