Make `test_duplicate_payment_hash_one_failure_one_success` robust 2023-01-test-robust
authorMatt Corallo <git@bluematt.me>
Wed, 25 Jan 2023 02:56:13 +0000 (02:56 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 26 Jan 2023 01:59:21 +0000 (01:59 +0000)
commit7dcbf2cd1c4de29b7c32165ca3d6ac3c47f108ec
treee28ef5196e274092362e3c6bbccf1e1d7177894c
parent8bb661449e6b990a1b86af36b323e639decf9eb1
Make `test_duplicate_payment_hash_one_failure_one_success` robust

`test_duplicate_payment_hash_one_failure_one_success` currently
fails if the "wrong" HTLC is picked to be claimed. Given the HTLCs
are identical, there's no way to figure out which we should claim.
The test instead relies on a magic value - the first one is the
right one....unless we change our CSPRNG implementation. When we
try to do so, the test randomly fails.

Here we change one HTLC to a lower amount so we can figure out
which transaction to broadcast to make the test robust against
CSPRNG changes.
lightning/src/ln/functional_tests.rs