]> git.bitcoin.ninja Git - rust-lightning/commit
Use `test`/`_test_utils` to enable single-threaded debug assertions 2023-01-no-debug-panics
authorMatt Corallo <git@bluematt.me>
Tue, 17 Jan 2023 23:40:44 +0000 (23:40 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 17 Jan 2023 23:47:45 +0000 (23:47 +0000)
commit7a9bea1bdd6ebda97086d2cd559efb234e4e7e46
tree30561f1d2333d0cc758ce5949fd64a7cfb72d390
parent358d980e643541ac59dce601fec3d2ac11034a04
Use `test`/`_test_utils` to enable single-threaded debug assertions

We have a number of debug assertions which are expected to never
fire when running in a single thread. This is just fine in tests,
and gives us good coverage of our lockorder requirements, but is
not-irregularly surprising to users, who may run with their own
debug assertions in test environments.

Instead, we gate these checks by the `cfg(test)` setting as well as
the `_test_utils` feature, ensuring they run in our own tests, but
not downstream tests.
lightning-net-tokio/src/lib.rs
lightning/src/ln/channelmanager.rs